This commit is contained in:
nora 2024-08-23 14:14:45 +02:00
parent 53bd98f2b3
commit 157d6081b8
3 changed files with 39 additions and 8 deletions

View file

@ -113,6 +113,7 @@ pub enum ExtensionResponse {
/// A single identity in SSH_AGENT_IDENTITIES_ANSWER.
#[derive(Debug)]
pub struct IdentityAnswer {
/// The public key in the SSH wire encoding.
pub key_blob: Vec<u8>,
pub comment: String,
}

View file

@ -107,7 +107,7 @@ impl<'a> Parser<'a> {
}
}
/// A simplified `byteorder` clone that emits client errors when the data is too short.
/// A writer for the SSH wire format.
pub struct Writer(Vec<u8>);
impl Writer {
@ -149,7 +149,8 @@ impl Writer {
self.raw(bytes);
}
pub fn string(&mut self, data: &[u8]) {
pub fn string(&mut self, data: impl AsRef<[u8]>) {
let data = data.as_ref();
self.u32(data.len() as u32);
self.raw(data);
}