summaryrefslogtreecommitdiff
path: root/sshkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshkey.c')
-rw-r--r--sshkey.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/sshkey.c b/sshkey.c
index 1f714c37f..3dd8907b0 100644
--- a/sshkey.c
+++ b/sshkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshkey.c,v 1.22 2015/09/02 07:51:12 jsg Exp $ */ 1/* $OpenBSD: sshkey.c,v 1.23 2015/09/13 14:39:16 tim 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.
@@ -3833,8 +3833,6 @@ int
3833sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type, 3833sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type,
3834 const char *passphrase, struct sshkey **keyp, char **commentp) 3834 const char *passphrase, struct sshkey **keyp, char **commentp)
3835{ 3835{
3836 int r;
3837
3838 *keyp = NULL; 3836 *keyp = NULL;
3839 if (commentp != NULL) 3837 if (commentp != NULL)
3840 *commentp = NULL; 3838 *commentp = NULL;
@@ -3856,8 +3854,8 @@ sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type,
3856 return sshkey_parse_private2(blob, type, passphrase, 3854 return sshkey_parse_private2(blob, type, passphrase,
3857 keyp, commentp); 3855 keyp, commentp);
3858 case KEY_UNSPEC: 3856 case KEY_UNSPEC:
3859 if ((r = sshkey_parse_private2(blob, type, passphrase, keyp, 3857 if (sshkey_parse_private2(blob, type, passphrase, keyp,
3860 commentp)) == 0) 3858 commentp) == 0)
3861 return 0; 3859 return 0;
3862#ifdef WITH_OPENSSL 3860#ifdef WITH_OPENSSL
3863 return sshkey_parse_private_pem_fileblob(blob, type, 3861 return sshkey_parse_private_pem_fileblob(blob, type,
@@ -3872,10 +3870,8 @@ sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type,
3872 3870
3873int 3871int
3874sshkey_parse_private_fileblob(struct sshbuf *buffer, const char *passphrase, 3872sshkey_parse_private_fileblob(struct sshbuf *buffer, const char *passphrase,
3875 const char *filename, struct sshkey **keyp, char **commentp) 3873 struct sshkey **keyp, char **commentp)
3876{ 3874{
3877 int r;
3878
3879 if (keyp != NULL) 3875 if (keyp != NULL)
3880 *keyp = NULL; 3876 *keyp = NULL;
3881 if (commentp != NULL) 3877 if (commentp != NULL)
@@ -3883,13 +3879,11 @@ sshkey_parse_private_fileblob(struct sshbuf *buffer, const char *passphrase,
3883 3879
3884#ifdef WITH_SSH1 3880#ifdef WITH_SSH1
3885 /* it's a SSH v1 key if the public key part is readable */ 3881 /* it's a SSH v1 key if the public key part is readable */
3886 if ((r = sshkey_parse_public_rsa1_fileblob(buffer, NULL, NULL)) == 0) { 3882 if (sshkey_parse_public_rsa1_fileblob(buffer, NULL, NULL) == 0) {
3887 return sshkey_parse_private_fileblob_type(buffer, KEY_RSA1, 3883 return sshkey_parse_private_fileblob_type(buffer, KEY_RSA1,
3888 passphrase, keyp, commentp); 3884 passphrase, keyp, commentp);
3889 } 3885 }
3890#endif /* WITH_SSH1 */ 3886#endif /* WITH_SSH1 */
3891 if ((r = sshkey_parse_private_fileblob_type(buffer, KEY_UNSPEC, 3887 return sshkey_parse_private_fileblob_type(buffer, KEY_UNSPEC,
3892 passphrase, keyp, commentp)) == 0) 3888 passphrase, keyp, commentp);
3893 return 0;
3894 return r;
3895} 3889}