Skip to content

Commit 5d82dcb

Browse files
rukaiEugeny
authored andcommitted
Update dependencies
1 parent ba0207b commit 5d82dcb

File tree

5 files changed

+14
-35
lines changed

5 files changed

+14
-35
lines changed

russh-keys/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ version = "0.37.1"
3030
[dependencies]
3131
aes = "0.8"
3232
async-trait = "0.1.72"
33-
bcrypt-pbkdf = "0.9"
33+
bcrypt-pbkdf = "0.10"
3434
bit-vec = "0.6"
3535
cbc = "0.1"
3636
ctr = "0.9"
3737
block-padding = { version = "0.3", features = ["std"] }
3838
byteorder = "1.4"
3939
data-encoding = "2.3"
40-
dirs = "4.0"
40+
dirs = "5.0"
4141
ed25519-dalek = "1.0"
4242
futures = "0.3"
4343
hmac = "0.12"
@@ -67,5 +67,5 @@ yasna = { version = "0.5.0", features = ["bit-vec", "num-bigint"] }
6767
vendored-openssl = ["openssl", "openssl/vendored"]
6868

6969
[dev-dependencies]
70-
env_logger = "0.9"
70+
env_logger = "0.10"
7171
tempdir = "0.3"

russh/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ vendored-openssl = ["openssl/vendored", "russh-keys/vendored-openssl"]
2121
aes = "0.8"
2222
aes-gcm = "0.10"
2323
async-trait = "0.1"
24-
bitflags = "1.2"
24+
bitflags = "2.0"
2525
byteorder = "1.3"
2626
chacha20 = "0.9"
27-
curve25519-dalek = "3.2"
27+
curve25519-dalek = "4.0"
2828
poly1305 = "0.8"
2929
ctr = "0.9"
3030
digest = "0.10"
@@ -40,7 +40,7 @@ russh-cryptovec = { version = "0.7.0", path = "../cryptovec" }
4040
russh-keys = { version = "0.37.1", path = "../russh-keys" }
4141
sha1 = "0.10"
4242
sha2 = "0.10"
43-
hex-literal = "0.3"
43+
hex-literal = "0.4"
4444
num-bigint = { version = "0.4", features = ["rand"] }
4545
subtle = "2.4"
4646
thiserror = "1.0"
@@ -57,7 +57,7 @@ tokio-util = "0.7"
5757

5858
[dev-dependencies]
5959
anyhow = "1.0"
60-
env_logger = "0.9"
60+
env_logger = "0.10"
6161
tokio = { version = "1.17.0", features = [
6262
"io-util",
6363
"rt-multi-thread",

russh/src/auth.rs

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@
1515

1616
use std::sync::Arc;
1717

18+
use bitflags::bitflags;
1819
use russh_cryptovec::CryptoVec;
1920
use russh_keys::{encoding, key};
20-
use tokio::io::{AsyncRead, AsyncWrite};
21-
use bitflags::bitflags;
2221
use thiserror::Error;
22+
use tokio::io::{AsyncRead, AsyncWrite};
2323

2424
bitflags! {
2525
/// Set of authentication methods, represented by bit flags.
26+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
2627
pub struct MethodSet: u32 {
2728
/// The SSH `none` method (no authentication).
2829
const NONE = 1;
@@ -41,27 +42,6 @@ bitflags! {
4142
}
4243
}
4344

44-
macro_rules! iter {
45-
( $y:expr, $x:expr ) => {{
46-
if $y.contains($x) {
47-
$y.remove($x);
48-
return Some($x);
49-
}
50-
}};
51-
}
52-
53-
impl Iterator for MethodSet {
54-
type Item = MethodSet;
55-
fn next(&mut self) -> Option<MethodSet> {
56-
iter!(self, MethodSet::NONE);
57-
iter!(self, MethodSet::PASSWORD);
58-
iter!(self, MethodSet::PUBLICKEY);
59-
iter!(self, MethodSet::HOSTBASED);
60-
iter!(self, MethodSet::KEYBOARD_INTERACTIVE);
61-
None
62-
}
63-
}
64-
6545
pub trait Signer: Sized {
6646
type Error: From<crate::SendError>;
6747
type Future: futures::Future<Output = (Self, Result<CryptoVec, Self::Error>)> + Send;
@@ -151,4 +131,3 @@ pub enum CurrentRequest {
151131
submethods: String,
152132
},
153133
}
154-

russh/src/kex/curve25519.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use byteorder::{BigEndian, ByteOrder};
2-
use log::debug;
32
use curve25519_dalek::constants::ED25519_BASEPOINT_TABLE;
43
use curve25519_dalek::montgomery::MontgomeryPoint;
54
use curve25519_dalek::scalar::Scalar;
5+
use log::debug;
66
use russh_cryptovec::CryptoVec;
77
use russh_keys::encoding::Encoding;
88

@@ -72,7 +72,7 @@ impl KexAlgorithm for Curve25519Kex {
7272
};
7373

7474
let server_secret = Scalar::from_bytes_mod_order(rand::random::<[u8; 32]>());
75-
let server_pubkey = (&ED25519_BASEPOINT_TABLE * &server_secret).to_montgomery();
75+
let server_pubkey = (ED25519_BASEPOINT_TABLE * &server_secret).to_montgomery();
7676

7777
// fill exchange.
7878
exchange.server_ephemeral.clear();
@@ -89,7 +89,7 @@ impl KexAlgorithm for Curve25519Kex {
8989
buf: &mut CryptoVec,
9090
) -> Result<(), crate::Error> {
9191
let client_secret = Scalar::from_bytes_mod_order(rand::random::<[u8; 32]>());
92-
let client_pubkey = (&ED25519_BASEPOINT_TABLE * &client_secret).to_montgomery();
92+
let client_pubkey = (ED25519_BASEPOINT_TABLE * &client_secret).to_montgomery();
9393

9494
// fill exchange.
9595
client_ephemeral.clear();

russh/src/server/encrypted.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ async fn reject_auth_request(
496496
debug!("rejecting {:?}", auth_request);
497497
push_packet!(write, {
498498
write.push(msg::USERAUTH_FAILURE);
499-
write.extend_list(auth_request.methods);
499+
write.extend_list(auth_request.methods.into_iter());
500500
write.push(auth_request.partial_success as u8);
501501
});
502502
auth_request.current = None;

0 commit comments

Comments
 (0)