summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sshkey.c
diff options
context:
space:
mode:
authortim <tim@openbsd.org>2015-09-13 14:39:16 +0000
committertim <tim@openbsd.org>2015-09-13 14:39:16 +0000
commit0768ca3d75e4d931d4f7f64cccd1922a6d7b331b (patch)
tree9a608c6b7a172acb71b4ccb675b7c99989474e65 /usr.bin/ssh/sshkey.c
parentMove prototype for spoofgptlabel() from disklabel.h to subr_disk.c. (diff)
downloadwireguard-openbsd-0768ca3d75e4d931d4f7f64cccd1922a6d7b331b.tar.xz
wireguard-openbsd-0768ca3d75e4d931d4f7f64cccd1922a6d7b331b.zip
- Fix error message: passphrase needs to be at least 5 characters, not 4.
- Remove unused function argument. - Remove two unnecessary variables. OK djm@
Diffstat (limited to 'usr.bin/ssh/sshkey.c')
-rw-r--r--usr.bin/ssh/sshkey.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/usr.bin/ssh/sshkey.c b/usr.bin/ssh/sshkey.c
index 22732f200e4..c73c77f3962 100644
--- a/usr.bin/ssh/sshkey.c
+++ b/usr.bin/ssh/sshkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshkey.c,v 1.22 2015/09/02 07:51:12 jsg Exp $ */
+/* $OpenBSD: sshkey.c,v 1.23 2015/09/13 14:39:16 tim Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Alexander von Gernler. All rights reserved.
@@ -3775,8 +3775,6 @@ int
sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type,
const char *passphrase, struct sshkey **keyp, char **commentp)
{
- int r;
-
*keyp = NULL;
if (commentp != NULL)
*commentp = NULL;
@@ -3798,8 +3796,8 @@ sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type,
return sshkey_parse_private2(blob, type, passphrase,
keyp, commentp);
case KEY_UNSPEC:
- if ((r = sshkey_parse_private2(blob, type, passphrase, keyp,
- commentp)) == 0)
+ if (sshkey_parse_private2(blob, type, passphrase, keyp,
+ commentp) == 0)
return 0;
#ifdef WITH_OPENSSL
return sshkey_parse_private_pem_fileblob(blob, type,
@@ -3814,10 +3812,8 @@ sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type,
int
sshkey_parse_private_fileblob(struct sshbuf *buffer, const char *passphrase,
- const char *filename, struct sshkey **keyp, char **commentp)
+ struct sshkey **keyp, char **commentp)
{
- int r;
-
if (keyp != NULL)
*keyp = NULL;
if (commentp != NULL)
@@ -3825,13 +3821,11 @@ sshkey_parse_private_fileblob(struct sshbuf *buffer, const char *passphrase,
#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) {
+ if (sshkey_parse_public_rsa1_fileblob(buffer, NULL, NULL) == 0) {
return sshkey_parse_private_fileblob_type(buffer, KEY_RSA1,
passphrase, keyp, commentp);
}
#endif /* WITH_SSH1 */
- if ((r = sshkey_parse_private_fileblob_type(buffer, KEY_UNSPEC,
- passphrase, keyp, commentp)) == 0)
- return 0;
- return r;
+ return sshkey_parse_private_fileblob_type(buffer, KEY_UNSPEC,
+ passphrase, keyp, commentp);
}