From: Richard Levitte Date: Thu, 27 Jul 2000 21:17:14 +0000 (+0000) Subject: In the case where a < 0 and |a| < w, the result (assigned to a) from X-Git-Tag: OpenSSL-engine-0_9_6-beta1~17^2~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8b4e27e26efc097dbe65b0c3cd78a2da7be310ef;p=oweals%2Fopenssl.git In the case where a < 0 and |a| < w, the result (assigned to a) from BN_add_word becomes wrongly negative... This was discovered by Darrel Hankerson --- diff --git a/crypto/bn/bn_word.c b/crypto/bn/bn_word.c index 73157a7d43..7e7ca58842 100644 --- a/crypto/bn/bn_word.c +++ b/crypto/bn/bn_word.c @@ -115,7 +115,7 @@ int BN_add_word(BIGNUM *a, BN_ULONG w) a->neg=0; i=BN_sub_word(a,w); if (!BN_is_zero(a)) - a->neg=1; + a->neg=!(a->neg); return(i); } w&=BN_MASK2;