mirror of
https://github.com/Noratrieb/cluelessh.git
synced 2026-01-14 16:35:06 +01:00
cleanup
This commit is contained in:
parent
b6d0675976
commit
b0acf03502
22 changed files with 84 additions and 26 deletions
|
|
@ -22,3 +22,6 @@ base64 = "0.22.1"
|
|||
|
||||
[dev-dependencies]
|
||||
hex-literal = "0.4.1"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ pub fn hostkey_ed25519(hostkey_private: Vec<u8>) -> HostKeySigningAlgorithm {
|
|||
// <https://datatracker.ietf.org/doc/html/rfc8709#section-6>
|
||||
let mut data = Writer::new();
|
||||
data.string(b"ssh-ed25519");
|
||||
data.string(&signature.to_bytes());
|
||||
data.string(signature.to_bytes());
|
||||
EncodedSshSignature(data.finish())
|
||||
},
|
||||
verify: |public_key, message, signature| {
|
||||
|
|
@ -216,7 +216,7 @@ pub fn hostkey_ecdsa_sha2_p256(hostkey_private: Vec<u8>) -> HostKeySigningAlgori
|
|||
let mut signature_blob = Writer::new();
|
||||
signature_blob.mpint(p256::U256::from(r.as_ref()));
|
||||
signature_blob.mpint(p256::U256::from(s.as_ref()));
|
||||
data.string(&signature_blob.finish());
|
||||
data.string(signature_blob.finish());
|
||||
EncodedSshSignature(data.finish())
|
||||
},
|
||||
verify: |_public_key, _message, _signature| todo!("ecdsa p256 verification"),
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
|
||||
pub fn remaining(&self) -> &[u8] {
|
||||
&self.0
|
||||
self.0
|
||||
}
|
||||
|
||||
pub fn has_data(&self) -> bool {
|
||||
|
|
|
|||
|
|
@ -99,6 +99,26 @@ impl ServerConnection {
|
|||
|
||||
return Err(SshStatus::Disconnect);
|
||||
}
|
||||
Some(numbers::SSH_MSG_IGNORE) => {
|
||||
// <https://datatracker.ietf.org/doc/html/rfc4253#section-11.2>
|
||||
let mut p = Parser::new(&packet.payload[1..]);
|
||||
let _ = p.string()?;
|
||||
continue;
|
||||
}
|
||||
Some(numbers::SSH_MSG_DEBUG) => {
|
||||
// <https://datatracker.ietf.org/doc/html/rfc4253#section-11.3>
|
||||
let mut p = Parser::new(&packet.payload[1..]);
|
||||
let always_display = p.bool()?;
|
||||
let msg = p.utf8_string()?;
|
||||
let _language_tag = p.utf8_string()?;
|
||||
|
||||
if always_display {
|
||||
info!(%msg, "Received debug message (SSH_MSG_DEBUG)");
|
||||
} else {
|
||||
debug!(%msg, "Received debug message (SSH_MSG_DEBUG)")
|
||||
}
|
||||
continue;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue