Skip to content

Commit 9dd4584

Browse files
authored
Merge branch 'Eugeny:main' into feat/client-hostkeys-prove
2 parents d4a8687 + 8a51a0d commit 9dd4584

26 files changed

Lines changed: 862 additions & 170 deletions

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,15 @@
814814
"contributions": [
815815
"code"
816816
]
817+
},
818+
{
819+
"login": "tluyben",
820+
"name": "tluyben",
821+
"avatar_url": "https://avatars.githubusercontent.com/u/623448?v=4",
822+
"profile": "https://github.com/tluyben",
823+
"contributions": [
824+
"code"
825+
]
817826
}
818827
],
819828
"contributorsPerLine": 7,

.github/workflows/rust.yml

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Rust
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
env:
1010
CARGO_TERM_COLOR: always
@@ -14,101 +14,101 @@ jobs:
1414
runs-on: ubuntu-24.04
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v2
1818

19-
- name: Build (no features enabled)
20-
run: cargo build --verbose
19+
- name: Build (no features enabled)
20+
run: cargo build --verbose
2121

22-
- name: Build (all features enabled)
23-
run: cargo build --verbose --all-features
22+
- name: Build (all features enabled)
23+
run: cargo build --verbose --all-features
2424

2525
Build-Windows:
2626
runs-on: windows-latest
2727

2828
steps:
29-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v2
3030

31-
- name: install nasm
32-
run: |
33-
choco install nasm
34-
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
31+
- name: install nasm
32+
run: |
33+
choco install nasm
34+
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
3535
36-
- name: Build (no features enabled)
37-
run: cargo build --verbose
36+
- name: Build (no features enabled)
37+
run: cargo build --verbose
3838

39-
- name: Build (all features enabled)
40-
run: cargo build --verbose --all-features
39+
- name: Build (all features enabled)
40+
run: cargo build --verbose --all-features
4141

4242
Build-WASM:
4343
runs-on: ubuntu-24.04
4444

4545
steps:
46-
- uses: actions/checkout@v2
46+
- uses: actions/checkout@v2
4747

48-
- name: Install target
49-
run: |
50-
rustup toolchain add 1.88.0
51-
rustup target add --toolchain 1.88.0 wasm32-wasip1
48+
- name: Install target
49+
run: |
50+
rustup toolchain add 1.89.0
51+
rustup target add --toolchain 1.89.0 wasm32-wasip1
5252
53-
- name: Build (WASM-compatible features)
54-
run: cargo +1.88.0 build --verbose --target wasm32-wasip1 --no-default-features --features flate2,ring -p russh
53+
- name: Build (WASM-compatible features)
54+
run: cargo +1.89.0 build --verbose --target wasm32-wasip1 --no-default-features --features flate2,ring -p russh
5555

5656
Formatting:
5757
runs-on: ubuntu-24.04
5858

5959
steps:
60-
- uses: actions/checkout@v2
60+
- uses: actions/checkout@v2
6161

62-
- name: Install rustfmt
63-
run: rustup component add rustfmt
62+
- name: Install rustfmt
63+
run: rustup component add rustfmt
6464

65-
- name: rustfmt
66-
run: cargo fmt --check
65+
- name: rustfmt
66+
run: cargo fmt --check
6767

6868
Clippy:
6969
runs-on: ubuntu-24.04
7070

7171
steps:
72-
- uses: actions/checkout@v2
72+
- uses: actions/checkout@v2
7373

74-
- name: Install Clippy
75-
run: rustup component add clippy
74+
- name: Install Clippy
75+
run: rustup component add clippy
7676

77-
- name: Clippy (no features enabled)
78-
run: cargo clippy -- -D warnings
77+
- name: Clippy (no features enabled)
78+
run: cargo clippy -- -D warnings
7979

80-
- name: Clippy (all features enabled)
81-
run: cargo clippy --all-features -- -D warnings
80+
- name: Clippy (all features enabled)
81+
run: cargo clippy --all-features -- -D warnings
8282

8383
Test:
8484
runs-on: ubuntu-24.04
8585

