diff options
author | Ed Maste <emaste@FreeBSD.org> | 2020-02-14 19:47:15 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2020-02-14 19:47:15 +0000 |
commit | f02e39982452024dafcf0ea6e536ebff586ffce4 (patch) | |
tree | 78cdaad953cc879dc7d97272436a4d84b228d94c /ssh-ecdsa.c | |
parent | dc9e8d9c8401178683a1f53bc816389a1160dc41 (diff) |
Notes
Diffstat (limited to 'ssh-ecdsa.c')
-rw-r--r-- | ssh-ecdsa.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ssh-ecdsa.c b/ssh-ecdsa.c index 2f553175267e..599c7199db19 100644 --- a/ssh-ecdsa.c +++ b/ssh-ecdsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-ecdsa.c,v 1.14 2018/02/07 02:06:51 jsing Exp $ */ +/* $OpenBSD: ssh-ecdsa.c,v 1.16 2019/01/21 09:54:11 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2010 Damien Miller. All rights reserved. @@ -151,15 +151,13 @@ ssh_ecdsa_verify(const struct sshkey *key, } /* parse signature */ - if ((sig = ECDSA_SIG_new()) == NULL || - (sig_r = BN_new()) == NULL || - (sig_s = BN_new()) == NULL) { - ret = SSH_ERR_ALLOC_FAIL; + if (sshbuf_get_bignum2(sigbuf, &sig_r) != 0 || + sshbuf_get_bignum2(sigbuf, &sig_s) != 0) { + ret = SSH_ERR_INVALID_FORMAT; goto out; } - if (sshbuf_get_bignum2(sigbuf, sig_r) != 0 || - sshbuf_get_bignum2(sigbuf, sig_s) != 0) { - ret = SSH_ERR_INVALID_FORMAT; + if ((sig = ECDSA_SIG_new()) == NULL) { + ret = SSH_ERR_ALLOC_FAIL; goto out; } if (!ECDSA_SIG_set0(sig, sig_r, sig_s)) { |