Skip to content

Commit 3f414c5

Browse files
korbinmkj
authored andcommitted
fix server pubkey verification
1 parent 8be5415 commit 3f414c5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/servauth.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,12 @@ impl ServAuth {
130130
// Extract the signature separately. The message for the signature
131131
// includes the auth packet without the signature part.
132132
let (key, sig) = match &mut p.method {
133-
AuthMethod::PubKey(m) => (&m.pubkey.0, m.sig.take()),
133+
AuthMethod::PubKey(m) => {
134+
let sig = m.sig.take();
135+
// When we have a signature, we need to set force_sig=true so that the encoded message for verification has the boolean set correctly
136+
m.force_sig = sig.is_some();
137+
(&m.pubkey.0, sig)
138+
}
134139
_ => return Err(Error::bug()),
135140
};
136141

0 commit comments

Comments
 (0)