diff options
author | djm@openbsd.org <djm@openbsd.org> | 2016-09-12 23:31:27 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2016-09-13 09:33:24 +1000 |
commit | 130f5df4fa37cace8c079dccb690e5cafbf00751 (patch) | |
tree | 6be59a00f7c45be11ffc8d40fa79a7c4a57e0a2f /kex.c | |
parent | 8f750ccfc07acb8aa98be5a5dd935033a6468cfd (diff) |
upstream commit
list all supported signature algorithms in the
server-sig-algs Reported by mb AT smartftp.com in bz#2547 and (independantly)
Ron Frederick; ok markus@
Upstream-ID: ddf702d721f54646b11ef2cee6d916666cb685cd
Diffstat (limited to 'kex.c')
-rw-r--r-- | kex.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: kex.c,v 1.120 2016/09/12 01:22:38 deraadt Exp $ */ | 1 | /* $OpenBSD: kex.c,v 1.121 2016/09/12 23:31:27 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -340,13 +340,20 @@ static int | |||
340 | kex_send_ext_info(struct ssh *ssh) | 340 | kex_send_ext_info(struct ssh *ssh) |
341 | { | 341 | { |
342 | int r; | 342 | int r; |
343 | char *algs; | ||
343 | 344 | ||
345 | if ((algs = sshkey_alg_list(0, 1, ',')) == NULL) | ||
346 | return SSH_ERR_ALLOC_FAIL; | ||
344 | if ((r = sshpkt_start(ssh, SSH2_MSG_EXT_INFO)) != 0 || | 347 | if ((r = sshpkt_start(ssh, SSH2_MSG_EXT_INFO)) != 0 || |
345 | (r = sshpkt_put_u32(ssh, 1)) != 0 || | 348 | (r = sshpkt_put_u32(ssh, 1)) != 0 || |
346 | (r = sshpkt_put_cstring(ssh, "server-sig-algs")) != 0 || | 349 | (r = sshpkt_put_cstring(ssh, "server-sig-algs")) != 0 || |
347 | (r = sshpkt_put_cstring(ssh, "rsa-sha2-256,rsa-sha2-512")) != 0 || | 350 | (r = sshpkt_put_cstring(ssh, algs)) != 0 || |
348 | (r = sshpkt_send(ssh)) != 0) | 351 | (r = sshpkt_send(ssh)) != 0) |
349 | return r; | 352 | goto out; |
353 | /* success */ | ||
354 | r = 0; | ||
355 | out: | ||
356 | free(algs); | ||
350 | return 0; | 357 | return 0; |
351 | } | 358 | } |
352 | 359 | ||