Fix most clippy warnings
[?]
Apr 19, 2022, 7:04 AM
IKKKVXOKA6MDXPPGVSDPFRY4TI6Y4SSKWO7FKDF4SRJU3WUTZ3MQCDependencies
- [2]
SW5Z7UCNUpdates in thrussh-config: shell expansions, default config - [3]
NLPZS76WMake AgentSigner::sign_request_signature return self on error - [4]
G3FNNIIULimiting the amount of messages that can be buffered while rekeying to two channel windows - [5]
2SFWWZ2RRearm reading future on empty packet, and respond to server-initiated key re-exchange - [6]
2Q2DF2ROUpdating thrussh-config to make it usable in real projects - [7]
BRDS7STAAdding method `send_channel_msg` to client::Session, to make it easier to write handlers - [8]
7FRJYUI6Reboot because of a bad change - [9]
XEKZBXNIFixing a bug with tokio::select - [10]
OGPWDWHUCompilation error on Windows - [11]
ELRPPXSGFixing conflicts - [12]
AWVLXGAWRemoving anyhows on Windows - [13]
OQZGSEWMBuffering non-kex packets received after issuing a KEXINIT - [14]
2WEO7OZLVersion updates: getting rid of anyhow + moving to Tokio 1.0 - [15]
CROEJT6QMinor fixes in Thrussh-keys (parsing key files) - [16]
NHOSLQGGThrussh: making OpenSSL optional - [17]
KNLLUDOICorrect usage of `tokio::select!` - [18]
PBHNTGEXFixing a channel window error - [19]
MFMCIUMJFixing authentication with RSA - [20]
V3BRP7LQAvoid polling the reading future again after disconnection - [21]
7CE3RIMYUpdate dependencies. Update edition to 2021. Improve tests. - [22]
Y67GNDVBuse tokio::process::Command for proxy commands - [23]
JBFDZQ46Formatting - [24]
GMSJ7ETZMore fixes for Windows - [25]
EXXUR33QFixing queues when sending a vector - [26]
MCS77Y4VMaking OpenSSL optional - [27]
J4ZEHJHGFlush pending packets after a key re-exchange - [28]
SJBZKVM5Debug messages - [29]
YSLHJU3IAdd a Close construct to ChannelMsg in the server - [30]
SRFQGFS6Cleanup: openssl warning - [31]
AEIVL6S4Fixing key fingerprints for RSA keys - [32]
634OYCNMTokio 0.3
Change contents
- replacement in thrussh-keys/src/signature.rs at line 75
_ => Err((Error::UnknownSignatureType {_ => Err(Error::UnknownSignatureType { - replacement in thrussh-keys/src/signature.rs at line 77
}).into()),}), - replacement in thrussh-keys/src/lib.rs at line 25
//! const PKCS8_ENCRYPTED: &'static str = "-----BEGIN ENCRYPTED PRIVATE KEY-----\nMIIFLTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQITo1O0b8YrS0CAggA\nMAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBBtLH4T1KOfo1GGr7salhR8BIIE\n0KN9ednYwcTGSX3hg7fROhTw7JAJ1D4IdT1fsoGeNu2BFuIgF3cthGHe6S5zceI2\nMpkfwvHbsOlDFWMUIAb/VY8/iYxhNmd5J6NStMYRC9NC0fVzOmrJqE1wITqxtORx\nIkzqkgFUbaaiFFQPepsh5CvQfAgGEWV329SsTOKIgyTj97RxfZIKA+TR5J5g2dJY\nj346SvHhSxJ4Jc0asccgMb0HGh9UUDzDSql0OIdbnZW5KzYJPOx+aDqnpbz7UzY/\nP8N0w/pEiGmkdkNyvGsdttcjFpOWlLnLDhtLx8dDwi/sbEYHtpMzsYC9jPn3hnds\nTcotqjoSZ31O6rJD4z18FOQb4iZs3MohwEdDd9XKblTfYKM62aQJWH6cVQcg+1C7\njX9l2wmyK26Tkkl5Qg/qSfzrCveke5muZgZkFwL0GCcgPJ8RixSB4GOdSMa/hAMU\nkvFAtoV2GluIgmSe1pG5cNMhurxM1dPPf4WnD+9hkFFSsMkTAuxDZIdDk3FA8zof\nYhv0ZTfvT6V+vgH3Hv7Tqcxomy5Qr3tj5vvAqqDU6k7fC4FvkxDh2mG5ovWvc4Nb\nXv8sed0LGpYitIOMldu6650LoZAqJVv5N4cAA2Edqldf7S2Iz1QnA/usXkQd4tLa\nZ80+sDNv9eCVkfaJ6kOVLk/ghLdXWJYRLenfQZtVUXrPkaPpNXgD0dlaTN8KuvML\nUw/UGa+4ybnPsdVflI0YkJKbxouhp4iB4S5ACAwqHVmsH5GRnujf10qLoS7RjDAl\no/wSHxdT9BECp7TT8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MN0R4VtQgZ\nrAxWyQau9xXMGyDC67gQ5xSn+oqMK0HmoW8jh2LG/cUowHFAkUxdzGadnjGhMOI2\nzwNJPIjF93eDF/+zW5E1l0iGdiYyHkJbWSvcCuvTwma9FIDB45vOh5mSR+YjjSM5\nnq3THSWNi7Cxqz12Q1+i9pz92T2myYKBBtu1WDh+2KOn5DUkfEadY5SsIu/Rb7ub\n5FBihk2RN3y/iZk+36I69HgGg1OElYjps3D+A9AjVby10zxxLAz8U28YqJZm4wA/\nT0HLxBiVw+rsHmLP79KvsT2+b4Diqih+VTXouPWC/W+lELYKSlqnJCat77IxgM9e\nYIhzD47OgWl33GJ/R10+RDoDvY4koYE+V5NLglEhbwjloo9Ryv5ywBJNS7mfXMsK\n/uf+l2AscZTZ1mhtL38efTQCIRjyFHc3V31DI0UdETADi+/Omz+bXu0D5VvX+7c6\nb1iVZKpJw8KUjzeUV8yOZhvGu3LrQbhkTPVYL555iP1KN0Eya88ra+FUKMwLgjYr\nJkUx4iad4dTsGPodwEP/Y9oX/Qk3ZQr+REZ8lg6IBoKKqqrQeBJ9gkm1jfKE6Xkc\nCog3JMeTrb3LiPHgN6gU2P30MRp6L1j1J/MtlOAr5rux\n-----END ENCRYPTED PRIVATE KEY-----\n"; - replacement in thrussh-keys/src/lib.rs at line 164
const KEYTYPE_ED25519: &'static [u8] = b"ssh-ed25519";const KEYTYPE_RSA: &'static [u8] = b"ssh-rsa";const KEYTYPE_ED25519: &[u8] = b"ssh-ed25519";const KEYTYPE_RSA: &[u8] = b"ssh-rsa"; - replacement in thrussh-keys/src/lib.rs at line 184
_ => Err(Error::CouldNotReadKey.into()),_ => Err(Error::CouldNotReadKey), - replacement in thrussh-keys/src/lib.rs at line 197
Ok(key::parse_public_key(&base)?)key::parse_public_key(&base) - replacement in thrussh-keys/src/lib.rs at line 247
s.extend_from_slice(&public);s.extend_from_slice(public); - replacement in thrussh-keys/src/lib.rs at line 282
(c >= 'a' && c <= 'z')|| (c >= 'A' && c <= 'Z')|| (c >= '0' && c <= '9')('a'..='z').contains(&c)|| ('A'..='Z').contains(&c)|| ('0'..='9').contains(&c) - replacement in thrussh-keys/src/lib.rs at line 362
match (hosts, key) {(Some(h), Some(k)) => {debug!("{:?} {:?}", h, k);let host_matches = h.split(',').any(|x| x == host_port);if host_matches {if &parse_public_key_base64(k)? == pubkey {return Ok(true);} else {return Err((Error::KeyChanged { line }).into());}if let (Some(h), Some(k)) = (hosts, key) {debug!("{:?} {:?}", h, k);let host_matches = h.split(',').any(|x| x == host_port);if host_matches {if &parse_public_key_base64(k)? == pubkey {return Ok(true);} else {return Err(Error::KeyChanged { line }); - edit in thrussh-keys/src/lib.rs at line 372
_ => {} - replacement in thrussh-keys/src/lib.rs at line 412
Err(Error::NoHomeDir.into())Err(Error::NoHomeDir) - replacement in thrussh-keys/src/lib.rs at line 424
Err(Error::NoHomeDir.into())Err(Error::NoHomeDir) - replacement in thrussh-keys/src/lib.rs at line 437
const ED25519_KEY: &'static str = "-----BEGIN OPENSSH PRIVATE KEY-----const ED25519_KEY: &str = "-----BEGIN OPENSSH PRIVATE KEY----- - replacement in thrussh-keys/src/lib.rs at line 447
const RSA_KEY: &'static str = "-----BEGIN OPENSSH PRIVATE KEY-----const RSA_KEY: &str = "-----BEGIN OPENSSH PRIVATE KEY----- - replacement in thrussh-keys/src/lib.rs at line 586
pub const PKCS8_RSA: &'static str = "-----BEGIN RSA PRIVATE KEY-----pub const PKCS8_RSA: &str = "-----BEGIN RSA PRIVATE KEY----- - replacement in thrussh-keys/src/lib.rs at line 704
const PKCS8_ENCRYPTED: &'static str = "-----BEGIN ENCRYPTED PRIVATE KEY-----const PKCS8_ENCRYPTED: &str = "-----BEGIN ENCRYPTED PRIVATE KEY----- - replacement in thrussh-keys/src/key.rs at line 89
fn to_message_digest(&self) -> openssl::hash::MessageDigest {fn get_message_digest(&self) -> openssl::hash::MessageDigest { - replacement in thrussh-keys/src/key.rs at line 143
return Err(Error::CouldNotReadKey.into());return Err(Error::CouldNotReadKey); - replacement in thrussh-keys/src/key.rs at line 157
if key_algo != b"ssh-rsa" && key_algo != b"rsa-sha2-256" && key_algo != b"rsa-sha2-512" {return Err(Error::CouldNotReadKey.into());if key_algo != b"ssh-rsa"&& key_algo != b"rsa-sha2-256"&& key_algo != b"rsa-sha2-512"{return Err(Error::CouldNotReadKey); - replacement in thrussh-keys/src/key.rs at line 189
_ => Err(Error::CouldNotReadKey.into()),_ => Err(Error::CouldNotReadKey), - replacement in thrussh-keys/src/key.rs at line 204
match self {&PublicKey::Ed25519(ref public) => {sodium::ed25519::verify_detached(&sig, buffer, &public)match *self {PublicKey::Ed25519(ref public) => {sodium::ed25519::verify_detached(sig, buffer, public) - replacement in thrussh-keys/src/key.rs at line 209
&PublicKey::RSA { ref key, ref hash } => {PublicKey::RSA { ref key, ref hash } => { - replacement in thrussh-keys/src/key.rs at line 212
let mut verifier = Verifier::new(hash.to_message_digest(), &key.0)?;let mut verifier = Verifier::new(hash.get_message_digest(), &key.0)?; - replacement in thrussh-keys/src/key.rs at line 214
verifier.verify(&sig)verifier.verify(sig) - replacement in thrussh-keys/src/key.rs at line 225
use sha2::{Sha256, Digest};use sha2::{Digest, Sha256}; - edit in thrussh-keys/src/key.rs at line 231
- replacement in thrussh-keys/src/key.rs at line 245
pub fn set_algorithm(&mut self, _: &[u8]) {}pub fn set_algorithm(&mut self, _: &[u8]) {} - replacement in thrussh-keys/src/key.rs at line 290
match self {&KeyPair::Ed25519(ref key) => {match *self {KeyPair::Ed25519(ref key) => { - replacement in thrussh-keys/src/key.rs at line 297
&KeyPair::RSA { ref key, ref hash } => {KeyPair::RSA { ref key, ref hash } => { - replacement in thrussh-keys/src/key.rs at line 304
.unwrap();.unwrap(); - replacement in thrussh-keys/src/key.rs at line 307
hash: hash.clone(),hash: *hash, - replacement in thrussh-keys/src/key.rs at line 337
match self {&KeyPair::Ed25519(ref secret) => Ok(Signature::Ed25519(SignatureBytes(sodium::ed25519::sign_detached(to_sign.as_ref(), secret).0,match *self {KeyPair::Ed25519(ref secret) => Ok(Signature::Ed25519(SignatureBytes(sodium::ed25519::sign_detached(to_sign, secret).0, - replacement in thrussh-keys/src/key.rs at line 343
&KeyPair::RSA { ref key, ref hash } => Ok(Signature::RSA {bytes: rsa_signature(hash, key, to_sign.as_ref())?,KeyPair::RSA { ref key, ref hash } => Ok(Signature::RSA {bytes: rsa_signature(hash, key, to_sign)?, - replacement in thrussh-keys/src/key.rs at line 359
match self {&KeyPair::Ed25519(ref secret) => {match *self {KeyPair::Ed25519(ref secret) => { - replacement in thrussh-keys/src/key.rs at line 368
&KeyPair::RSA { ref key, ref hash } => {KeyPair::RSA { ref key, ref hash } => { - replacement in thrussh-keys/src/key.rs at line 385
match self {&KeyPair::Ed25519(ref secret) => {let signature = sodium::ed25519::sign_detached(&buffer, secret);match *self {KeyPair::Ed25519(ref secret) => {let signature = sodium::ed25519::sign_detached(buffer, secret); - replacement in thrussh-keys/src/key.rs at line 393
&KeyPair::RSA { ref key, ref hash } => {KeyPair::RSA { ref key, ref hash } => { - replacement in thrussh-keys/src/key.rs at line 425
let mut signer = Signer::new(hash.to_message_digest(), &pkey)?;let mut signer = Signer::new(hash.get_message_digest(), &pkey)?; - replacement in thrussh-keys/src/key.rs at line 461
Err(Error::CouldNotReadKey.into())Err(Error::CouldNotReadKey) - replacement in thrussh-keys/src/format/pkcs8.rs at line 16
const PBES2: &'static [u64] = &[1, 2, 840, 113549, 1, 5, 13];const PBKDF2: &'static [u64] = &[1, 2, 840, 113549, 1, 5, 12];const HMAC_SHA256: &'static [u64] = &[1, 2, 840, 113549, 2, 9];const AES256CBC: &'static [u64] = &[2, 16, 840, 1, 101, 3, 4, 1, 42];const ED25519: &'static [u64] = &[1, 3, 101, 112];const PBES2: &[u64] = &[1, 2, 840, 113549, 1, 5, 13];const PBKDF2: &[u64] = &[1, 2, 840, 113549, 1, 5, 12];const HMAC_SHA256: &[u64] = &[1, 2, 840, 113549, 2, 9];const AES256CBC: &[u64] = &[2, 16, 840, 1, 101, 3, 4, 1, 42];const ED25519: &[u64] = &[1, 3, 101, 112]; - replacement in thrussh-keys/src/format/pkcs8.rs at line 22
const RSA: &'static [u64] = &[1, 2, 840, 113549, 1, 1, 1];const RSA: &[u64] = &[1, 2, 840, 113549, 1, 1, 1]; - replacement in thrussh-keys/src/format/pkcs8.rs at line 27
Cow::Owned(yasna::parse_der(&ciphertext, |reader| {Cow::Owned(yasna::parse_der(ciphertext, |reader| { - replacement in thrussh-keys/src/format/pkcs8.rs at line 35
Ok(Err(Error::UnknownAlgorithm(oid)).into())Ok(Err(Error::UnknownAlgorithm(oid))) - replacement in thrussh-keys/src/format/pkcs8.rs at line 54
Ok(Err(Error::CouldNotReadKey.into()))Ok(Err(Error::CouldNotReadKey)) - replacement in thrussh-keys/src/format/pkcs8.rs at line 129
writer.write_bitvec(&BitVec::from_bytes(&public))writer.write_bitvec(&BitVec::from_bytes(public)) - replacement in thrussh-keys/src/format/pkcs8.rs at line 156
Err(Error::CouldNotReadKey.into())Err(Error::CouldNotReadKey) - replacement in thrussh-keys/src/format/pkcs8.rs at line 214
return Ok(Err(Error::CouldNotReadKey.into()));return Ok(Err(Error::CouldNotReadKey)); - replacement in thrussh-keys/src/format/pkcs8.rs at line 237
Err(Error::CouldNotReadKey.into())Err(Error::CouldNotReadKey) - replacement in thrussh-keys/src/format/pkcs8.rs at line 243
Err(Error::CouldNotReadKey.into())Err(Error::CouldNotReadKey) - replacement in thrussh-keys/src/format/pkcs5.rs at line 32
Err(Error::KeyIsEncrypted.into())Err(Error::KeyIsEncrypted) - replacement in thrussh-keys/src/format/openssh.rs at line 31
for _ in 0..nkeys {let key_type = position.read_string()?;if key_type == KEYTYPE_ED25519 {let pubkey = position.read_string()?;let seckey = position.read_string()?;let _comment = position.read_string()?;assert_eq!(pubkey, &seckey[32..]);use key::ed25519::*;let mut secret = SecretKey::new_zeroed();secret.key.clone_from_slice(seckey);return Ok(key::KeyPair::Ed25519(secret));} else if key_type == KEYTYPE_RSA && cfg!(feature = "openssl") {#[cfg(feature = "openssl")]{let n = BigNum::from_slice(position.read_string()?)?;let e = BigNum::from_slice(position.read_string()?)?;let d = BigNum::from_slice(position.read_string()?)?;let iqmp = BigNum::from_slice(position.read_string()?)?;let p = BigNum::from_slice(position.read_string()?)?;let q = BigNum::from_slice(position.read_string()?)?;let key_type = position.read_string()?;if key_type == KEYTYPE_ED25519 {let pubkey = position.read_string()?;let seckey = position.read_string()?;let _comment = position.read_string()?;assert_eq!(pubkey, &seckey[32..]);use key::ed25519::*;let mut secret = SecretKey::new_zeroed();secret.key.clone_from_slice(seckey);Ok(key::KeyPair::Ed25519(secret))} else if key_type == KEYTYPE_RSA && cfg!(feature = "openssl") {#[cfg(feature = "openssl")]{let n = BigNum::from_slice(position.read_string()?)?;let e = BigNum::from_slice(position.read_string()?)?;let d = BigNum::from_slice(position.read_string()?)?;let iqmp = BigNum::from_slice(position.read_string()?)?;let p = BigNum::from_slice(position.read_string()?)?;let q = BigNum::from_slice(position.read_string()?)?; - replacement in thrussh-keys/src/format/openssh.rs at line 51
let mut ctx = openssl::bn::BigNumContext::new()?;let un = openssl::bn::BigNum::from_u32(1)?;let mut p1 = openssl::bn::BigNum::new()?;let mut q1 = openssl::bn::BigNum::new()?;p1.checked_sub(&p, &un)?;q1.checked_sub(&q, &un)?;let mut dmp1 = openssl::bn::BigNum::new()?; // d mod p-1dmp1.checked_rem(&d, &p1, &mut ctx)?;let mut dmq1 = openssl::bn::BigNum::new()?; // d mod q-1dmq1.checked_rem(&d, &q1, &mut ctx)?;let mut ctx = openssl::bn::BigNumContext::new()?;let un = openssl::bn::BigNum::from_u32(1)?;let mut p1 = openssl::bn::BigNum::new()?;let mut q1 = openssl::bn::BigNum::new()?;p1.checked_sub(&p, &un)?;q1.checked_sub(&q, &un)?;let mut dmp1 = openssl::bn::BigNum::new()?; // d mod p-1dmp1.checked_rem(&d, &p1, &mut ctx)?;let mut dmq1 = openssl::bn::BigNum::new()?; // d mod q-1dmq1.checked_rem(&d, &q1, &mut ctx)?; - replacement in thrussh-keys/src/format/openssh.rs at line 62
let key = openssl::rsa::RsaPrivateKeyBuilder::new(n, e, d)?.set_factors(p, q)?.set_crt_params(dmp1, dmq1, iqmp)?.build();key.check_key().unwrap();return Ok(key::KeyPair::RSA {key,hash: key::SignatureHash::SHA2_512,});}} else {return Err(Error::UnsupportedKeyType(key_type.to_vec()).into());let key = openssl::rsa::RsaPrivateKeyBuilder::new(n, e, d)?.set_factors(p, q)?.set_crt_params(dmp1, dmq1, iqmp)?.build();key.check_key().unwrap();Ok(key::KeyPair::RSA {key,hash: key::SignatureHash::SHA2_512,}) - edit in thrussh-keys/src/format/openssh.rs at line 72
} else {Err(Error::UnsupportedKeyType(key_type.to_vec())) - edit in thrussh-keys/src/format/openssh.rs at line 75
Err(Error::CouldNotReadKey.into()) - replacement in thrussh-keys/src/format/openssh.rs at line 76
Err(Error::CouldNotReadKey.into())Err(Error::CouldNotReadKey) - replacement in thrussh-keys/src/format/openssh.rs at line 100
Err(Error::CouldNotReadKey.into())Err(Error::CouldNotReadKey) - replacement in thrussh-keys/src/format/openssh.rs at line 107
_ => return Err(Error::CouldNotReadKey.into()),_ => return Err(Error::CouldNotReadKey), - replacement in thrussh-keys/src/format/openssh.rs at line 117
return Err(Error::CouldNotReadKey.into());return Err(Error::CouldNotReadKey); - replacement in thrussh-keys/src/format/openssh.rs at line 147
Err(Error::KeyIsEncrypted.into())Err(Error::KeyIsEncrypted) - replacement in thrussh-keys/src/format/mod.rs at line 28
const AES_128_CBC: &'static str = "DEK-Info: AES-128-CBC,";const AES_128_CBC: &str = "DEK-Info: AES-128-CBC,"; - replacement in thrussh-keys/src/format/mod.rs at line 58
if started == true {if started { - replacement in thrussh-keys/src/format/mod.rs at line 70
return Err(Error::CouldNotReadKey.into());return Err(Error::CouldNotReadKey); - replacement in thrussh-keys/src/format/mod.rs at line 108
None => Err(Error::CouldNotReadKey.into()),None => Err(Error::CouldNotReadKey), - replacement in thrussh-keys/src/encoding.rs at line 156
fn reader<'a>(&'a self, starting_at: usize) -> Position<'a>;fn reader(&self, starting_at: usize) -> Position; - replacement in thrussh-keys/src/encoding.rs at line 160
fn reader<'a>(&'a self, starting_at: usize) -> Position<'a> {fn reader(&self, starting_at: usize) -> Position { - replacement in thrussh-keys/src/encoding.rs at line 162
s: &self,s: self, - replacement in thrussh-keys/src/encoding.rs at line 169
fn reader<'a>(&'a self, starting_at: usize) -> Position<'a> {fn reader(&self, starting_at: usize) -> Position { - replacement in thrussh-keys/src/encoding.rs at line 208
if self.position + 1 <= self.s.len() {if self.position < self.s.len() { - edit in thrussh-keys/src/agent/server.rs at line 9
use std; - edit in thrussh-keys/src/agent/server.rs at line 13
use tokio; - edit in thrussh-keys/src/agent/server.rs at line 19
type KeyStoreMap = HashMap<Vec<u8>, (Arc<key::KeyPair>, SystemTime, Vec<Constraint>)>; - replacement in thrussh-keys/src/agent/server.rs at line 23
struct KeyStore(Arc<RwLock<HashMap<Vec<u8>, (Arc<key::KeyPair>, SystemTime, Vec<Constraint>)>>>);struct KeyStore(Arc<RwLock<KeyStoreMap>>); - replacement in thrussh-keys/src/agent/server.rs at line 253
secret.key.clone_from_slice(&concat[..]);secret.key.clone_from_slice(concat); - replacement in thrussh-keys/src/agent/server.rs at line 287
BigNum::from_slice(&q_inv)?,BigNum::from_slice(q_inv)?, - replacement in thrussh-keys/src/agent/server.rs at line 292
writebuf.extend_ssh_mpint(&e);writebuf.extend_ssh_mpint(&n);writebuf.extend_ssh_mpint(e);writebuf.extend_ssh_mpint(n); - replacement in thrussh-keys/src/agent/client.rs at line 296
(self, Err(Error::AgentFailure.into()))(self, Err(Error::AgentFailure)) - replacement in thrussh-keys/src/agent/client.rs at line 308
key_blob(&public, &mut self.buf);key_blob(public, &mut self.buf); - replacement in thrussh-keys/src/agent/client.rs at line 346
self.prepare_sign_request(public, &data);self.prepare_sign_request(public, data); - replacement in thrussh-keys/src/agent/client.rs at line 398
_ => Err((Error::UnknownSignatureType {_ => Err(Error::UnknownSignatureType { - replacement in thrussh-keys/src/agent/client.rs at line 400
}).into()),}), - replacement in thrussh-keys/src/agent/client.rs at line 406
(self, Err(Error::AgentProtocolError.into()))(self, Err(Error::AgentProtocolError)) - edit in thrussh-config/src/proxy.rs at line 3
use std; - edit in thrussh-config/src/proxy.rs at line 6
use tokio; - replacement in thrussh-config/src/lib.rs at line 151[5.164332]→[5.164332:164480](∅→∅),[5.164480]→[2.1191:1254](∅→∅),[2.1254]→[5.1173:1259](∅→∅),[5.1173]→[5.1173:1259](∅→∅),[5.1259]→[5.164541:164635](∅→∅),[5.164541]→[5.164541:164635](∅→∅)
} else {match lower.as_str() {"host" => {if value.trim_start() == host {let mut c = Config::default(host);c.port = 22;config = Some(c)}}_ => {}}} else if lower.as_str() == "host" && value.trim_start() == host {let mut c = Config::default(host);c.port = 22;config = Some(c) - edit in thrussh/src/ssh_read.rs at line 4
use std; - replacement in thrussh/src/ssh_read.rs at line 25
buf: buf,buf, - replacement in thrussh/src/ssh_read.rs at line 124
return Err(Error::Disconnect.into());return Err(Error::Disconnect); - replacement in thrussh/src/ssh_read.rs at line 146
if i >= 8 {if &ssh_id.buf[0..8] == b"SSH-2.0-" {// Either the line starts with "SSH-2.0-"ssh_id.sshid_len = i;return Ok(&ssh_id.buf[..ssh_id.sshid_len]);}if i >= 8 && &ssh_id.buf[0..8] == b"SSH-2.0-" {// Either the line starts with "SSH-2.0-"ssh_id.sshid_len = i;return Ok(&ssh_id.buf[..ssh_id.sshid_len]); - replacement in thrussh/src/session.rs at line 148
if let Some(ref channel) = self.channels.get(&channel) {if let Some(channel) = self.channels.get(&channel) { - replacement in thrussh/src/session.rs at line 232
while buf.len() > 0 {while !buf.is_empty() { - replacement in thrussh/src/session.rs at line 281
while buf.len() > 0 {while !buf.is_empty() { - edit in thrussh/src/session.rs at line 396
#[allow(clippy::enum_variant_names)] - replacement in thrussh/src/session.rs at line 432
session_id: Some(session_id.clone()),session_id: Some(*session_id), - replacement in thrussh/src/session.rs at line 446
session_id: Some(session_id.clone()),session_id: Some(*session_id), - replacement in thrussh/src/session.rs at line 482
hash.clone()hash - replacement in thrussh/src/session.rs at line 494
session_id: session_id,session_id, - replacement in thrussh/src/server/session.rs at line 126
if let Some(channel) = enc.channels.get(&channel) {if let Some(channel) = enc.channels.get(channel) { - replacement in thrussh/src/server/session.rs at line 137
if let Some(channel) = enc.channels.get(&channel) {if let Some(channel) = enc.channels.get(channel) { - replacement in thrussh/src/server/session.rs at line 146
if let Some(channel) = enc.channels.get(&channel) {if let Some(channel) = enc.channels.get(channel) { - replacement in thrussh/src/server/session.rs at line 160[5.192816]→[5.192816:192873](∅→∅),[5.192873]→[5.0:49](∅→∅),[5.49]→[5.192873:193363](∅→∅),[5.192873]→[5.192873:193363](∅→∅)
) {if enc.rekey.is_none() {debug!("starting rekeying");if let Some(exchange) = enc.exchange.take() {let mut kexinit = KexInit::initiate_rekey(exchange, &enc.session_id);kexinit.server_write(&self.common.config.as_ref(),&mut self.common.cipher,&mut self.common.write_buffer,)?;enc.rekey = Some(Kex::KexInit(kexinit))}) && enc.rekey.is_none() {debug!("starting rekeying");if let Some(exchange) = enc.exchange.take() {let mut kexinit = KexInit::initiate_rekey(exchange, &enc.session_id);kexinit.server_write(self.common.config.as_ref(),&self.common.cipher,&mut self.common.write_buffer,)?;enc.rekey = Some(Kex::KexInit(kexinit)) - replacement in thrussh/src/server/mod.rs at line 290
#[allow(unused_variables)]#[allow(unused_variables, clippy::too_many_arguments)] - edit in thrussh/src/server/mod.rs at line 398
#[allow(clippy::wrong_self_convention)] - replacement in thrussh/src/server/mod.rs at line 526
match reply(session, &mut handler, &buf[..]).await {match reply(session, &mut handler, buf).await { - replacement in thrussh/src/server/mod.rs at line 616
exchange: exchange,exchange, - replacement in thrussh/src/server/mod.rs at line 631
config: config,config, - replacement in thrussh/src/server/mod.rs at line 651
&buf,buf, - replacement in thrussh/src/server/kex.rs at line 37
key: key,key, - replacement in thrussh/src/server/kex.rs at line 42
return Err(Error::UnknownKey.into());return Err(Error::UnknownKey); - replacement in thrussh/src/server/kex.rs at line 88
kex: kex,kex, - replacement in thrussh/src/server/encrypted.rs at line 60
&mut self.common.cipher,&self.common.cipher, - replacement in thrussh/src/server/encrypted.rs at line 89
let mut pending = std::mem::replace(&mut self.pending_reads, Vec::new());let mut pending = std::mem::take(&mut self.pending_reads); - replacement in thrussh/src/server/encrypted.rs at line 103
return Err(Error::Pending.into())return Err(Error::Pending.into()); - replacement in thrussh/src/server/encrypted.rs at line 111
},} - replacement in thrussh/src/server/encrypted.rs at line 190
if let Some(ref banner) = banner {if let Some(banner) = banner { - replacement in thrussh/src/server/encrypted.rs at line 199
methods: methods,methods, - replacement in thrussh/src/server/encrypted.rs at line 249
auth_request.methods = auth_request.methods - MethodSet::PASSWORD;auth_request.methods -= MethodSet::PASSWORD; - replacement in thrussh/src/server/encrypted.rs at line 346
} else if auth_user.len() == 0 {} else if auth_user.is_empty() { - replacement in thrussh/src/server/encrypted.rs at line 358
if SIGNATURE_BUFFER.with(|buf| {let signature_verified = SIGNATURE_BUFFER.with(|buf| { - replacement in thrussh/src/server/encrypted.rs at line 365
}) {});if signature_verified { - replacement in thrussh/src/server/encrypted.rs at line 393
self.write.extend_ssh_string(&pubkey_algo);self.write.extend_ssh_string(&pubkey_key);self.write.extend_ssh_string(pubkey_algo);self.write.extend_ssh_string(pubkey_key); - replacement in thrussh/src/server/encrypted.rs at line 399
algo: algo,algo, - replacement in thrussh/src/server/encrypted.rs at line 451
user: &mut String,user: &mut str, - replacement in thrussh/src/server/encrypted.rs at line 457
let response = Response { pos: r, n: n };let response = Response { pos: r, n }; - replacement in thrussh/src/server/encrypted.rs at line 465
.map_err(|e| H::Error::from(crate::Error::from(e))).map_err(H::Error::from) - replacement in thrussh/src/server/encrypted.rs at line 567
h.extended_data(channel_num, ext, &data, self).await?h.extended_data(channel_num, ext, data, self).await? - replacement in thrussh/src/server/encrypted.rs at line 569
h.data(channel_num, &data, self).await?h.data(channel_num, data, self).await? - replacement in thrussh/src/server/encrypted.rs at line 833
sender_channel: sender_channel,sender_channel, - edit in thrussh/src/negotiation.rs at line 21
use rand::RngCore; - edit in thrussh/src/negotiation.rs at line 24
use rand::RngCore; - edit in thrussh/src/negotiation.rs at line 97
#[cfg(not(feature = "openssl"))]use thrussh_keys::key::ED25519; - edit in thrussh/src/negotiation.rs at line 101
#[cfg(not(feature = "openssl"))]use thrussh_keys::key::{ED25519}; - replacement in thrussh/src/negotiation.rs at line 104
match self {&PublicKey::Ed25519(_) => ED25519.0,match *self {PublicKey::Ed25519(_) => ED25519.0, - replacement in thrussh/src/negotiation.rs at line 107
&PublicKey::RSA { .. } => SSH_RSA.0,PublicKey::RSA { .. } => SSH_RSA.0, - replacement in thrussh/src/negotiation.rs at line 114
match self {&KeyPair::Ed25519 { .. } => ED25519.0,match *self {KeyPair::Ed25519 { .. } => ED25519.0, - replacement in thrussh/src/negotiation.rs at line 117
&KeyPair::RSA { ref hash, .. } => hash.name().0,KeyPair::RSA { ref hash, .. } => hash.name().0, - replacement in thrussh/src/negotiation.rs at line 136
return Err(Error::NoCommonKexAlgo.into());return Err(Error::NoCommonKexAlgo); - replacement in thrussh/src/negotiation.rs at line 148
return Err(Error::NoCommonKeyAlgo.into());return Err(Error::NoCommonKeyAlgo); - replacement in thrussh/src/negotiation.rs at line 159
return Err(Error::NoCommonCipher.into());return Err(Error::NoCommonCipher); - replacement in thrussh/src/negotiation.rs at line 164
let mac = mac.and_then(|(_, x)| Some(x));let mac = mac.map(|(_, x)| x); - replacement in thrussh/src/negotiation.rs at line 173
return Err(Error::NoCommonCompression.into());return Err(Error::NoCommonCompression); - replacement in thrussh/src/negotiation.rs at line 181
return Err(Error::NoCommonCompression.into());return Err(Error::NoCommonCompression); - replacement in thrussh/src/negotiation.rs at line 201
_ => Err(Error::KexInit.into()),_ => Err(Error::KexInit), - replacement in thrussh/src/key.rs at line 26
match self {&PublicKey::Ed25519(ref public) => {match *self {PublicKey::Ed25519(ref public) => { - replacement in thrussh/src/key.rs at line 33
&PublicKey::RSA { ref key, .. } => {PublicKey::RSA { ref key, .. } => { - replacement in thrussh/src/key.rs at line 48
match self {&KeyPair::Ed25519(ref key) => {match *self {KeyPair::Ed25519(ref key) => { - replacement in thrussh/src/key.rs at line 56
&KeyPair::RSA { ref key, .. } => {KeyPair::RSA { ref key, .. } => { - replacement in thrussh/src/kex.rs at line 20
use sodium;use rand::RngCore; - edit in thrussh/src/kex.rs at line 23
use rand::RngCore; - replacement in thrussh/src/kex.rs at line 179
let hash = {let hash = { - replacement in thrussh/src/kex.rs at line 201
key.extend(&hash.as_ref());key.extend(hash.as_ref()); - replacement in thrussh/src/kex.rs at line 220
local_to_remote: local_to_remote,remote_to_local: remote_to_local,local_to_remote,remote_to_local, - replacement in thrussh/src/client/session.rs at line 29
_ => return Err(Error::NotAuthenticated.into()),_ => return Err(Error::NotAuthenticated), - replacement in thrussh/src/client/session.rs at line 32
return Err(Error::Inconsistent.into());return Err(Error::Inconsistent); - replacement in thrussh/src/client/session.rs at line 69
_ => return Err(Error::NotAuthenticated.into()),_ => return Err(Error::NotAuthenticated), - replacement in thrussh/src/client/session.rs at line 72
return Err(Error::Inconsistent.into());return Err(Error::Inconsistent); - replacement in thrussh/src/client/session.rs at line 113
_ => return Err(Error::NotAuthenticated.into()),_ => return Err(Error::NotAuthenticated), - replacement in thrussh/src/client/session.rs at line 116
return Err(Error::Inconsistent.into());return Err(Error::Inconsistent); - edit in thrussh/src/client/session.rs at line 121
#[allow(clippy::too_many_arguments)] - replacement in thrussh/src/client/mod.rs at line 273
if let Err(_) = selfif self - edit in thrussh/src/client/mod.rs at line 280
.is_err() - replacement in thrussh/src/client/mod.rs at line 294
Err(e) => return (future, Err(e.into())),Err(e) => return (future, Err(e)), - replacement in thrussh/src/client/mod.rs at line 296
if let Err(_) = self.sender.send(Msg::Signed { data }).await {if self.sender.send(Msg::Signed { data }).await.is_err() { - replacement in thrussh/src/client/mod.rs at line 328
return Err(Error::Disconnect.into());return Err(Error::Disconnect); - edit in thrussh/src/client/mod.rs at line 426
#[allow(clippy::too_many_arguments)] - replacement in thrussh/src/client/mod.rs at line 889
self = reply(self, &mut handler, &mut encrypted_signal, &buf[..]).await?;self = reply(self, &mut handler, &mut encrypted_signal, buf).await?; - replacement in thrussh/src/client/mod.rs at line 999
exchange: exchange,exchange, - replacement in thrussh/src/client/mod.rs at line 1007
&mut self.common.cipher,&self.common.cipher, - replacement in thrussh/src/client/mod.rs at line 1020
&mut self.common.cipher,&self.common.cipher, - replacement in thrussh/src/client/mod.rs at line 1028
&self.common.config.as_ref(),&mut self.common.cipher,self.common.config.as_ref(),&self.common.cipher, - replacement in thrussh/src/client/kex.rs at line 50
kex: kex,kex, - replacement in thrussh/src/client/encrypted.rs at line 62
&mut self.common.cipher,&self.common.cipher, - replacement in thrussh/src/client/encrypted.rs at line 103
let mut pending = std::mem::replace(&mut self.pending_reads, Vec::new());let mut pending = std::mem::take(&mut self.pending_reads); - replacement in thrussh/src/client/encrypted.rs at line 117
return Err(Error::Pending.into())return Err(Error::Pending.into()); - replacement in thrussh/src/client/encrypted.rs at line 251
match self.receiver.recv().await {Some(Msg::Signed { data }) => break data,_ => {}if let Some(Msg::Signed { data }) = self.receiver.recv().await {break data; - replacement in thrussh/src/client/encrypted.rs at line 371
let (c, s) = c.data(channel_num, &data, self).await?;let (c, s) = c.data(channel_num, data, self).await?; - replacement in thrussh/src/client/encrypted.rs at line 392
.extended_data(channel_num, extended_code, &data, self).extended_data(channel_num, extended_code, data, self) - replacement in thrussh/src/client/encrypted.rs at line 621
match method {&auth::Method::PublicKey { ref key } => {let i0 = self.client_make_to_sign(user, key.as_ref(), buffer);// Extend with self-signature.key.add_self_signature(buffer)?;push_packet!(self.write, {self.write.extend(&buffer[i0..]);})}_ => {}if let &auth::Method::PublicKey { ref key } = method {let i0 = self.client_make_to_sign(user, key.as_ref(), buffer);// Extend with self-signature.key.add_self_signature(buffer)?;push_packet!(self.write, {self.write.extend(&buffer[i0..]);}) - replacement in thrussh/src/cipher/chacha20poly1305.rs at line 93
if !poly1305_verify(&tag, ciphertext_in_plaintext_out, &poly_key) {if !poly1305_verify(tag, ciphertext_in_plaintext_out, &poly_key) { - replacement in cryptovec/src/lib.rs at line 238
self.p.offset(size as isize) as *mut c_void,self.p.add(size) as *mut c_void, - replacement in cryptovec/src/lib.rs at line 256
std::ptr::write_volatile(old_ptr.offset(i as isize), 0)std::ptr::write_volatile(old_ptr.add(i), 0) - replacement in cryptovec/src/lib.rs at line 289
unsafe { *(self.p.offset(size as isize)) = s }unsafe { *(self.p.add(size)) = s } - replacement in cryptovec/src/lib.rs at line 302
let x: [u8; 4] = unsafe { std::mem::transmute(s) };let x: [u8; 4] = s.to_ne_bytes(); - replacement in cryptovec/src/lib.rs at line 321
self.p.offset(i as isize) as *const c_void,self.p.add(i) as *const c_void, - replacement in cryptovec/src/lib.rs at line 338
unsafe { std::slice::from_raw_parts_mut(self.p.offset(cur_size as isize), n_bytes) };unsafe { std::slice::from_raw_parts_mut(self.p.add(cur_size), n_bytes) }; - replacement in cryptovec/src/lib.rs at line 369
let s = std::slice::from_raw_parts(self.p.offset(offset as isize), self.size - offset);let s = std::slice::from_raw_parts(self.p.add(offset), self.size - offset); - replacement in cryptovec/src/lib.rs at line 383
unsafe { std::slice::from_raw_parts_mut(self.p.offset(size as isize), n) }unsafe { std::slice::from_raw_parts_mut(self.p.add(size), n) } - replacement in cryptovec/src/lib.rs at line 396
std::ptr::copy_nonoverlapping(s.as_ptr(), self.p.offset(size as isize), s.len());std::ptr::copy_nonoverlapping(s.as_ptr(), self.p.add(size), s.len()); - replacement in cryptovec/src/lib.rs at line 420
std::ptr::write_volatile(self.p.offset(i as isize), 0)std::ptr::write_volatile(self.p.add(i), 0)