diff options
| author | doug <> | 2015-04-29 00:11:12 +0000 |
|---|---|---|
| committer | doug <> | 2015-04-29 00:11:12 +0000 |
| commit | 7ddad7b77b00aa2097c75fdeb29c69c61e6b4c5b (patch) | |
| tree | 1bd273d1ec23b03522e575d3b072de7f0789a8b1 /src/lib/libcrypto/bn/bn_recp.c | |
| parent | 29b3e8caf044d209b7dcfe76059033f1e5174a65 (diff) | |
| download | openbsd-7ddad7b77b00aa2097c75fdeb29c69c61e6b4c5b.tar.gz openbsd-7ddad7b77b00aa2097c75fdeb29c69c61e6b4c5b.tar.bz2 openbsd-7ddad7b77b00aa2097c75fdeb29c69c61e6b4c5b.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.c | 6 |
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 | } |
