Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement detached signal sender #56

Open
wants to merge 198 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
8fa6892
v0.38.0
Eugeny Aug 17, 2023
52e5eaa
Use `ChannelMsg::WindowAdjusted` during data transfer
jgrund Sep 12, 2023
7c03dd9
bumb toolchain & add sftp client example
AspectUnk Sep 16, 2023
6747f6b
Update Cargo.toml
AspectUnk Sep 16, 2023
d1fbdb6
some clippy fixes
AspectUnk Sep 17, 2023
8c5acd5
fix tests for windows
AspectUnk Sep 17, 2023
2f56a64
fmt
Eugeny Sep 20, 2023
1191d0a
lint
Eugeny Sep 20, 2023
59a604a
Merge branch 'main' into pr/180
Eugeny Sep 20, 2023
636460c
Revert "Use `ChannelMsg::WindowAdjusted` during data transfer"
Eugeny Sep 20, 2023
7bd1c40
Update rust.yml
Eugeny Sep 20, 2023
fc77c53
Promote channels module into it's own directory
lowlevl Sep 18, 2023
acd744a
Add channels::io::{ChannelTx, ChannelRx} and implement Channel::into_…
lowlevl Sep 18, 2023
b09efbc
Change Channel::into_io_parts() from taking ownership to a &mut
lowlevl Sep 18, 2023
588ab6f
Switch ChannelTx and ChannelRx structures to tokio::sync::Mutex
lowlevl Sep 18, 2023
987e6a8
Add support for ExtendedData to io::{ChannelTx, ChannelRx}
lowlevl Sep 18, 2023
8a29002
Moved handling of ChannelMsg::WindowAdjusted in the Session::server_r…
lowlevl Sep 18, 2023
0363576
Add back the 'writable_packet_size' method to Channel
lowlevl Sep 21, 2023
9e2dcc1
Switch to a 'make_{reader, writer}' design instead of 'Channel::into_…
lowlevl Sep 21, 2023
b56e636
Downgrade &mut self references to &self in Channel methods
lowlevl Sep 21, 2023
2deffd0
Rework the ChannelStream to use io::{ChannelTx, ChannelRx}
lowlevl Sep 21, 2023
476d031
Fix flaky test in russh-keys by awaiting for ssh-agent's socket
lowlevl Sep 21, 2023
f6d4360
Move tests from the lib.rs to a dedicated tests module
lowlevl Sep 21, 2023
698e752
Added tests for Channel streams and fixed some issues
lowlevl Sep 21, 2023
737a49c
Modified the Channel stream reader/writer test to also cover Extended…
lowlevl Sep 21, 2023
79884e6
update README.md [skip ci]
allcontributors[bot] Sep 22, 2023
0e8cda2
update .all-contributorsrc [skip ci]
allcontributors[bot] Sep 22, 2023
e5f1224
v0.39.0-beta.1
Eugeny Sep 22, 2023
0869a09
Remove ChannelStream::new from the public interface
lowlevl Sep 25, 2023
206991b
Make Channel::{make_{reader, writer}[_ext]} methods return impl Traits
lowlevl Sep 25, 2023
fe3717f
Add back the doc-comment for ChannelStream
lowlevl Sep 25, 2023
df34137
added Handler::auth_publickey_offered
Eugeny Sep 27, 2023
e0d9481
added Handler::auth_publickey_offered
Eugeny Sep 27, 2023
0347acf
updated homepage
Eugeny Sep 27, 2023
80281ca
v0.39.0
Eugeny Sep 27, 2023
e81db83
Make winapi dep windows only
rukai Oct 15, 2023
02899e9
bumped cryptovec
Eugeny Oct 16, 2023
4a683d2
Add client-sent keepalives
mmirate Oct 27, 2023
a1169a3
fixup
mmirate Oct 30, 2023
d0ca12a
update README.md [skip ci]
allcontributors[bot] Oct 31, 2023
d3c4108
update .all-contributorsrc [skip ci]
allcontributors[bot] Oct 31, 2023
9c25fa2
Support hashed hostnames in known_hosts file
george-hopkins Oct 31, 2023
cd59280
update README.md [skip ci]
allcontributors[bot] Nov 1, 2023
6fdbb09
update .all-contributorsrc [skip ci]
allcontributors[bot] Nov 1, 2023
a904a08
Fix handling of key constraints
george-hopkins Nov 1, 2023
72afa2b
Eliminate busywaiting in ChannelRx
mmirate Oct 27, 2023
84072f3
Reduce busywaiting in ChannelTx
mmirate Oct 27, 2023
c4a0688
Add method to read known host key
george-hopkins Nov 1, 2023
42369c7
updated examples
Eugeny Nov 1, 2023
abbdbf3
code reformat
Eugeny Nov 1, 2023
d86af4f
fixed #206 - check formatting in CI
Eugeny Nov 1, 2023
f09ba6a
Update rust.yml
Eugeny Nov 1, 2023
75ec760
Run rustfmt in check mode
george-hopkins Nov 3, 2023
92660ef
Support for NIST P-256 public keys
george-hopkins Nov 5, 2023
3463ed0
Fix ChannelMsg::Close docs
rukai Nov 9, 2023
cd59590
Enforce client timeout
amtelekom Sep 28, 2023
43bdc07
Close Channels on Disconnect
amtelekom Sep 30, 2023
c66f4b0
fixed #198 - agent server - ed25519 key parsing
Eugeny Nov 15, 2023
c0f3458
added Server::handle_session_error and session closure logging
Eugeny Nov 15, 2023
d0908de
fixed #218 - fixed padding calculation, AES-GCM rekey and hmac-sha2-2…
Eugeny Dec 2, 2023
9589623
lint
Eugeny Dec 2, 2023
39e6c52
Merge tag 'v0.39.0'
Eugeny Dec 2, 2023
271e362
v0.40.0
Eugeny Dec 2, 2023
a355c62
added strict kex support (terrapin mitigation / kex-strict-*-v00@open…
Eugeny Nov 17, 2023
5f93b89
v0.40.1
Eugeny Dec 12, 2023
1aa340a
Merge branch 'terrapin'
Eugeny Dec 18, 2023
dca6a02
v0.40.2
Eugeny Dec 18, 2023
da4c040
bump dev toolchain
Eugeny Dec 18, 2023
b9dce87
Improve keepalive and inactivity timers
mmirate Nov 13, 2023
371b28a
Add ClientAliveInterval analogue to server
mmirate Nov 20, 2023
5c7a79c
Reset keepalive-timer after sending keepalive
amtelekom Nov 22, 2023
21a0f19
Fix formatting
mmirate Dec 18, 2023
2a4b5a0
v0.41.0-beta.1
mmirate Dec 18, 2023
bd13e95
Avert the race between sending data and sending EOF
mmirate Dec 18, 2023
9ef5b1c
Receive data after exit status in example
mmirate Dec 18, 2023
54595f3
cargo fmt
mmirate Dec 18, 2023
2ce82f2
Support for NIST P-521 public keys
akeamc Dec 9, 2023
0f3639d
oops
akeamc Dec 9, 2023
91bce4b
misc fixes
Eugeny Jan 23, 2024
2f08873
Add p521 parse test, loosen p521 version
akeamc Jan 23, 2024
01e4ba8
updated contributors
Eugeny Jan 23, 2024
93e36ec
added dh-gr16-512
bho01 Jan 26, 2024
8f6af5e
added dh-gr16-512
bho01 Jan 26, 2024
b3a5060
version number and kex priority changed
bho01 Jan 26, 2024
545415e
version number and kex priority changed
bho01 Jan 26, 2024
1d6d687
doc
Eugeny Jan 26, 2024
c8f1042
update README.md [skip ci]
allcontributors[bot] Jan 26, 2024
6824b44
update .all-contributorsrc [skip ci]
allcontributors[bot] Jan 26, 2024
273fd88
Add `russh::server::run_on_socket` to facilitate dropping privileges …
samuela Jan 24, 2024
10091b5
update README.md [skip ci]
allcontributors[bot] Jan 26, 2024
0a42843
update .all-contributorsrc [skip ci]
allcontributors[bot] Jan 26, 2024
5072f00
bump
Eugeny Jan 26, 2024
2c7858e
bump
Eugeny Jan 26, 2024
be6f5be
implement Ord, PartialOrd for ChannelId
Sherlock-Holo Feb 1, 2024
a2a43ac
update README.md [skip ci]
allcontributors[bot] Feb 1, 2024
2ce133d
update .all-contributorsrc [skip ci]
allcontributors[bot] Feb 1, 2024
44a2392
server/encrypted.rs: respect `proceed_with_methods` in "none" and "pa…
samuela Feb 3, 2024
c7f6c5b
server/session.rs: typo
samuela Feb 3, 2024
cf7752f
clean up module docs
Eugeny Feb 4, 2024
8a46833
Fix https://github.com/warp-tech/russh/issues/232
samuela Feb 3, 2024
1541fe5
Analogous keepalive fixes to the client module
samuela Feb 7, 2024
859e685
refactor to use mutable reference instead of owned variables
ricott1 Feb 7, 2024
0763767
all tests passing
ricott1 Feb 7, 2024
3f164f1
Merge branch 'main' into refactor/handler_trait
ricott1 Feb 7, 2024
a592366
Move run and run_on_socket to Server trait
ricott1 Feb 8, 2024
c7cf00b
Merge branch 'refactor/handler_trait' of github.com:ricott1/russh int…
ricott1 Feb 8, 2024
07f8320
Revert changes to KexDhDone
ricott1 Feb 8, 2024
42c98a6
fixed #227 - only advertise host key algos for present host keys
Eugeny Feb 10, 2024
63f19da
lint
Eugeny Feb 10, 2024
f4e53e7
v0.42.0
Eugeny Feb 10, 2024
06184f5
Merge branch 'main' into pr/247
Eugeny Feb 10, 2024
56a0dd2
update README.md [skip ci]
allcontributors[bot] Feb 10, 2024
c47f49f
update .all-contributorsrc [skip ci]
allcontributors[bot] Feb 10, 2024
c19c6f4
Merge branch 'pr/247'
Eugeny Feb 10, 2024
8934a80
v0.43.0-beta.1
Eugeny Feb 10, 2024
6795ef4
update toolchain and add ratatui to dev dependencies
ricott1 Feb 11, 2024
dcbe4ba
update examples to new APIs
ricott1 Feb 11, 2024
41f25bf
docs
Eugeny Feb 11, 2024
223c821
lint
Eugeny Feb 11, 2024
a3d3129
Sync global request response handling between Client/Server
amtelekom Feb 12, 2024
5c60d30
Actually process global request results
amtelekom Feb 12, 2024
45edb29
added specific error types for keepalive and inactivity timeouts
Eugeny Feb 26, 2024
1c43473
fix
Eugeny Feb 26, 2024
1d7dab8
Additional Disconnect Handling
amtelekom Feb 26, 2024
f1985e1
Create FUNDING.yml
Eugeny Mar 1, 2024
0fcb1ec
Allow retrieving peer SSH Protocol Version String (#260)
amtelekom Mar 14, 2024
62366e9
#259, #245, ref #227 - fixed host key algo selection when Preferred:…
Eugeny Mar 21, 2024
6a1aa8b
lint
Eugeny Mar 21, 2024
a375283
v0.43.0
Eugeny Mar 21, 2024
58d9274
Fix compilation error when using without the flate2 feature (#263)
citorva Mar 27, 2024
0915744
fixed #270 - `decode_pkcs5` does not remove padding
Eugeny Apr 22, 2024
e745827
Updated `curve25519-dalek` to 4.1.2 (#269)
chanderlud Apr 22, 2024
3041b0c
Implement ecdsa-sha2-nistp{256,384,521} (#267)
robertabcd Apr 22, 2024
c850dbd
Add pure-rust RSA implementation (#273)
robertabcd Apr 28, 2024
8d582f6
Fix ed25519 key format in pkcs8 (#272)
robertabcd Apr 28, 2024
4f749f4
Replace custom PKCS #8 parsing with `der` crate and others (#274)
robertabcd Apr 28, 2024
4b40f51
Zeroize RSA private key data on drop (#275)
robertabcd Apr 30, 2024
b20504d
Implements client support for OpenSSH Certificates (#278)
shoaibmerchant May 4, 2024
83ab968
format
Eugeny May 4, 2024
194430b
Use `ssh-key` crate to decode OpenSSH public/private keys (#279)
robertabcd May 4, 2024
3751b33
add shoaibmerchant as a contributor for code (#280)
allcontributors[bot] May 4, 2024
d923101
extract common workspace deps
Eugeny May 4, 2024
0452354
Update README.md
Eugeny May 4, 2024
0fc65ea
v0.44.0-beta.1
Eugeny May 4, 2024
3bfd99f
ecdh-sha2-nistp{256,384,521} kex support (#282)
gleason-m May 10, 2024
f356408
add gleason-m as a contributor for code (#283)
allcontributors[bot] May 10, 2024
e4584a4
cryptovec: Fix a segmentation fault (#288)
elegaanz May 25, 2024
7e407d2
add elegaanz as a contributor for code (#289)
allcontributors[bot] May 25, 2024
9cce48c
Allow ssh-rsa keys to be used for rsa-sha2-* auth (#290)
elegaanz May 26, 2024
b657732
cryptovec v0.7.3
Eugeny May 25, 2024
7c73e00
fixed #285 - NISTP 384/521 kex using wrong hash
Eugeny May 31, 2024
461d62a
docs
Eugeny May 31, 2024
2bfe426
Fix hardcoded public key auth negotiation (#294)
tomknig Jun 2, 2024
63943cb
add tomknig as a contributor for code (#295)
allcontributors[bot] Jun 2, 2024
2577754
v0.44.0-beta.2
Eugeny Jun 3, 2024
643be05
Fix block ciphers + HMAC_SHA1_ETM (#298)
Barre Jun 7, 2024
8e02828
add Barre as a contributor for code (#300)
allcontributors[bot] Jun 7, 2024
9e1ed09
Overachiever host key checking (#302)
spoutn1k Jun 8, 2024
97294d8
add spoutn1k as a contributor for code (#303)
allcontributors[bot] Jun 8, 2024
800969b
Implement `-cbc` ciphers. (#297)
Barre Jun 8, 2024
88196a7
allow converting ChannelId into u32
Eugeny Jun 28, 2024
3f4646a
removed use of unstable Option::inspect
Eugeny Jun 28, 2024
1eaadfb
Add support for glob pattern matching in Host directives (#306)
packetsource Jul 4, 2024
1615319
add packetsource as a contributor for code (#309)
allcontributors[bot] Jul 4, 2024
77cc2f7
algorithm names QoL changes
Eugeny Jul 9, 2024
3d4fed1
v0.44.0-beta.3
Eugeny Jul 9, 2024
3c4a0ca
fmt
Eugeny Jul 10, 2024
ea6823b
fixed incorrect PKCS#8 Ed25519 key serialization
Eugeny Jul 16, 2024
fe64362
formatting
Eugeny Jul 16, 2024
64c9b1a
v0.44.0-beta.4
Eugeny Jul 16, 2024
6a6f344
lint
Eugeny Jul 16, 2024
f0de148
missing version bump
Eugeny Jul 16, 2024
512c441
v0.44.0-beta.5
Eugeny Jul 16, 2024
9c2265e
re-export russh_keys
Eugeny Jul 17, 2024
f2d94c0
fixed Eugeny/warpgate#996 - prevent offering unparsable keys from end…
Eugeny Jul 18, 2024
4178268
v0.44.0
Eugeny Jul 18, 2024
0dae017
Update Cargo.toml (#321)
Dylan-DPC Aug 2, 2024
9b9e145
Consolidate dirs deps (#320)
rukai Aug 2, 2024
4eaa080
added 3des-cbc cipher support
Eugeny Aug 5, 2024
f660ea3
fixed GHSA-vgvv-x7xg-6cqg - OOM Denial of Service due to allocation o…
Eugeny Aug 14, 2024
ba8bde9
v0.44.1
Eugeny Aug 14, 2024
45353c3
Merge branch 'v0.44'
Eugeny Aug 14, 2024
ca5129f
bumped russh
Eugeny Aug 14, 2024
97dc08b
Support Pageant as agent (#326)
Eugeny Aug 17, 2024
ed1fec1
expose is_pageant_running
Eugeny Aug 19, 2024
26aae26
added named pipe support for AgentClient and .dynamic()
Eugeny Aug 19, 2024
6c3b4d3
bump
Eugeny Aug 19, 2024
a78d798
fixed pageant crate
Eugeny Aug 19, 2024
67a6ba8
Implement streamlocal-forward for remote => local UDS forwarding (#312)
kanpov Aug 20, 2024
b9759d4
client channel handling changes
Eugeny Aug 20, 2024
934c784
bump
Eugeny Aug 20, 2024
8b88465
added AgentClient::into_inner
Eugeny Aug 20, 2024
b704f4c
Remove leftover extraneous debugging in host globbing function (#328)
packetsource Aug 21, 2024
c99f49c
fixed `Error::Disconnect` getting returned from `connect` instead of …
Eugeny Aug 22, 2024
83b7f3e
Merge branch 'main' of github.com:warp-tech/russh
Eugeny Aug 22, 2024
d6ee97a
new rich NoCommonAlgo error
Eugeny Aug 22, 2024
4115b8f
bump
Eugeny Aug 22, 2024
34771f4
Implement detached signal sender
jgrund Jun 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 144 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,150 @@
"contributions": [
"code"
]
},
{
"login": "Nurrl",
"name": "Maya the bee",
"avatar_url": "https://avatars.githubusercontent.com/u/15341887?v=4",
"profile": "https://github.com/Nurrl",
"contributions": [
"code"
]
},
{
"login": "mmirate",
"name": "Milo Mirate",
"avatar_url": "https://avatars.githubusercontent.com/u/992859?v=4",
"profile": "https://github.com/mmirate",
"contributions": [
"code"
]
},
{
"login": "george-hopkins",
"name": "George Hopkins",
"avatar_url": "https://avatars.githubusercontent.com/u/552590?v=4",
"profile": "https://github.com/george-hopkins",
"contributions": [
"code"
]
},
{
"login": "akeamc",
"name": "Åke Amcoff",
"avatar_url": "https://avatars.githubusercontent.com/u/17624114?v=4",
"profile": "https://amcoff.net/",
"contributions": [
"code"
]
},
{
"login": "bho01",
"name": "Brendon Ho",
"avatar_url": "https://avatars.githubusercontent.com/u/12106620?v=4",
"profile": "http://brendonho.com",
"contributions": [
"code"
]
},
{
"login": "samuela",
"name": "Samuel Ainsworth",
"avatar_url": "https://avatars.githubusercontent.com/u/226872?v=4",
"profile": "http://samlikes.pizza/",
"contributions": [
"code"
]
},
{
"login": "sherlock-holo",
"name": "Sherlock Holo",
"avatar_url": "https://avatars.githubusercontent.com/u/10096425?v=4",
"profile": "https://github.com/Sherlock-Holo",
"contributions": [
"code"
]
},
{
"login": "ricott1",
"name": "Alessandro Ricottone",
"avatar_url": "https://avatars.githubusercontent.com/u/16502243?v=4",
"profile": "https://github.com/ricott1",
"contributions": [
"code"
]
},
{
"login": "T0b1-iOS",
"name": "T0b1-iOS",
"avatar_url": "https://avatars.githubusercontent.com/u/15174814?v=4",
"profile": "https://github.com/T0b1-iOS",
"contributions": [
"code"
]
},
{
"login": "shoaibmerchant",
"name": "Shoaib Merchant",
"avatar_url": "https://avatars.githubusercontent.com/u/4598631?v=4",
"profile": "https://mecha.so",
"contributions": [
"code"
]
},
{
"login": "gleason-m",
"name": "Michael Gleason",
"avatar_url": "https://avatars.githubusercontent.com/u/86493344?v=4",
"profile": "https://github.com/gleason-m",
"contributions": [
"code"
]
},
{
"login": "elegaanz",
"name": "Ana Gelez",
"avatar_url": "https://avatars.githubusercontent.com/u/16254623?v=4",
"profile": "https://ana.gelez.xyz",
"contributions": [
"code"
]
},
{
"login": "tomknig",
"name": "Tom König",
"avatar_url": "https://avatars.githubusercontent.com/u/3586316?v=4",
"profile": "https://github.com/tomknig",
"contributions": [
"code"
]
},
{
"login": "Barre",
"name": "Pierre Barre",
"avatar_url": "https://avatars.githubusercontent.com/u/45085843?v=4",
"profile": "https://www.legaltile.com/",
"contributions": [
"code"
]
},
{
"login": "spoutn1k",
"name": "Jean-Baptiste Skutnik",
"avatar_url": "https://avatars.githubusercontent.com/u/22240065?v=4",
"profile": "http://skutnik.page",
"contributions": [
"code"
]
},
{
"login": "packetsource",
"name": "Adam Chappell",
"avatar_url": "https://avatars.githubusercontent.com/u/6276475?v=4",
"profile": "http://blog.packetsource.net/",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
github: eugeny
open_collective: tabby
ko_fi: eugeny
16 changes: 14 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Rust

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]

env:
CARGO_TERM_COLOR: always
Expand All @@ -27,6 +27,18 @@ jobs:
with:
package: russh

Formatting:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install rustfmt
run: rustup component add rustfmt

- name: rustfmt
run: cargo fmt --check

Clippy:
runs-on: ubuntu-latest

Expand Down
20 changes: 19 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
[workspace]
members = [ "russh-keys", "russh", "russh-config", "cryptovec"]
members = ["russh-keys", "russh", "russh-config", "cryptovec", "pageant"]

[patch.crates-io]
russh = { path = "russh" }
russh-keys = { path = "russh-keys" }
russh-cryptovec = { path = "cryptovec" }
russh-config = { path = "russh-config" }

[workspace.dependencies]
aes = "0.8"
async-trait = "0.1"
byteorder = "1.4"
digest = "0.10"
futures = "0.3"
hmac = "0.12"
log = "0.4"
openssl = { version = "0.10" }
rand = "0.8"
sha1 = { version = "0.10", features = ["oid"] }
sha2 = { version = "0.10", features = ["oid"] }
ssh-encoding = "0.2"
ssh-key = { version = "0.6", features = ["ed25519", "rsa", "encryption"] }
thiserror = "1.0"
tokio = { version = "1.17.0" }
tokio-stream = { version = "0.1", features = ["net", "sync"] }
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Russh

[![Rust](https://github.com/warp-tech/russh/actions/workflows/rust.yml/badge.svg)](https://github.com/warp-tech/russh/actions/workflows/rust.yml) <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-19-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-35-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

Low-level Tokio SSH2 client and server implementation.

Examples: [simple client](russh/examples/client_exec_simple.rs), [interactive PTY client](russh/examples/client_exec_interactive.rs), [server](russh/examples/echoserver.rs), [SFTP client](russh/examples/sftp_client.rs), [SFTP server](russh/examples/sftp_server.rs).

This is a fork of [Thrussh](https://nest.pijul.com/pijul/thrussh) by Pierre-Étienne Meunier.

> ✨ = added in Russh
Expand All @@ -14,33 +17,52 @@ This is a fork of [Thrussh](https://nest.pijul.com/pijul/thrussh) by Pierre-Éti
* `direct-tcpip` (local port forwarding)
* `forward-tcpip` (remote port forwarding) ✨
* `direct-streamlocal` (local UNIX socket forwarding, client only) ✨
* `forward-streamlocal` (remote UNIX socket forwarding) ✨
* Ciphers:
* `[email protected]`
* `[email protected]` ✨
* `aes256-ctr` ✨
* `aes192-ctr` ✨
* `aes128-ctr` ✨
* `aes256-cbc` ✨
* `aes192-cbc` ✨
* `aes128-cbc` ✨
* `3des-cbc` ✨
* Key exchanges:
* `[email protected]`
* `diffie-hellman-group1-sha1` ✨
* `diffie-hellman-group14-sha1` ✨
* `diffie-hellman-group14-sha256` ✨
* `diffie-hellman-group16-sha512` ✨
* `ecdh-sha2-nistp256` ✨
* `ecdh-sha2-nistp384` ✨
* `ecdh-sha2-nistp521` ✨
* MACs:
* `hmac-sha1` ✨
* `hmac-sha2-256` ✨
* `hmac-sha2-512` ✨
* `[email protected]` ✨
* `[email protected]` ✨
* `[email protected]` ✨
* Host keys:
* Host keys and public key auth:
* `ssh-ed25519`
* `rsa-sha2-256`
* `rsa-sha2-512`
* `ssh-rsa` ✨
* `ecdsa-sha2-nistp256` ✨
* `ecdsa-sha2-nistp384` ✨
* `ecdsa-sha2-nistp521` ✨
* Authentication methods:
* `password`
* `publickey`
* `keyboard-interactive`
* `none`
* OpenSSH certificates (client only ✨)
* Dependency updates
* OpenSSH keepalive request handling ✨
* OpenSSH agent forwarding channels ✨
* OpenSSH `server-sig-algs` extension ✨
* `openssl` dependency is optional ✨

## Safety

Expand All @@ -60,7 +82,7 @@ This is a fork of [Thrussh](https://nest.pijul.com/pijul/thrussh) by Pierre-Éti

## Ecosystem

* [russh-sftp](https://crates.io/crates/russh-sftp) - server-side SFTP subsystem support for `russh` - see `russh/examples/sftp_server.rs`.
* [russh-sftp](https://crates.io/crates/russh-sftp) - server-side and client-side SFTP subsystem support for `russh` - see `russh/examples/sftp_server.rs` or `russh/examples/sftp_client.rs`.
* [async-ssh2-tokio](https://crates.io/crates/async-ssh2-tokio) - simple high-level API for running commands over SSH.

## Contributors ✨
Expand Down Expand Up @@ -96,6 +118,26 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://gotlou.srht.site"><img src="https://avatars.githubusercontent.com/u/23006870?v=4?s=100" width="100px;" alt="Saksham Mittal"/><br /><sub><b>Saksham Mittal</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=gotlougit" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://canoncollision.com"><img src="https://avatars.githubusercontent.com/u/5120858?v=4?s=100" width="100px;" alt="Lucas Kent"/><br /><sub><b>Lucas Kent</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=rukai" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/RDruon"><img src="https://avatars.githubusercontent.com/u/64585623?v=4?s=100" width="100px;" alt="Raphael Druon"/><br /><sub><b>Raphael Druon</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=RDruon" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Nurrl"><img src="https://avatars.githubusercontent.com/u/15341887?v=4?s=100" width="100px;" alt="Maya the bee"/><br /><sub><b>Maya the bee</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=Nurrl" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mmirate"><img src="https://avatars.githubusercontent.com/u/992859?v=4?s=100" width="100px;" alt="Milo Mirate"/><br /><sub><b>Milo Mirate</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=mmirate" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/george-hopkins"><img src="https://avatars.githubusercontent.com/u/552590?v=4?s=100" width="100px;" alt="George Hopkins"/><br /><sub><b>George Hopkins</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=george-hopkins" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://amcoff.net/"><img src="https://avatars.githubusercontent.com/u/17624114?v=4?s=100" width="100px;" alt="Åke Amcoff"/><br /><sub><b>Åke Amcoff</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=akeamc" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://brendonho.com"><img src="https://avatars.githubusercontent.com/u/12106620?v=4?s=100" width="100px;" alt="Brendon Ho"/><br /><sub><b>Brendon Ho</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=bho01" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://samlikes.pizza/"><img src="https://avatars.githubusercontent.com/u/226872?v=4?s=100" width="100px;" alt="Samuel Ainsworth"/><br /><sub><b>Samuel Ainsworth</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=samuela" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Sherlock-Holo"><img src="https://avatars.githubusercontent.com/u/10096425?v=4?s=100" width="100px;" alt="Sherlock Holo"/><br /><sub><b>Sherlock Holo</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=sherlock-holo" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ricott1"><img src="https://avatars.githubusercontent.com/u/16502243?v=4?s=100" width="100px;" alt="Alessandro Ricottone"/><br /><sub><b>Alessandro Ricottone</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=ricott1" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/T0b1-iOS"><img src="https://avatars.githubusercontent.com/u/15174814?v=4?s=100" width="100px;" alt="T0b1-iOS"/><br /><sub><b>T0b1-iOS</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=T0b1-iOS" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://mecha.so"><img src="https://avatars.githubusercontent.com/u/4598631?v=4?s=100" width="100px;" alt="Shoaib Merchant"/><br /><sub><b>Shoaib Merchant</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=shoaibmerchant" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/gleason-m"><img src="https://avatars.githubusercontent.com/u/86493344?v=4?s=100" width="100px;" alt="Michael Gleason"/><br /><sub><b>Michael Gleason</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=gleason-m" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://ana.gelez.xyz"><img src="https://avatars.githubusercontent.com/u/16254623?v=4?s=100" width="100px;" alt="Ana Gelez"/><br /><sub><b>Ana Gelez</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=elegaanz" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tomknig"><img src="https://avatars.githubusercontent.com/u/3586316?v=4?s=100" width="100px;" alt="Tom König"/><br /><sub><b>Tom König</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=tomknig" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.legaltile.com/"><img src="https://avatars.githubusercontent.com/u/45085843?v=4?s=100" width="100px;" alt="Pierre Barre"/><br /><sub><b>Pierre Barre</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=Barre" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://skutnik.page"><img src="https://avatars.githubusercontent.com/u/22240065?v=4?s=100" width="100px;" alt="Jean-Baptiste Skutnik"/><br /><sub><b>Jean-Baptiste Skutnik</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=spoutn1k" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://blog.packetsource.net/"><img src="https://avatars.githubusercontent.com/u/6276475?v=4?s=100" width="100px;" alt="Adam Chappell"/><br /><sub><b>Adam Chappell</b></sub></a><br /><a href="https://github.com/warp-tech/russh/commits?author=packetsource" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
5 changes: 4 additions & 1 deletion cryptovec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ include = ["Cargo.toml", "src/lib.rs"]
license = "Apache-2.0"
name = "russh-cryptovec"
repository = "https://github.com/warp-tech/russh"
version = "0.7.0"
version = "0.7.3"
rust-version = "1.60"

[dependencies]
libc = "0.2"

[target.'cfg(target_os = "windows")'.dependencies]
winapi = {version = "0.3", features = ["basetsd", "minwindef", "memoryapi"]}
41 changes: 31 additions & 10 deletions cryptovec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,15 @@ impl CryptoVec {
let next_capacity = size.next_power_of_two();
let old_ptr = self.p;
let next_layout = std::alloc::Layout::from_size_align_unchecked(next_capacity, 1);
self.p = std::alloc::alloc_zeroed(next_layout);
let new_ptr = std::alloc::alloc_zeroed(next_layout);
if new_ptr.is_null() {
#[allow(clippy::panic)]
{
panic!("Realloc failed, pointer = {:?} {:?}", self, size)
}
}

self.p = new_ptr;
mlock(self.p, next_capacity);

if self.capacity > 0 {
Expand All @@ -261,15 +269,8 @@ impl CryptoVec {
std::alloc::dealloc(old_ptr, layout);
}

if self.p.is_null() {
#[allow(clippy::panic)]
{
panic!("Realloc failed, pointer = {:?} {:?}", self, size)
}
} else {
self.capacity = next_capacity;
self.size = size;
}
self.capacity = next_capacity;
self.size = size;
}
}
}
Expand Down Expand Up @@ -429,3 +430,23 @@ impl Drop for CryptoVec {
}
}
}

#[cfg(test)]
mod tests {
use super::*;

// If `resize` is called with a size that is too large to be allocated, it
// should panic, and not segfault or fail silently.
#[test]
fn large_resize_panics() {
let result = std::panic::catch_unwind(|| {
let mut vec = CryptoVec::new();
// Write something into the vector, so that there is something to
// copy when reallocating, to test all code paths.
vec.push(42);

vec.resize(1_000_000_000_000)
});
assert!(result.is_err());
}
}
Loading