diff options
author | doug <> | 2015-04-29 00:11:12 +0000 |
---|---|---|
committer | doug <> | 2015-04-29 00:11:12 +0000 |
commit | 843c114d1987e49ba9785f455dad7c1709177bb2 (patch) | |
tree | 1bd273d1ec23b03522e575d3b072de7f0789a8b1 /src/lib/libcrypto/ec | |
parent | 9e874579a3d35b6a89acefa2792ff97236256dc2 (diff) | |
download | openbsd-843c114d1987e49ba9785f455dad7c1709177bb2.tar.gz openbsd-843c114d1987e49ba9785f455dad7c1709177bb2.tar.bz2 openbsd-843c114d1987e49ba9785f455dad7c1709177bb2.zip |
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 'src/lib/libcrypto/ec')
-rw-r--r-- | src/lib/libcrypto/ec/ec_lib.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c index 8cf0f2241e..d36c2c2e6e 100644 --- a/src/lib/libcrypto/ec/ec_lib.c +++ b/src/lib/libcrypto/ec/ec_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_lib.c,v 1.16 2015/02/09 15:49:22 jsing Exp $ */ | 1 | /* $OpenBSD: ec_lib.c,v 1.17 2015/04/29 00:11:12 doug Exp $ */ |
2 | /* | 2 | /* |
3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -531,12 +531,8 @@ EC_GROUP_cmp(const EC_GROUP * a, const EC_GROUP * b, BN_CTX * ctx) | |||
531 | if (!EC_GROUP_get_order(a, a1, ctx) || | 531 | if (!EC_GROUP_get_order(a, a1, ctx) || |
532 | !EC_GROUP_get_order(b, b1, ctx) || | 532 | !EC_GROUP_get_order(b, b1, ctx) || |
533 | !EC_GROUP_get_cofactor(a, a2, ctx) || | 533 | !EC_GROUP_get_cofactor(a, a2, ctx) || |
534 | !EC_GROUP_get_cofactor(b, b2, ctx)) { | 534 | !EC_GROUP_get_cofactor(b, b2, ctx)) |
535 | BN_CTX_end(ctx); | 535 | goto err; |
536 | if (ctx_new) | ||
537 | BN_CTX_free(ctx); | ||
538 | return -1; | ||
539 | } | ||
540 | if (BN_cmp(a1, b1) || BN_cmp(a2, b2)) | 536 | if (BN_cmp(a1, b1) || BN_cmp(a2, b2)) |
541 | r = 1; | 537 | r = 1; |
542 | } | 538 | } |