From: djm@openbsd.org Date: Fri, 3 Apr 2015 22:17:27 +0000 (+0000) Subject: upstream commit X-Git-Tag: V_6_9_P1~130 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f4ea3c9ab1d32d43c9222c4351f58ca11144156;p=thirdparty%2Fopenssh-portable.git upstream commit correct return value in pubkey parsing, spotted by Ben Hawkes ok markus@ --- diff --git a/sshkey.c b/sshkey.c index 476879033..3cc3f444a 100644 --- 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; }