summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sshkey.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2014-06-27 18:50:39 +0000
committermarkus <markus@openbsd.org>2014-06-27 18:50:39 +0000
commit4a9acc050bbf6c1c16f9ce46ab30e3f74280e511 (patch)
tree27d00225f72e89de86569801e99ad18d17ccf063 /usr.bin/ssh/sshkey.c
parentextra evil spaces snuck in over the last while (diff)
downloadwireguard-openbsd-4a9acc050bbf6c1c16f9ce46ab30e3f74280e511.tar.xz
wireguard-openbsd-4a9acc050bbf6c1c16f9ce46ab30e3f74280e511.zip
fix loading of private keys
Diffstat (limited to 'usr.bin/ssh/sshkey.c')
-rw-r--r--usr.bin/ssh/sshkey.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/ssh/sshkey.c b/usr.bin/ssh/sshkey.c
index cab8251719b..1648b7e62be 100644
--- a/usr.bin/ssh/sshkey.c
+++ b/usr.bin/ssh/sshkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshkey.c,v 1.1 2014/06/24 01:16:58 djm Exp $ */
+/* $OpenBSD: sshkey.c,v 1.2 2014/06/27 18:50:39 markus Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Alexander von Gernler. All rights reserved.
@@ -3775,9 +3775,6 @@ sshkey_parse_private_fileblob(struct sshbuf *buffer, const char *passphrase,
if (commentp != NULL)
*commentp = NULL;
- if ((r = sshkey_parse_private_fileblob_type(buffer, KEY_UNSPEC,
- passphrase, keyp, commentp)) == 0)
- return 0;
#ifdef WITH_SSH1
/* it's a SSH v1 key if the public key part is readable */
if ((r = sshkey_parse_public_rsa1_fileblob(buffer, NULL, NULL)) == 0) {
@@ -3785,5 +3782,8 @@ sshkey_parse_private_fileblob(struct sshbuf *buffer, const char *passphrase,
passphrase, keyp, commentp);
}
#endif /* WITH_SSH1 */
+ if ((r = sshkey_parse_private_fileblob_type(buffer, KEY_UNSPEC,
+ passphrase, keyp, commentp)) == 0)
+ return 0;
return r;
}