Skip to content

Commit 4b6acf9

Browse files
committed
bump ssh-key to rc
1 parent fc6e3ab commit 4b6acf9

5 files changed

Lines changed: 32 additions & 28 deletions

File tree

Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@ rand = { version = "0.10", features = ["thread_rng"] }
1717
sha1 = { version = "0.10.5", features = ["oid"] }
1818
sha2 = { version = "0.10.6", features = ["oid"] }
1919
signature = "3.0.0-rc.10"
20-
ssh-encoding = { version = "0.2", features = ["bytes"] }
21-
ssh-key = { version = "=0.6.18", features = [
20+
ssh-encoding = { version = "=0.3.0-rc.9", features = ["bytes"] }
21+
ssh-key = { version = "=0.7.0-rc.10", features = [
2222
"ed25519",
2323
"p256",
2424
"p384",
2525
"p521",
2626
"encryption",
2727
"ppk",
28-
"hazmat-allow-insecure-rsa-keys",
29-
], package = "internal-russh-forked-ssh-key" }
28+
] }
3029
thiserror = "2.0.18"
3130
tokio = { version = "1.17.0" }
32-
tokio-stream = { version = "0.1.3", features = ["net", "sync"] }
31+
tokio-stream = { version = "0.1.3", features = ["net", "sync"] }

cryptovec/src/ssh.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
1-
use ssh_encoding::{Reader, Result, Writer};
1+
use ssh_encoding::{Result, Writer};
22

33
use crate::CryptoVec;
44

5-
impl Reader for CryptoVec {
6-
fn read<'o>(&mut self, out: &'o mut [u8]) -> Result<&'o [u8]> {
7-
(&self[..]).read(out)
8-
}
9-
10-
fn remaining_len(&self) -> usize {
11-
self.len()
12-
}
13-
}
14-
155
impl Writer for CryptoVec {
166
fn write(&mut self, bytes: &[u8]) -> Result<()> {
177
self.extend(bytes);

russh/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ des = ["dep:des"]
2323
# Danger: DSA algorithm is insecure.
2424
dsa = ["ssh-key/dsa"]
2525
ring = ["dep:ring"] # Alternative crypto backend.
26-
rsa = ["dep:rsa", "dep:pkcs1", "ssh-key/rsa", "ssh-key/rsa-sha1"]
26+
rsa = ["dep:rsa", "dep:pkcs1", "ssh-key/rsa"]
2727
serde = ["ssh-key/serde"]
2828
_bench = ["dep:criterion"]
2929

russh/src/server/encrypted.rs

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ mod tests {
217217
}))
218218
.await;
219219

220-
assert_rejected(result, "server accepted an exec request with trailing bytes");
220+
assert_rejected(
221+
result,
222+
"server accepted an exec request with trailing bytes",
223+
);
221224
}
222225

223226
#[tokio::test]
@@ -230,7 +233,10 @@ mod tests {
230233
}))
231234
.await;
232235

233-
assert_rejected(result, "server accepted a signal request with trailing bytes");
236+
assert_rejected(
237+
result,
238+
"server accepted a signal request with trailing bytes",
239+
);
234240
}
235241

236242
#[tokio::test]
@@ -242,7 +248,10 @@ mod tests {
242248
}))
243249
.await;
244250

245-
assert_rejected(result, "server accepted a service request with trailing bytes");
251+
assert_rejected(
252+
result,
253+
"server accepted a service request with trailing bytes",
254+
);
246255
}
247256

248257
#[tokio::test]
@@ -256,7 +265,10 @@ mod tests {
256265
}))
257266
.await;
258267

259-
assert_rejected(result, "server accepted a none auth request with trailing bytes");
268+
assert_rejected(
269+
result,
270+
"server accepted a none auth request with trailing bytes",
271+
);
260272
}
261273

262274
#[tokio::test]
@@ -508,7 +520,12 @@ impl Encrypted {
508520
PublicKeyOrCertificate::Certificate(ref cert) => {
509521
// Validate certificate expiration
510522
let now = SystemTime::now();
511-
if now < cert.valid_after_time() || now > cert.valid_before_time() {
523+
if cert.valid_after_time().map(|t| now < t).unwrap_or_default()
524+
|| cert
525+
.valid_before_time()
526+
.map(|t| now > t)
527+
.unwrap_or_default()
528+
{
512529
warn!("Certificate is expired or not yet valid");
513530
reject_auth_request(until, &mut self.write, auth_request).await?;
514531
return Ok(());
@@ -840,11 +857,9 @@ impl Session {
840857
handler.extended_data(channel_num, ext, &data, self).await
841858
} else {
842859
if let Some(chan) = self.channels.get(&channel_num) {
843-
chan.send(ChannelMsg::Data {
844-
data: data.clone(),
845-
})
846-
.await
847-
.unwrap_or(())
860+
chan.send(ChannelMsg::Data { data: data.clone() })
861+
.await
862+
.unwrap_or(())
848863
}
849864
handler.data(channel_num, &data, self).await
850865
}

russh/src/server/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ impl Session {
12651265
use super::negotiation::Select;
12661266
key_extension_client = super::negotiation::Server::select(
12671267
&[EXTENSION_SUPPORT_AS_CLIENT],
1268-
&parse_kex_algo_list(&kex_string),
1268+
&parse_kex_algo_list(&kex_string)?,
12691269
AlgorithmKind::Kex,
12701270
)
12711271
.is_ok();

0 commit comments

Comments
 (0)