diff --git a/sshkey.c b/sshkey.c index 5497497cd..10b9e4676 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;