From: Andy Polyakov Date: Sun, 8 Jul 2007 18:54:30 +0000 (+0000) Subject: bn_mul_recursive doesn't handle all cases correctly, which results in X-Git-Tag: OpenSSL_0_9_8f~90 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5a84b7fc2db33cdefc5a7b62f0169f2c08fb3d9b;p=oweals%2Fopenssl.git bn_mul_recursive doesn't handle all cases correctly, which results in BN_mul failures at certain key-length mixes [from HEAD]. PR: 1427 --- diff --git a/crypto/bn/bn_mul.c b/crypto/bn/bn_mul.c index aec1eafc65..312b467645 100644 --- a/crypto/bn/bn_mul.c +++ b/crypto/bn/bn_mul.c @@ -655,16 +655,16 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n, for (;;) { i/=2; - if (i < tna && i < tnb) + if (i <= tna && tna == tnb) { - bn_mul_part_recursive(&(r[n2]), + bn_mul_recursive(&(r[n2]), &(a[n]),&(b[n]), i,tna-i,tnb-i,p); break; } - else if (i <= tna && i <= tnb) + else if (i < tna || i < tnb) { - bn_mul_recursive(&(r[n2]), + bn_mul_part_recursive(&(r[n2]), &(a[n]),&(b[n]), i,tna-i,tnb-i,p); break;