diff --git a/src/encrypt.rs b/src/encrypt.rs index 7651ba5e28facc0c146ff3e94f35eb633557e76b..d16f16969768002a598aadfa9ea47f571786377a 100644 --- a/src/encrypt.rs +++ b/src/encrypt.rs @@ -720,6 +720,7 @@ mod tests { integ_dec: id.clone(), discard_next: false, is_client: false, + send_ext_info: true, }) }) // and plaintext diff --git a/src/kex.rs b/src/kex.rs index c4a456546c885215bfa5a4c1fab619a5dd54e6b2..bc663e89e71aa129a824a7aca81da3a35a671e2f 100644 --- a/src/kex.rs +++ b/src/kex.rs @@ -32,7 +32,7 @@ use pretty_hex::PrettyHex; // TODO this will be configurable. const fixed_options_kex: &[&'static str] = - &[SSH_NAME_CURVE25519, SSH_NAME_CURVE25519_LIBSSH, SSH_NAME_KEXGUESS2]; + &[SSH_NAME_CURVE25519, SSH_NAME_CURVE25519_LIBSSH]; /// Options that can't be negotiated const marker_only_kexs: &[&'static str] = @@ -67,11 +67,14 @@ impl AlgoConfig { // Only clients are interested in ext-info // TODO perhaps it could go behind cfg(rsa)? if is_client { - // OK unwrap: static arrays are < MAX_LOCAL_NAMES + // OK unwrap: static arrays are < MAX_LOCAL_NAMES+slack kexs.0.push(SSH_NAME_EXT_INFO_C).unwrap(); } + // OK unwrap: static arrays are < MAX_LOCAL_NAMES+slack + kexs.0.push(SSH_NAME_KEXGUESS2).unwrap(); + AlgoConfig { kexs, hostsig: fixed_options_hostsig.try_into().unwrap(), @@ -217,7 +220,7 @@ pub(crate) struct Algos { pub is_client: bool, // whether the remote side supports ext-info - pub ext_info: bool, + pub send_ext_info: bool, } impl fmt::Display for Algos { @@ -400,7 +403,7 @@ impl Kex { // we only send MSG_EXT_INFO to a client, don't look // for SSH_NAME_EXT_INFO_S - let ext_info = match is_client { + let send_ext_info = match is_client { true => false, // OK unwrap: p.kex is a remote list false => p.kex.has_algo(SSH_NAME_EXT_INFO_C).unwrap(), @@ -473,7 +476,7 @@ impl Kex { integ_dec, discard_next, is_client, - ext_info, + send_ext_info, }) } } @@ -834,7 +837,7 @@ mod tests { // TODO: put keys in keys: vec![] }; - let mut sb = Behaviour::new_server(&mut sb); + let mut sb = Behaviour::<behaviour::UnusedCli, _>::new_server(&mut sb); let _sb = sb.server().unwrap(); let cli = kex::Kex::new();