]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authordjm@openbsd.org <djm@openbsd.org>
Fri, 3 Apr 2015 22:17:27 +0000 (22:17 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 3 Apr 2015 22:18:26 +0000 (09:18 +1100)
correct return value in pubkey parsing, spotted by Ben Hawkes
 ok markus@

sshkey.c

index 4768790338011ce2f6d104841a4f5a99babecdd5..3cc3f444a92b3d0943cf1d69d73b0e1ab5534098 100644 (file)
--- a/sshkey.c
+++ b/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.
@@ -2013,8 +2013,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;
                }
@@ -2035,10 +2035,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;
                }