[openssh-commits] [openssh] 11/17: upstream: EXT_INFO negotiation of hostbound pubkey auth

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Dec 20 09:28:36 AEDT 2021


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

djm pushed a commit to branch master
in repository openssh.

commit 3e16365a79cdeb2d758cf1da6051b1c5266ceed7
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Sun Dec 19 22:13:12 2021 +0000

    upstream: EXT_INFO negotiation of hostbound pubkey auth
    
    the EXT_INFO packet gets a new publickey-hostbound at openssh.com to
    advertise the hostbound public key method.
    
    Client side support to parse this feature flag and set the kex->flags
    indicator if the expected version is offered (currently "0").
    
    ok markus@
    
    OpenBSD-Commit-ID: 4cdb2ca5017ec1ed7a9d33bda95c1d6a97b583b0
---
 kex.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/kex.c b/kex.c
index 55babbce..29733cc0 100644
--- a/kex.c
+++ b/kex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.169 2021/12/19 22:08:06 djm Exp $ */
+/* $OpenBSD: kex.c,v 1.170 2021/12/19 22:13:12 djm Exp $ */
 /*
  * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
  *
@@ -436,9 +436,12 @@ kex_send_ext_info(struct ssh *ssh)
 		return SSH_ERR_ALLOC_FAIL;
 	/* XXX filter algs list by allowed pubkey/hostbased types */
 	if ((r = sshpkt_start(ssh, SSH2_MSG_EXT_INFO)) != 0 ||
-	    (r = sshpkt_put_u32(ssh, 1)) != 0 ||
+	    (r = sshpkt_put_u32(ssh, 2)) != 0 ||
 	    (r = sshpkt_put_cstring(ssh, "server-sig-algs")) != 0 ||
 	    (r = sshpkt_put_cstring(ssh, algs)) != 0 ||
+	    (r = sshpkt_put_cstring(ssh,
+	    "publickey-hostbound at openssh.com")) != 0 ||
+	    (r = sshpkt_put_cstring(ssh, "0")) != 0 ||
 	    (r = sshpkt_send(ssh)) != 0) {
 		error_fr(r, "compose");
 		goto out;
@@ -498,6 +501,21 @@ kex_input_ext_info(int type, u_int32_t seq, struct ssh *ssh)
 			debug_f("%s=<%s>", name, val);
 			kex->server_sig_algs = val;
 			val = NULL;
+		} else if (strcmp(name,
+		    "publickey-hostbound at openssh.com") == 0) {
+			/* XXX refactor */
+			/* Ensure no \0 lurking in value */
+			if (memchr(val, '\0', vlen) != NULL) {
+				error_f("nul byte in %s", name);
+				return SSH_ERR_INVALID_FORMAT;
+			}
+			debug_f("%s=<%s>", name, val);
+			if (strcmp(val, "0") == 0)
+				kex->flags |= KEX_HAS_PUBKEY_HOSTBOUND;
+			else {
+				debug_f("unsupported version of %s extension",
+				    name);
+			}
 		} else
 			debug_f("%s (unrecognised)", name);
 		free(name);

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


More information about the openssh-commits mailing list