summaryrefslogtreecommitdiff
path: root/ssh-ecdsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-ecdsa.c')
-rw-r--r--ssh-ecdsa.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/ssh-ecdsa.c b/ssh-ecdsa.c
index 2f5531752..599c7199d 100644
--- a/ssh-ecdsa.c
+++ b/ssh-ecdsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-ecdsa.c,v 1.14 2018/02/07 02:06:51 jsing Exp $ */ 1/* $OpenBSD: ssh-ecdsa.c,v 1.16 2019/01/21 09:54:11 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2010 Damien Miller. All rights reserved. 4 * Copyright (c) 2010 Damien Miller. All rights reserved.
@@ -151,15 +151,13 @@ ssh_ecdsa_verify(const struct sshkey *key,
151 } 151 }
152 152
153 /* parse signature */ 153 /* parse signature */
154 if ((sig = ECDSA_SIG_new()) == NULL || 154 if (sshbuf_get_bignum2(sigbuf, &sig_r) != 0 ||
155 (sig_r = BN_new()) == NULL || 155 sshbuf_get_bignum2(sigbuf, &sig_s) != 0) {
156 (sig_s = BN_new()) == NULL) { 156 ret = SSH_ERR_INVALID_FORMAT;
157 ret = SSH_ERR_ALLOC_FAIL;
158 goto out; 157 goto out;
159 } 158 }
160 if (sshbuf_get_bignum2(sigbuf, sig_r) != 0 || 159 if ((sig = ECDSA_SIG_new()) == NULL) {
161 sshbuf_get_bignum2(sigbuf, sig_s) != 0) { 160 ret = SSH_ERR_ALLOC_FAIL;
162 ret = SSH_ERR_INVALID_FORMAT;
163 goto out; 161 goto out;
164 } 162 }
165 if (!ECDSA_SIG_set0(sig, sig_r, sig_s)) { 163 if (!ECDSA_SIG_set0(sig, sig_r, sig_s)) {