summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf S. Engelschall <rse@openssl.org>2003-09-25 13:57:58 +0000
committerRalf S. Engelschall <rse@openssl.org>2003-09-25 13:57:58 +0000
commit6bd27f8644e401301e3a843d92876e74ed6cb0ea (patch)
tree14282d2995739fa54645ef6e93a4bb044ffd49a7
parentdfe399e7d9773174c44fa3451b97cf1e3ca07a55 (diff)
downloadopenssl-6bd27f8644e401301e3a843d92876e74ed6cb0ea.tar.gz
Fix prime generation loop in crypto/bn/bn_prime.pl by making
sure the loop does correctly stop and breaking ("division by zero") modulus operations are not performed. The (pre-generated) prime table crypto/bn/bn_prime.h was already correct, but it could not be re-generated on some platforms because of the "division by zero" situation in the script.
-rw-r--r--CHANGES8
-rw-r--r--crypto/bn/bn_prime.pl2
2 files changed, 9 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index fc57065a61..5e68e6247d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,14 @@
Changes between 0.9.7c and 0.9.8 [xx XXX xxxx]
+ *) Fix prime generation loop in crypto/bn/bn_prime.pl by making
+ sure the loop does correctly stop and breaking ("division by zero")
+ modulus operations are not performed. The (pre-generated) prime
+ table crypto/bn/bn_prime.h was already correct, but it could not be
+ re-generated on some platforms because of the "division by zero"
+ situation in the script.
+ [Ralf S. Engelschall]
+
*) Update support for ECC-based TLS ciphersuites according to
draft-ietf-tls-ecc-03.txt: the KDF1 key derivation function with
SHA-1 now is only used for "small" curves (where the
diff --git a/crypto/bn/bn_prime.pl b/crypto/bn/bn_prime.pl
index 9fc3765486..e583d1d53b 100644
--- a/crypto/bn/bn_prime.pl
+++ b/crypto/bn/bn_prime.pl
@@ -11,7 +11,7 @@ loop: while ($#primes < $num-1)
$p+=2;
$s=int(sqrt($p));
- for ($i=0; $primes[$i]<=$s; $i++)
+ for ($i=0; defined($primes[$i]) && $primes[$i]<=$s; $i++)
{
next loop if (($p%$primes[$i]) == 0);
}