summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_mul.c
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2004-03-13 23:57:20 +0000
committerGeoff Thorpe <geoff@openssl.org>2004-03-13 23:57:20 +0000
commitb6358c89a10128692875fb92921b663c4d079a1e (patch)
treed36362a84ee41209484b4b088c2b9d1728bfc613 /crypto/bn/bn_mul.c
parent5d735465d1b5b7853506979946ad5730cc3615bb (diff)
Convert openssl code not to assume the deprecated form of BN_zero().
Remove certain redundant BN_zero() initialisations, because BN_CTX_get(), BN_init(), [etc] already initialise to zero. Correct error checking in bn_sqr.c, and be less wishy-wash about how/why the result's 'top' value is set (note also, 'max' is always > 0 at this point).
Diffstat (limited to 'crypto/bn/bn_mul.c')
-rw-r--r--crypto/bn/bn_mul.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/bn/bn_mul.c b/crypto/bn/bn_mul.c
index 5a92f9a335..aec1eafc65 100644
--- a/crypto/bn/bn_mul.c
+++ b/crypto/bn/bn_mul.c
@@ -964,7 +964,7 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
if ((al == 0) || (bl == 0))
{
- if (!BN_zero(r)) goto err;
+ BN_zero(r);
return(1);
}
top=al+bl;
@@ -1094,8 +1094,8 @@ end:
if (r != rr) BN_copy(r,rr);
ret=1;
err:
- BN_CTX_end(ctx);
bn_check_top(r);
+ BN_CTX_end(ctx);
return(ret);
}