Skip to content

Commit 003513a

Browse files
committed
Fix decoding of SignResponse
Signed-off-by: Wiktor Kwapisiewicz <[email protected]>
1 parent 77c5e4b commit 003513a

6 files changed

+12
-2
lines changed

src/agent.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,14 @@ impl Encoder<Message> for MessageCodec {
6161
len.encode(&mut bytes)?;
6262

6363
item.encode(&mut bytes)?;
64-
6564
dst.put(&*bytes);
65+
//use std::io::Write;
66+
//let mut file = std::fs::File::create(uuid::Uuid::new_v4().to_string())?;
67+
//let mut bytes = Vec::new();
68+
//item.encode(&mut bytes)?;
69+
//file.write_all(&bytes)?;
70+
//drop(file);
71+
6672
Ok(())
6773
}
6874
}

src/proto/message.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ impl Decode for Message {
436436
11 => Ok(Self::RequestIdentities),
437437
12 => Identity::decode_vec(reader).map(Self::IdentitiesAnswer),
438438
13 => SignRequest::decode(reader).map(Self::SignRequest),
439-
14 => Signature::decode(reader).map(Self::SignResponse),
439+
14 => reader.read_prefixed(|reader| Signature::decode(reader).map(Self::SignResponse)),
440440
17 => AddIdentity::decode(reader).map(Self::AddIdentity),
441441
18 => RemoveIdentity::decode(reader).map(Self::RemoveIdentity),
442442
19 => Ok(Self::RemoveAllIdentities),
432 Bytes
Binary file not shown.

tests/messages/resp-sign-response.bin

409 Bytes
Binary file not shown.

tests/messages/resp-success.bin

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+


tests/sign-and-verify.sh

+3
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ echo | ssh-add -x
3232
echo | ssh-add -X
3333
# AddIdConstrained
3434
ssh-add -t 2 id_rsa
35+
36+
# clean up the only leftover
37+
rm -rf id_rsa

0 commit comments

Comments
 (0)