summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_mul.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2007-07-08 18:53:03 +0000
committerAndy Polyakov <appro@openssl.org>2007-07-08 18:53:03 +0000
commit35295bdbeed634ebe811860831f25bc5ecc9d0bb (patch)
tree473080d5acb6d6dfc6fcafbd7154b89801f800e8 /crypto/bn/bn_mul.c
parentaa8d6f3e8654478e22d3de6b407c6ca6f692f079 (diff)
bn_mul_recursive doesn't handle all cases correctly, which results in
BN_mul failures at certain key-length mixes. PR: 1427
Diffstat (limited to 'crypto/bn/bn_mul.c')
-rw-r--r--crypto/bn/bn_mul.c8
1 files changed, 4 insertions, 4 deletions
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;