diff options
author | geoff <geoff> | 2003-10-30 01:03:31 +0000 |
---|---|---|
committer | geoff <geoff> | 2003-10-30 01:03:31 +0000 |
commit | 6b59252645858e9abde2896b1352b927341321aa (patch) | |
tree | b8fb867af9414ab7772fce59c00a8953de4feb64 /crypto/bn/bn_div.c | |
parent | d9b304f748ce8654f57f7113333d3d4da6a1f148 (diff) | |
download | openssl-6b59252645858e9abde2896b1352b927341321aa.tar.gz |
This fixes a couple of cases where an inconsistent BIGNUM could be passed as
input to a function.
Diffstat (limited to 'crypto/bn/bn_div.c')
-rw-r--r-- | crypto/bn/bn_div.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/bn/bn_div.c b/crypto/bn/bn_div.c index 580d1201b..b2efe5bb5 100644 --- a/crypto/bn/bn_div.c +++ b/crypto/bn/bn_div.c @@ -348,11 +348,16 @@ X) -> 0x%08X\n", l0=bn_mul_words(tmp->d,sdiv->d,div_n,q); wnum.d--; wnum.top++; tmp->d[div_n]=l0; + /* XXX: Couldn't we replace this with; + * tmp->top = div_n; + * bn_fix_top(tmp); + */ for (j=div_n+1; j>0; j--) if (tmp->d[j-1]) break; tmp->top=j; j=wnum.top; + bn_fix_top(&wnum); if (!BN_sub(&wnum,&wnum,tmp)) goto err; snum->top=snum->top+wnum.top-j; @@ -373,6 +378,7 @@ X) -> 0x%08X\n", * BN_rshift() will overwrite it. */ int neg = num->neg; + bn_fix_top(snum); BN_rshift(rm,snum,norm_shift); if (!BN_is_zero(rm)) rm->neg = neg; |