diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2020-06-24 15:07:34 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2020-06-24 15:07:34 +0000 |
commit | 7510911020fa28c04ca5233d0af3bebc1e6ac974 (patch) | |
tree | 5cc182ece1b31056b731bc45fc63ea999fba1b37 | |
parent | cde0517f8841f71832f594d8b665716169a77527 (diff) |
only call sshkey_xmss_init() once for KEY_XMSS_CERT; ok djm
-rw-r--r-- | usr.bin/ssh/sshkey.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ssh/sshkey.c b/usr.bin/ssh/sshkey.c index 60736cd8c55..3b8e81c16f4 100644 --- a/usr.bin/ssh/sshkey.c +++ b/usr.bin/ssh/sshkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshkey.c,v 1.109 2020/06/22 05:58:35 djm Exp $ */ +/* $OpenBSD: sshkey.c,v 1.110 2020/06/24 15:07:33 markus Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. * Copyright (c) 2008 Alexander von Gernler. All rights reserved. @@ -3545,10 +3545,12 @@ sshkey_private_deserialize(struct sshbuf *buf, struct sshkey **kp) case KEY_XMSS: case KEY_XMSS_CERT: if ((r = sshbuf_get_cstring(buf, &xmss_name, NULL)) != 0 || - (r = sshkey_xmss_init(k, xmss_name)) != 0 || (r = sshbuf_get_string(buf, &xmss_pk, &pklen)) != 0 || (r = sshbuf_get_string(buf, &xmss_sk, &sklen)) != 0) goto out; + if (type == KEY_XMSS && + (r = sshkey_xmss_init(k, xmss_name)) != 0) + goto out; if (pklen != sshkey_xmss_pklen(k) || sklen != sshkey_xmss_sklen(k)) { r = SSH_ERR_INVALID_FORMAT; |