summaryrefslogtreecommitdiff
path: root/sshkey.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2020-06-24 15:07:33 +0000
committerDamien Miller <djm@mindrot.org>2020-06-26 15:18:07 +1000
commite3fa6249e6d9ceb57c14b04dd4c0cfab12fa7cd5 (patch)
treeef4eb4ad9c929a4fbe2d4ffeb21446faf72a42e0 /sshkey.c
parent37f2da069c0619f2947fb92785051d82882876d7 (diff)
upstream: only call sshkey_xmss_init() once for KEY_XMSS_CERT; ok
djm OpenBSD-Commit-ID: d0002ffb7f20f538b014d1d0735facd5a81ff096
Diffstat (limited to 'sshkey.c')
-rw-r--r--sshkey.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sshkey.c b/sshkey.c
index 5497497c..10b9e467 100644
--- a/sshkey.c
+++ b/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.
@@ -3600,10 +3600,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;