summaryrefslogtreecommitdiff
path: root/lib/libcrypto/ec
diff options
context:
space:
mode:
authorDoug Hogan <doug@cvs.openbsd.org>2015-04-29 00:11:13 +0000
committerDoug Hogan <doug@cvs.openbsd.org>2015-04-29 00:11:13 +0000
commitf7fbc89b37c0e508132deb5889547f4271f2fdf1 (patch)
treebae1058afd2bc0cc05b2ea9f31757f047947bbd8 /lib/libcrypto/ec
parentb72c00aa6158318bbdc4abea54e32c47683d44c5 (diff)
Add missing BN_CTX_end() calls.
After calling BN_CTX_start(), there must be a BN_CTX_end() before returning. There were missing BN_CTX_end() calls in error paths. One diff chunk was simply removing redundant code related to this. ok deraadt@
Diffstat (limited to 'lib/libcrypto/ec')
-rw-r--r--lib/libcrypto/ec/ec_lib.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/libcrypto/ec/ec_lib.c b/lib/libcrypto/ec/ec_lib.c
index 8cf0f2241ee..d36c2c2e6e2 100644
--- a/lib/libcrypto/ec/ec_lib.c
+++ b/lib/libcrypto/ec/ec_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec_lib.c,v 1.16 2015/02/09 15:49:22 jsing Exp $ */
+/* $OpenBSD: ec_lib.c,v 1.17 2015/04/29 00:11:12 doug Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
@@ -531,12 +531,8 @@ EC_GROUP_cmp(const EC_GROUP * a, const EC_GROUP * b, BN_CTX * ctx)
if (!EC_GROUP_get_order(a, a1, ctx) ||
!EC_GROUP_get_order(b, b1, ctx) ||
!EC_GROUP_get_cofactor(a, a2, ctx) ||
- !EC_GROUP_get_cofactor(b, b2, ctx)) {
- BN_CTX_end(ctx);
- if (ctx_new)
- BN_CTX_free(ctx);
- return -1;
- }
+ !EC_GROUP_get_cofactor(b, b2, ctx))
+ goto err;
if (BN_cmp(a1, b1) || BN_cmp(a2, b2))
r = 1;
}