diff options
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r-- | ssh-keygen.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c index d50ca5f28..d7974f3dc 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-keygen.c,v 1.407 2020/04/20 04:43:57 djm Exp $ */ | 1 | /* $OpenBSD: ssh-keygen.c,v 1.408 2020/05/01 04:23:11 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -669,9 +669,10 @@ do_convert_from_ssh2(struct passwd *pw, struct sshkey **k, int *private) | |||
669 | encoded[len-3] = '\0'; | 669 | encoded[len-3] = '\0'; |
670 | if ((r = sshbuf_b64tod(buf, encoded)) != 0) | 670 | if ((r = sshbuf_b64tod(buf, encoded)) != 0) |
671 | fatal("%s: base64 decoding failed: %s", __func__, ssh_err(r)); | 671 | fatal("%s: base64 decoding failed: %s", __func__, ssh_err(r)); |
672 | if (*private) | 672 | if (*private) { |
673 | *k = do_convert_private_ssh2(buf); | 673 | if ((*k = do_convert_private_ssh2(buf)) == NULL) |
674 | else if ((r = sshkey_fromb(buf, k)) != 0) | 674 | fatal("%s: private key conversion failed", __func__); |
675 | } else if ((r = sshkey_fromb(buf, k)) != 0) | ||
675 | fatal("decode blob failed: %s", ssh_err(r)); | 676 | fatal("decode blob failed: %s", ssh_err(r)); |
676 | sshbuf_free(buf); | 677 | sshbuf_free(buf); |
677 | fclose(fp); | 678 | fclose(fp); |