8686
steps:
87-
- uses: actions/checkout@v2
88-
89-
- name: Test (no features enabled)
90-
run: |
91-
eval `ssh-agent`
92-
cargo test --verbose
93-
env:
94-
RUST_BACKTRACE: 1
95-
96-
- name: Test (all features enabled)
97-
run: |
98-
eval `ssh-agent`
99-
cargo test --verbose --all-features
100-
env:
101-
RUST_BACKTRACE: 1
87+
- uses: actions/checkout@v2
88+
89+
- name: Test (no features enabled)
90+
run: |
91+
eval `ssh-agent`
92+
cargo test --verbose
93+
env:
94+
RUST_BACKTRACE: 1
95+
96+
- name: Test (all features enabled)
97+
run: |
98+
eval `ssh-agent`
99+
cargo test --verbose --all-features
100+
env:
101+
RUST_BACKTRACE: 1
102102

103103
Minimal-versions:
104104
runs-on: ubuntu-24.04
105105

106106
steps:
107-
- uses: actions/checkout@v2
108-
- uses: dtolnay/rust-toolchain@nightly
109-
- uses: taiki-e/install-action@cargo-hack
110-
- uses: taiki-e/install-action@cargo-minimal-versions
111-
112-
- name: Check with minimal dependency versions
113-
run: |
114-
cargo minimal-versions check --all-features --no-dev-deps
107+
- uses: actions/checkout@v2
108+
- uses: dtolnay/rust-toolchain@nightly
109+
- uses: taiki-e/install-action@cargo-hack
110+
- uses: taiki-e/install-action@cargo-minimal-versions
111+
112+
- name: Check with minimal dependency versions
113+
run: |
114+
cargo minimal-versions check --all-features --no-dev-deps

.github/workflows/semver.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Semver check
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
env:
1010
CARGO_TERM_COLOR: always
@@ -14,12 +14,12 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v2
1818

19-
- name: Build (no features enabled)
20-
run: cargo build --verbose
19+
- name: Build (no features enabled)
20+
run: cargo build --verbose
2121

22-
- name: Check semver compatibility (russh)
23-
uses: obi1kenobi/cargo-semver-checks-action@v2
24-
with:
25-
package: russh
22+
- name: Check semver compatibility (russh)
23+
uses: obi1kenobi/cargo-semver-checks-action@v2
24+
with:
25+
package: russh

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Russh
22

