Skip to content

Commit 3f7271b

Browse files
committed
fixed #358 - relax strict kex checks to match OpenSSH
1 parent 459544a commit 3f7271b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

russh/src/client/encrypted.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::negotiation::{Named, Select};
2626
use crate::parsing::{ChannelOpenConfirmation, ChannelType, OpenChannelMessage};
2727
use crate::session::{Encrypted, EncryptedState, GlobalRequestResponse, Kex, KexInit};
2828
use crate::{
29-
auth, msg, negotiation, strict_kex_violation, Channel, ChannelId, ChannelMsg,
29+
auth, msg, negotiation, Channel, ChannelId, ChannelMsg,
3030
ChannelOpenFailure, ChannelParams, CryptoVec, Sig,
3131
};
3232

@@ -70,11 +70,9 @@ impl Session {
7070
None
7171
};
7272

73-
if let Some(kexinit) = kexinit {
74-
if let Some(ref algo) = kexinit.algo {
75-
if self.common.strict_kex && !algo.strict_kex {
76-
return Err(strict_kex_violation(msg::KEXINIT, 0).into());
77-
}
73+
if let Some(mut kexinit) = kexinit {
74+
if let Some(ref mut algo) = kexinit.algo {
75+
algo.strict_kex = algo.strict_kex || self.common.strict_kex;
7876
}
7977

8078
let dhdone = kexinit.client_parse(

0 commit comments

Comments
 (0)