diff options
author | Geoff Thorpe <geoff@openssl.org> | 2003-11-04 22:54:49 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2003-11-04 22:54:49 +0000 |
commit | d870740cd75dd4f0cb66fb8c32653a7d47369706 (patch) | |
tree | 0c6cb1ce0b1083c96419c432d1f05c3dff51320d /crypto/bn/bn_gcd.c | |
parent | d8ec0dcf457f4dec39f137657b702fcbeaf5cc04 (diff) | |
download | openssl-d870740cd75dd4f0cb66fb8c32653a7d47369706.tar.gz |
Put the first stage of my bignum debugging adventures into CVS. This code
is itself experimental, and in addition may cause execution to break on
existing openssl "bugs" that previously were harmless or at least
invisible.
Diffstat (limited to 'crypto/bn/bn_gcd.c')
-rw-r--r-- | crypto/bn/bn_gcd.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/bn/bn_gcd.c b/crypto/bn/bn_gcd.c index 7649f63fd2..f02e6fcdb4 100644 --- a/crypto/bn/bn_gcd.c +++ b/crypto/bn/bn_gcd.c @@ -140,6 +140,7 @@ int BN_gcd(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx) ret=1; err: BN_CTX_end(ctx); + bn_check_top(r); return(ret); } @@ -194,6 +195,7 @@ static BIGNUM *euclid(BIGNUM *a, BIGNUM *b) { if (!BN_lshift(a,a,shifts)) goto err; } + bn_check_top(a); return(a); err: return(NULL); @@ -486,5 +488,6 @@ BIGNUM *BN_mod_inverse(BIGNUM *in, err: if ((ret == NULL) && (in == NULL)) BN_free(R); BN_CTX_end(ctx); + bn_check_top(ret); return(ret); } |