33
[![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 -->
4-
[![All Contributors](https://img.shields.io/badge/all_contributors-90-orange.svg?style=flat-square)](#contributors-)
4+
[![All Contributors](https://img.shields.io/badge/all_contributors-91-orange.svg?style=flat-square)](#contributors-)
55
<!-- ALL-CONTRIBUTORS-BADGE:END -->
66

77
Low-level Tokio SSH2 client and server implementation.
@@ -130,6 +130,8 @@ This is a fork of [Thrussh](https://nest.pijul.com/pijul/thrussh) by Pierre-Éti
130130
* Uses `russh::server` for efficiently implementing SSH shells and SFTP file management.
131131
* [Oryxis](https://github.com/wilsonglasser/oryxis) - Rust-native SSH client with an encrypted vault, P2P sync and an embedded terminal.
132132
* Uses `russh::client` for connections, jump hosts, SOCKS/HTTP/command proxies and SFTP.
133+
* [react-native-ssh](https://github.com/osuki-dev/react-native-ssh) - Native SSH client for React Native and Expo.
134+
* Uses `russh::client` as the SSH transport implementation behind Nitro Modules bindings.
133135

134136
## Contributors ✨
135137

@@ -255,6 +257,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
255257
<td align="center" valign="top" width="14.28%"><a href="http://l9o.dev"><img src="https://avatars.githubusercontent.com/u/112069?v=4?s=100" width="100px;" alt="Luiz Ribeiro"/><br /><sub><b>Luiz Ribeiro</b></sub></a><br /><a href="https://github.com/Eugeny/russh/commits?author=luizribeiro" title="Code">💻</a></td>
256258
<td align="center" valign="top" width="14.28%"><a href="http://ctx.st"><img src="https://avatars.githubusercontent.com/u/259330610?v=4?s=100" width="100px;" alt="biao29"/><br /><sub><b>biao29</b></sub></a><br /><a href="https://github.com/Eugeny/russh/commits?author=biao29" title="Code">💻</a></td>
257259
<td align="center" valign="top" width="14.28%"><a href="https://github.com/gvz"><img src="https://avatars.githubusercontent.com/u/3962183?v=4?s=100" width="100px;" alt="Georg von Zengen"/><br /><sub><b>Georg von Zengen</b></sub></a><br /><a href="https://github.com/Eugeny/russh/commits?author=gvz" title="Code">💻</a></td>
260+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tluyben"><img src="https://avatars.githubusercontent.com/u/623448?v=4?s=100" width="100px;" alt="tluyben"/><br /><sub><b>tluyben</b></sub></a><br /><a href="https://github.com/Eugeny/russh/commits?author=tluyben" title="Code">💻</a></td>
258261
</tr>
259262
</tbody>
260263
</table>

cryptovec/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "Apache-2.0"
77
name = "russh-cryptovec"
88
repository = "https://github.com/warp-tech/russh"
99
version = "0.62.0"
10-
rust-version = "1.85"
10+
rust-version = "1.89"
1111

1212
[dependencies]
1313
ssh-encoding = { workspace = true, optional = true }

pageant/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ edition = "2024"
66
license = "Apache-2.0"
77
name = "pageant"
88
repository = "https://github.com/warp-tech/russh"
9-
version = "0.2.2"
10-
rust-version = "1.85"
9+
version = "0.2.3"
10+
rust-version = "1.89"
1111

1212
[dependencies]
1313
thiserror.workspace = true

pageant/src/wmmessage.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ impl MemoryMap {
157157
Ok(())
158158
}
159159

160-
fn read(&mut self, n: usize) -> Vec<u8> {
160+
fn read(&mut self, n: usize) -> Result<Vec<u8>, Error> {
161+
if self.pos.checked_add(n).is_none_or(|end| end > self.length) {
162+
return Err(Error::Overflow);
163+
}
161164
let out = vec![0; n];
162165
unsafe {
163166
std::ptr::copy_nonoverlapping(
@@ -167,7 +170,7 @@ impl MemoryMap {
167170
);
168171
}
169172
self.pos += n;
170-
out
173+
Ok(out)
171174
}
172175
}
173176

@@ -225,13 +228,13 @@ pub fn query_pageant_direct(cookie: String, msg: &[u8]) -> Result<Vec<u8>, Error
225228
}
226229

227230
map.seek(0);
228-
let mut buf = map.read(4);
231+
let mut buf = map.read(4)?;
229232
if buf.len() < 4 {
230233
return Err(Error::NoResponse);
231234
}
232235
#[allow(clippy::indexing_slicing)] // length checked
233236
let size = u32::from_be_bytes([buf[0], buf[1], buf[2], buf[3]]) as usize;
234-
buf.extend(map.read(size));
237+
buf.extend(map.read(size)?);
235238

236239
Ok(buf)
237240
}

russh-config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "Apache-2.0"
88
name = "russh-config"
99
repository = "https://github.com/warp-tech/russh"
1010
version = "0.58.0"
11-
rust-version = "1.85"
11+
rust-version = "1.89"
1212

1313
[dependencies]
1414
futures.workspace = true

russh-util/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "russh-util"
33
version = "0.52.0"
44
edition = "2024"
5-
rust-version = "1.85"
5+
rust-version = "1.89"
66
description = "Runtime abstraction utilities for russh."
77
documentation = "https://docs.rs/russh-util"
88
homepage = "https://github.com/warp-tech/russh"

russh/Cargo.toml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ license = "Apache-2.0"
99
name = "russh"
1010
readme = "../README.md"
1111
repository = "https://github.com/warp-tech/russh"
12-
version = "0.63.1"
13-
rust-version = "1.85"
12+
version = "0.63.2"
13+
rust-version = "1.89"
1414

1515
[features]
1616
default = ["flate2", "aws-lc-rs", "rsa"]
@@ -62,12 +62,7 @@ log.workspace = true
6262
md5 = "0.8"
6363
ml-kem = "0.3"
6464
module-lattice = "0.2"
65-
# num-bigint 0.4.x only supports rand 0.8. PR #338 adds rand 0.10 support
66-
# via the `rand_0_10` feature flag. Replace with upstream once a release with
67-
# rand 0.10 support is published. https://github.com/rust-num/num-bigint/pull/338
68-
num-bigint = { package = "internal-russh-num-bigint", version = "=0.5.0", features = ["rand_0_10"] }
69-
num_bigint_0_4 = { package = "num-bigint", version = "0.4.6" }
70-
# num-integer = "0.1"
65+
num-bigint = { version = "0.5", features = ["rand_0_10"] }
7166
p256 = { version = "0.14", features = ["ecdh"] }
7267
p384 = { version = "0.14", features = ["ecdh"] }
7368
p521 = { version = "0.14", features = ["ecdh"] }

0 commit comments

Comments
 (0)