mirror of
https://github.com/openssl/openssl.git
synced 2024-11-21 01:15:20 +08:00
bn_mul_recursive doesn't handle all cases correctly, which results in
BN_mul failures at certain key-length mixes. PR: 1427
This commit is contained in:
parent
aa8d6f3e86
commit
35295bdbee
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user