Skip to content

Commit bf235bc

Browse files
committed
fixed #470 - incorrect hash passed for an RSA key offer in agent authentication
1 parent 83aacd1 commit bf235bc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

russh/src/client/encrypted.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,13 +892,16 @@ impl Encrypted {
892892
cert.to_bytes()?.as_slice().encode(&mut self.write)?;
893893
true
894894
}
895-
auth::Method::FuturePublicKey { ref key, .. } => {
895+
auth::Method::FuturePublicKey { ref key, hash_alg } => {
896896
user.as_bytes().encode(&mut self.write)?;
897897
"ssh-connection".encode(&mut self.write)?;
898898
"publickey".encode(&mut self.write)?;
899899
self.write.push(0); // This is a probe
900900

901-
key.algorithm().as_str().encode(&mut self.write)?;
901+
key.algorithm()
902+
.with_hash_alg(hash_alg)
903+
.as_str()
904+
.encode(&mut self.write)?;
902905

903906
key.to_bytes()?.as_slice().encode(&mut self.write)?;
904907
true

0 commit comments

Comments
 (0)