summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_mont.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-09-19 17:21:52 +0000
committerBodo Möller <bodo@openssl.org>2000-09-19 17:21:52 +0000
commitf4364e0730a9c3468cfd7212dd75374ea3b0ea4f (patch)
treeb23934772a6e897b0ea1d21f0e9d5c6cc5a00e4b /crypto/bn/bn_mont.c
parentfae876263018d91f33b48fd2b6e6c2c328b8a166 (diff)
Disable buggy code variant in BN_mod_mul_montgomery that was enabled
in 0.9.6-beta1 and 0.9.6-beta2 and caused the BN_mont_exp_mont_word() failure (bug report "openssh 2.2.0p1 fails with openssl 0.9.6-beta1").
Diffstat (limited to 'crypto/bn/bn_mont.c')
-rw-r--r--crypto/bn/bn_mont.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c
index ca58ad33d2..932f5cecef 100644
--- a/crypto/bn/bn_mont.c
+++ b/crypto/bn/bn_mont.c
@@ -85,7 +85,26 @@ int BN_mod_mul_montgomery(BIGNUM *r, BIGNUM *a, BIGNUM *b,
if (a == b)
{
-#if 1
+#if 0 /* buggy -- try squaring g in the following parameters
+ (but note that squaring 2 or 4 works):
+Diffie-Hellman-Parameters: (1024 bit)
+ prime:
+ 00:ff:ff:ff:ff:ff:ff:ff:ff:c9:0f:da:a2:21:68:
+ c2:34:c4:c6:62:8b:80:dc:1c:d1:29:02:4e:08:8a:
+ 67:cc:74:02:0b:be:a6:3b:13:9b:22:51:4a:08:79:
+ 8e:34:04:dd:ef:95:19:b3:cd:3a:43:1b:30:2b:0a:
+ 6d:f2:5f:14:37:4f:e1:35:6d:6d:51:c2:45:e4:85:
+ b5:76:62:5e:7e:c6:f4:4c:42:e9:a6:37:ed:6b:0b:
+ ff:5c:b6:f4:06:b7:ed:ee:38:6b:fb:5a:89:9f:a5:
+ ae:9f:24:11:7c:4b:1f:e6:49:28:66:51:ec:e6:53:
+ 81:ff:ff:ff:ff:ff:ff:ff:ff
+ generator: 8 (0x8)
+-----BEGIN DH PARAMETERS-----
+MIGHAoGBAP//////////yQ/aoiFowjTExmKLgNwc0SkCTgiKZ8x0Agu+pjsTmyJR
+Sgh5jjQE3e+VGbPNOkMbMCsKbfJfFDdP4TVtbVHCReSFtXZiXn7G9ExC6aY37WsL
+/1y29Aa37e44a/taiZ+lrp8kEXxLH+ZJKGZR7OZTgf//////////AgEI
+-----END DH PARAMETERS-----
+*/
bn_wexpand(tmp,a->top*2);
bn_wexpand(tmp2,a->top*4);
bn_sqr_recursive(tmp->d,a->d,a->top,tmp2->d);