From 28c53128367044cbc801b581d4b2c885bfd60da8 Mon Sep 17 00:00:00 2001 From: korbin Date: Tue, 26 Aug 2025 01:11:23 -0600 Subject: [PATCH] fix server pubkey verification --- src/servauth.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/servauth.rs b/src/servauth.rs index d4e4cd34..c415c2ac 100644 --- a/src/servauth.rs +++ b/src/servauth.rs @@ -130,7 +130,12 @@ impl ServAuth { // Extract the signature separately. The message for the signature // includes the auth packet without the signature part. let (key, sig) = match &mut p.method { - AuthMethod::PubKey(m) => (&m.pubkey.0, m.sig.take()), + AuthMethod::PubKey(m) => { + let sig = m.sig.take(); + // When we have a signature, we need to set force_sig=true so that the encoded message for verification has the boolean set correctly + m.force_sig = sig.is_some(); + (&m.pubkey.0, sig) + } _ => return Err(Error::bug()), };