diff options
author | geoff <geoff> | 2004-03-13 23:57:17 +0000 |
---|---|---|
committer | geoff <geoff> | 2004-03-13 23:57:17 +0000 |
commit | 1ca46a67dc7d7dbd081722d9cf88d24946dd5413 (patch) | |
tree | 0c738c5c558a1b08c667649cbd1e2cbcabed2ad0 /crypto/bn/bn_sqrt.c | |
parent | 3d1ffd9689a0b13015f2cc49b2d3afb23991d128 (diff) | |
download | openssl-1ca46a67dc7d7dbd081722d9cf88d24946dd5413.tar.gz |
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_sqrt.c')
-rw-r--r-- | crypto/bn/bn_sqrt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/bn/bn_sqrt.c b/crypto/bn/bn_sqrt.c index 51902703e..924ee274d 100644 --- a/crypto/bn/bn_sqrt.c +++ b/crypto/bn/bn_sqrt.c @@ -288,7 +288,7 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) if (BN_is_zero(t)) { /* special case: a == 0 (mod p) */ - if (!BN_zero(ret)) goto end; + BN_zero(ret); err = 0; goto end; } @@ -301,7 +301,7 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) if (BN_is_zero(x)) { /* special case: a == 0 (mod p) */ - if (!BN_zero(ret)) goto end; + BN_zero(ret); err = 0; goto end; } |