mirror of
https://github.com/Noratrieb/cluelessh.git
synced 2026-01-16 01:15:04 +01:00
refactor
This commit is contained in:
parent
49a3793770
commit
982de53668
3 changed files with 86 additions and 24 deletions
|
|
@ -333,6 +333,24 @@ impl SshPublicKey<'_> {
|
|||
data.finish()
|
||||
}
|
||||
}
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct SshPublicKeyEcdsa<'a> {
|
||||
pub(crate) format: &'a [u8],
|
||||
pub(crate) ident: &'a [u8],
|
||||
pub(crate) data: &'a [u8],
|
||||
}
|
||||
impl SshPublicKeyEcdsa<'_> {
|
||||
pub(crate) fn to_bytes(&self) -> Vec<u8> {
|
||||
let mut data = Writer::new();
|
||||
// ECDSA-specific!
|
||||
// <https://datatracker.ietf.org/doc/html/rfc5656#section-3.1>
|
||||
data.string(self.format);
|
||||
data.string(self.ident);
|
||||
data.string(self.data);
|
||||
data.finish()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct SshSignature<'a> {
|
||||
pub(crate) format: &'a [u8],
|
||||
|
|
@ -349,6 +367,20 @@ impl SshSignature<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) struct SshSignatureEcdsa<'a> {
|
||||
pub(crate) format: &'a [u8],
|
||||
pub(crate) data: &'a [u8],
|
||||
}
|
||||
|
||||
impl SshSignatureEcdsa<'_> {
|
||||
pub(crate) fn to_bytes(&self) -> Vec<u8> {
|
||||
let mut data = Writer::new();
|
||||
// <https://datatracker.ietf.org/doc/html/rfc5656#section-3.1.2>
|
||||
data.string(self.format);
|
||||
data.finish()
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) struct RawPacket {
|
||||
pub mac_len: usize,
|
||||
pub raw: Vec<u8>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue