summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorseb <seb@pkgsrc.org>2004-03-29 13:49:42 +0000
committerseb <seb@pkgsrc.org>2004-03-29 13:49:42 +0000
commit490f011eb46318b2b80933e0c3b0ad9efe980c14 (patch)
tree95879f2422cc3bac813ec5750626b4cf1e22a18d /security
parent03ee8ebe464cfa92495e6b6cb2ffd640aaca151a (diff)
downloadpkgsrc-490f011eb46318b2b80933e0c3b0ad9efe980c14.tar.gz
Fix build on NetBSD sparc64 with perl 5.8.
usage of perl's int() causes trouble with perl 5.8.3 (5.8*?) on at least NetBSD sparc64/1.6.2. The perl script openssl-0.9.6m/crypto/bn/bn_prime.pl uses the perl function int() to truncate the return of sqrt() function. On the above mentioned platform this leads to execution error: ... /usr/pkg/bin/perl bn_prime.pl >bn_prime.h Illegal modulus zero at bn_prime.pl line 16. Tracing the problem I've found that this int() usage may be the key of the problem. Please note the following: $ uname -srm; perl -v | grep 'This is perl'; perl -e 'print int(sqrt(3)),"\n"' NetBSD 1.6.2 sparc64 This is perl, v5.8.3 built for sparc64-netbsd 2 And... $ uname -srm; perl -v | grep 'This is perl'; perl -e 'print int(sqrt(3)),"\n"' NetBSD 1.6.2 sparc64 This is perl, v5.6.1 built for sparc64-netbsd 1 Also note that perlfunc(3) warns about int() used for rounding and recommends to use sprintf, printf, POSIX::floor or POSIX::ceil when applicable. My workaround is to use POSIX::floor() instead of int().
Diffstat (limited to 'security')
-rw-r--r--security/openssl/distinfo3
-rw-r--r--security/openssl/patches/patch-ak22
2 files changed, 24 insertions, 1 deletions
diff --git a/security/openssl/distinfo b/security/openssl/distinfo
index ea52d3a966c..57b3bd9875f 100644
--- a/security/openssl/distinfo
+++ b/security/openssl/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.28 2004/03/26 08:13:24 jlam Exp $
+$NetBSD: distinfo,v 1.29 2004/03/29 13:49:42 seb Exp $
SHA1 (openssl-0.9.6m.tar.gz) = 52414b8867944e2c35940142d38052544dab1358
Size (openssl-0.9.6m.tar.gz) = 2184918 bytes
@@ -9,3 +9,4 @@ SHA1 (patch-ad) = 44acd3ba563095511267b09a7b56774bb3b90b1d
SHA1 (patch-ae) = f4bf6ae5aa41b55d9978376e4e50ee10c10dd288
SHA1 (patch-af) = f37700c5fc04e2e59e525b5fb37986ba27c0080a
SHA1 (patch-aj) = e300ae91c19214faf3419e7499214a1b536aac18
+SHA1 (patch-ak) = 7f9960a97cbe83c381c2a4565ca3a6e4e661bf54
diff --git a/security/openssl/patches/patch-ak b/security/openssl/patches/patch-ak
new file mode 100644
index 00000000000..203ba06dce8
--- /dev/null
+++ b/security/openssl/patches/patch-ak
@@ -0,0 +1,22 @@
+$NetBSD: patch-ak,v 1.5 2004/03/29 13:49:42 seb Exp $
+
+--- crypto/bn/bn_prime.pl.orig Wed Feb 16 13:24:06 2000
++++ crypto/bn/bn_prime.pl
+@@ -1,6 +1,8 @@
+ #!/usr/local/bin/perl
+ # bn_prime.pl
+
++use POSIX;
++
+ $num=2048;
+ $num=$ARGV[0] if ($#ARGV >= 0);
+
+@@ -9,7 +11,7 @@ $p=1;
+ loop: while ($#primes < $num-1)
+ {
+ $p+=2;
+- $s=int(sqrt($p));
++ $s=floor(sqrt($p));
+
+ for ($i=0; $primes[$i]<=$s; $i++)
+ {