summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sshkey.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sshkey.c b/sshkey.c
index 190426e28..8db947436 100644
--- a/sshkey.c
+++ b/sshkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshkey.c,v 1.91 2019/11/13 07:53:10 markus Exp $ */ 1/* $OpenBSD: sshkey.c,v 1.92 2019/11/13 22:00:21 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
4 * Copyright (c) 2008 Alexander von Gernler. All rights reserved. 4 * Copyright (c) 2008 Alexander von Gernler. All rights reserved.
@@ -1951,6 +1951,7 @@ sshkey_from_private(const struct sshkey *k, struct sshkey **pkp)
1951 if ((r = sshkey_xmss_init(n, k->xmss_name)) != 0) 1951 if ((r = sshkey_xmss_init(n, k->xmss_name)) != 0)
1952 goto out; 1952 goto out;
1953 if (k->xmss_pk != NULL) { 1953 if (k->xmss_pk != NULL) {
1954 u_int32_t left;
1954 size_t pklen = sshkey_xmss_pklen(k); 1955 size_t pklen = sshkey_xmss_pklen(k);
1955 if (pklen == 0 || sshkey_xmss_pklen(n) != pklen) { 1956 if (pklen == 0 || sshkey_xmss_pklen(n) != pklen) {
1956 r = SSH_ERR_INTERNAL_ERROR; 1957 r = SSH_ERR_INTERNAL_ERROR;
@@ -1961,6 +1962,10 @@ sshkey_from_private(const struct sshkey *k, struct sshkey **pkp)
1961 goto out; 1962 goto out;
1962 } 1963 }
1963 memcpy(n->xmss_pk, k->xmss_pk, pklen); 1964 memcpy(n->xmss_pk, k->xmss_pk, pklen);
1965 /* simulate number of signatures left on pubkey */
1966 left = sshkey_xmss_signatures_left(k);
1967 if (left)
1968 sshkey_xmss_enable_maxsign(n, left);
1964 } 1969 }
1965 break; 1970 break;
1966#endif /* WITH_XMSS */ 1971#endif /* WITH_XMSS */