[openssh-commits] [openssh] 01/02: upstream: Explicitly specify the signature algorithm when signing

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Nov 27 09:03:39 AEDT 2024


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 84023656d91b78f1ef86c8321ec563f2e90f7227
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Tue Nov 26 22:01:37 2024 +0000

    upstream: Explicitly specify the signature algorithm when signing
    
    hostkeys-prove requests.
    
    Fixes a corner-case triggered by UpdateHostKeys with one or more unknown
    host keys stored in ssh-agent where sshd refuses to accept the signature
    coming back from the agent.
    
    Report/fix from Maxime Rey
    
    OpenBSD-Commit-ID: 460c7d527a24f92b7e5f68ca1a2fa242ebf0d086
---
 serverloop.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/serverloop.c b/serverloop.c
index 757cc6f0..40ddfb04 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: serverloop.c,v 1.240 2024/06/17 08:28:31 djm Exp $ */
+/* $OpenBSD: serverloop.c,v 1.241 2024/11/26 22:01:37 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -690,7 +690,7 @@ server_input_hostkeys_prove(struct ssh *ssh, struct sshbuf **respp)
 		 * For RSA keys, prefer to use the signature type negotiated
 		 * during KEX to the default (SHA1).
 		 */
-		sigalg = NULL;
+		sigalg = sshkey_ssh_name(key);
 		if (sshkey_type_plain(key->type) == KEY_RSA) {
 			if (kex_rsa_sigalg != NULL)
 				sigalg = kex_rsa_sigalg;
@@ -699,6 +699,7 @@ server_input_hostkeys_prove(struct ssh *ssh, struct sshbuf **respp)
 			else if (ssh->kex->flags & KEX_RSA_SHA2_256_SUPPORTED)
 				sigalg = "rsa-sha2-256";
 		}
+
 		debug3_f("sign %s key (index %d) using sigalg %s",
 		    sshkey_type(key), ndx, sigalg == NULL ? "default" : sigalg);
 		if ((r = sshbuf_put_cstring(sigbuf,

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list