summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_recp.c
diff options
context:
space:
mode:
authordoug <>2015-04-29 00:11:12 +0000
committerdoug <>2015-04-29 00:11:12 +0000
commit843c114d1987e49ba9785f455dad7c1709177bb2 (patch)
tree1bd273d1ec23b03522e575d3b072de7f0789a8b1 /src/lib/libcrypto/bn/bn_recp.c
parent9e874579a3d35b6a89acefa2792ff97236256dc2 (diff)
downloadopenbsd-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/bn/bn_recp.c')
-rw-r--r--src/lib/libcrypto/bn/bn_recp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/bn/bn_recp.c b/src/lib/libcrypto/bn/bn_recp.c
index 7b31fe0adf..b0bd0aa4df 100644
--- a/src/lib/libcrypto/bn/bn_recp.c
+++ b/src/lib/libcrypto/bn/bn_recp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_recp.c,v 1.12 2015/03/21 08:05:20 doug Exp $ */ 1/* $OpenBSD: bn_recp.c,v 1.13 2015/04/29 00:11:12 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -161,8 +161,10 @@ BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, BN_RECP_CTX *recp,
161 161
162 if (BN_ucmp(m, &(recp->N)) < 0) { 162 if (BN_ucmp(m, &(recp->N)) < 0) {
163 BN_zero(d); 163 BN_zero(d);
164 if (!BN_copy(r, m)) 164 if (!BN_copy(r, m)) {
165 BN_CTX_end(ctx);
165 return 0; 166 return 0;
167 }
166 BN_CTX_end(ctx); 168 BN_CTX_end(ctx);
167 return (1); 169 return (1);
168 } 170 }