summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-02-04 11:20:40 +1100
committerDamien Miller <djm@mindrot.org>2014-02-04 11:20:40 +1100
commitaae07e2e2000dd318418fd7fd4597760904cae32 (patch)
treeb3370f8fab7a594e13df6dcd6f691804b38b923d
parenta5103f413bde6f31bff85d6e1fd29799c647d765 (diff)
- djm@cvs.openbsd.org 2014/02/03 23:28:00
[ssh-ecdsa.c] fix memory leak; ECDSA_SIG_new() allocates 'r' and 's' for us, unlike DSA_SIG_new. Reported by Batz Spear; ok markus@
-rw-r--r--ChangeLog4
-rw-r--r--ssh-ecdsa.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index d5ea77c1..3e755cb9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -53,6 +53,10 @@
[ssh-keygen.c ssh-rsa.c sshconnect.c sshconnect1.c sshconnect2.c]
[sshd.c]
convert memset of potentially-private data to explicit_bzero()
+ - djm@cvs.openbsd.org 2014/02/03 23:28:00
+ [ssh-ecdsa.c]
+ fix memory leak; ECDSA_SIG_new() allocates 'r' and 's' for us, unlike
+ DSA_SIG_new. Reported by Batz Spear; ok markus@
20140131
- (djm) [sandbox-seccomp-filter.c sandbox-systrace.c] Allow shutdown(2)
diff --git a/ssh-ecdsa.c b/ssh-ecdsa.c
index 95b22244..551c9c46 100644
--- a/ssh-ecdsa.c
+++ b/ssh-ecdsa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-ecdsa.c,v 1.9 2014/02/02 03:44:31 djm Exp $ */
+/* $OpenBSD: ssh-ecdsa.c,v 1.10 2014/02/03 23:28:00 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2010 Damien Miller. All rights reserved.
@@ -140,9 +140,6 @@ ssh_ecdsa_verify(const Key *key, const u_char *signature, u_int signaturelen,
/* parse signature */
if ((sig = ECDSA_SIG_new()) == NULL)
fatal("%s: ECDSA_SIG_new failed", __func__);
- if ((sig->r = BN_new()) == NULL ||
- (sig->s = BN_new()) == NULL)
- fatal("%s: BN_new failed", __func__);
buffer_init(&bb);
buffer_append(&bb, sigblob, len);