pijul nest
guest [sign in]

Fixing authentication with RSA

[?]
Nov 22, 2020, 3:30 PM
MFMCIUMJUYCV2GW5P25D5753YBYXWIMLWKKWX4PABEM7ACUIBGWAC

Dependencies

  • [2] 7FRJYUI6 Reboot because of a bad change

Change contents

  • edit in thrussh-keys/src/key.rs at line 207
    [2.64234]
    [2.64234]
    pub fn set_algorithm(&mut self, algorithm: &[u8]) {
    if let PublicKey::RSA { ref mut hash, .. } = self {
    if algorithm == b"rsa-sha2-512" {
    *hash = SignatureHash::SHA2_512
    } else if algorithm == b"rsa-sha2-256" {
    *hash = SignatureHash::SHA2_256
    } else if algorithm == b"ssh-rsa" {
    *hash = SignatureHash::SHA1
    }
    }
    }
  • replacement in thrussh-keys/Cargo.toml at line 2
    [2.157057][2.157057:157076]()
    version = "0.18.3"
    [2.157057]
    [2.157076]
    version = "0.18.8"
  • replacement in thrussh/src/server/encrypted.rs at line 285
    [2.240869][2.240869:240897]()
    Ok(pubkey) => {
    [2.240869]
    [2.240897]
    Ok(mut pubkey) => {
  • edit in thrussh/src/server/encrypted.rs at line 302
    [2.241524]
    [2.241524]
    pubkey.set_algorithm(algo_);
  • edit in thrussh/src/client/mod.rs at line 1099
    [2.371165][2.371165:371233]()
    let is_first_time = session.common.encrypted.is_none();
  • replacement in thrussh/src/client/mod.rs at line 1102
    [2.371364][2.371364:371405]()
    sent: is_first_time,
    [2.371364]
    [2.371405]
    sent: false,
  • edit in thrussh/src/client/mod.rs at line 1106
    [2.371464][2.371464:371773]()
    if is_first_time {
    debug!("sending ssh-userauth service requset");
    let p = b"\x05\0\0\0\x0Cssh-userauth";
    session
    .common
    .cipher
    .write(p, &mut session.common.write_buffer);
    }