This commit is contained in:
nora 2024-08-25 15:13:46 +02:00
parent b6d0675976
commit b0acf03502
22 changed files with 84 additions and 26 deletions

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021"
[dependencies]
eyre = "0.6.12"
eyre.workspace = true
cluelessh-transport = { path = "../cluelessh-transport" }
tokio = { version = "1.39.3", features = ["net"] }
tracing.workspace = true
[lints]
workspace = true

View file

@ -45,7 +45,7 @@ impl Request {
} => {
p.u8(numbers::SSH_AGENTC_ADD_IDENTITY);
p.string(key_type.as_bytes());
p.raw(&key_contents);
p.raw(key_contents);
p.string(key_comment.as_bytes());
}
Self::RemoveAllIdentities => p.u8(numbers::SSH_AGENTC_REMOVE_ALL_IDENTITIES),
@ -56,8 +56,8 @@ impl Request {
flags,
} => {
p.u8(numbers::SSH_AGENTC_SIGN_REQUEST);
p.string(&key_blob);
p.string(&data);
p.string(key_blob);
p.string(data);
p.u32(*flags);
}
Self::Lock { passphrase } => {
@ -186,7 +186,7 @@ impl AgentConnection {
mut bytes: &'a [u8],
) -> impl Iterator<Item = eyre::Result<ServerResponse>> + 'a {
std::iter::from_fn(move || -> Option<eyre::Result<ServerResponse>> {
if bytes.len() == 0 {
if bytes.is_empty() {
return None;
}
match self.packets.recv_plaintext_bytes(bytes) {