]> granicus.if.org Git - openssl/commitdiff
Merge from stable branch.
authorDr. Stephen Henson <steve@openssl.org>
Tue, 24 Apr 2007 11:34:19 +0000 (11:34 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 24 Apr 2007 11:34:19 +0000 (11:34 +0000)
crypto/bn/bn_div.c
crypto/bn/bn_gcd.c

index 9addaf158f53f724102292f58f19788f7a7655e7..514b2c2c822a3a1f4f1edc395f5fcd460d10e72e 100644 (file)
@@ -422,7 +422,7 @@ int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
 
        if (BN_is_zero(divisor))
                {
-               BNerr(BN_F_BN_DIV,BN_R_DIV_BY_ZERO);
+               BNerr(BN_F_BN_DIV_NO_BRANCH,BN_R_DIV_BY_ZERO);
                return(0);
                }
 
@@ -618,6 +618,7 @@ X) -> 0x%08X\n",
                        rm->neg = neg;
                bn_check_top(rm);
                }
+       bn_correct_top(res);
        BN_CTX_end(ctx);
        return(1);
 err:
index 5fb8090c5278986a6d528fa702bab8367c2e3e48..85e4b50c10252cd3e9a61f6c9e4248970f859304 100644 (file)
@@ -640,7 +640,7 @@ BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
                }
        else
                {
-               BNerr(BN_F_BN_MOD_INVERSE,BN_R_NO_INVERSE);
+               BNerr(BN_F_BN_MOD_INVERSE_NO_BRANCH,BN_R_NO_INVERSE);
                goto err;
                }
        ret=R;