summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sshkey.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2015-04-03 22:17:27 +0000
committerdjm <djm@openbsd.org>2015-04-03 22:17:27 +0000
commit1874bb4afcd02a908ced893109cd23d63081190b (patch)
tree23ac268addf17bb5c0388a6b4e6305ae26b8264b /usr.bin/ssh/sshkey.c
parentPull an #include out of an #ifdef. (diff)
downloadwireguard-openbsd-1874bb4afcd02a908ced893109cd23d63081190b.tar.xz
wireguard-openbsd-1874bb4afcd02a908ced893109cd23d63081190b.zip
correct return value in pubkey parsing, spotted by Ben Hawkes
ok markus@
Diffstat (limited to 'usr.bin/ssh/sshkey.c')
-rw-r--r--usr.bin/ssh/sshkey.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/ssh/sshkey.c b/usr.bin/ssh/sshkey.c
index a13340b3fdb..ce6d4a13c4e 100644
--- a/usr.bin/ssh/sshkey.c
+++ b/usr.bin/ssh/sshkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshkey.c,v 1.15 2015/03/06 01:40:56 djm Exp $ */
+/* $OpenBSD: sshkey.c,v 1.16 2015/04/03 22:17:27 djm Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Alexander von Gernler. All rights reserved.
@@ -1977,8 +1977,8 @@ sshkey_from_blob_internal(struct sshbuf *b, struct sshkey **keyp,
ret = SSH_ERR_ALLOC_FAIL;
goto out;
}
- if (sshbuf_get_bignum2(b, key->rsa->e) == -1 ||
- sshbuf_get_bignum2(b, key->rsa->n) == -1) {
+ if (sshbuf_get_bignum2(b, key->rsa->e) != 0 ||
+ sshbuf_get_bignum2(b, key->rsa->n) != 0) {
ret = SSH_ERR_INVALID_FORMAT;
goto out;
}
@@ -1999,10 +1999,10 @@ sshkey_from_blob_internal(struct sshbuf *b, struct sshkey **keyp,
ret = SSH_ERR_ALLOC_FAIL;
goto out;
}
- if (sshbuf_get_bignum2(b, key->dsa->p) == -1 ||
- sshbuf_get_bignum2(b, key->dsa->q) == -1 ||
- sshbuf_get_bignum2(b, key->dsa->g) == -1 ||
- sshbuf_get_bignum2(b, key->dsa->pub_key) == -1) {
+ if (sshbuf_get_bignum2(b, key->dsa->p) != 0 ||
+ sshbuf_get_bignum2(b, key->dsa->q) != 0 ||
+ sshbuf_get_bignum2(b, key->dsa->g) != 0 ||
+ sshbuf_get_bignum2(b, key->dsa->pub_key) != 0) {
ret = SSH_ERR_INVALID_FORMAT;
goto out;
}