summaryrefslogtreecommitdiff
path: root/security/py-crypto
diff options
context:
space:
mode:
authorgls <gls@pkgsrc.org>2010-12-05 17:13:09 +0000
committergls <gls@pkgsrc.org>2010-12-05 17:13:09 +0000
commita920bc52d32ad94e0abea6172810e7d12acd84ca (patch)
treeebf804a0e10299b148187126de9790bcbee64288 /security/py-crypto
parent7b9e7deb196b32df9a4e91903cfcba7aa5c9e6fc (diff)
downloadpkgsrc-a920bc52d32ad94e0abea6172810e7d12acd84ca.tar.gz
Update py-crypto to version 2.3
pkgsrc changes: - add a patch to fix an hardcoded interpreter path - add a patch to actually find gmp library. - add CONFLICTS with py-amkCrypto, both have files in common. upstream changes: 2.3 === * Fix NameError when attempting to use deprecated getRandomNumber() function. * _slowmath: Compute RSA u parameter when it's not given to RSA.construct. This makes _slowmath behave the same as _fastmath in this regard. * Make RSA.generate raise a more user-friendly exception message when the user tries to generate a bogus-length key. 2.2 === * Deprecated Crypto.Util.number.getRandomNumber(), which had confusing semantics. It's been replaced by getRandomNBitInteger and getRandomInteger. (Thanks: Lorenz Quack) * Better isPrime() and getPrime() implementations that do a real Rabin-Miller probabilistic primality test (not the phony test we did before with fixed bases). (Thanks: Lorenz Quack) * getStrongPrime() implementation for generating RSA primes. (Thanks: Lorenz Quack) * Support for importing and exporting RSA keys in DER and PEM format (Thanks: Legrandin) * Fix PyCrypto when floor division (python -Qnew) is enabled. * When building using gcc, use -std=c99 for compilation. This should fix building on FreeBSD and NetBSD.
Diffstat (limited to 'security/py-crypto')
-rw-r--r--security/py-crypto/Makefile25
-rw-r--r--security/py-crypto/PLIST12
-rw-r--r--security/py-crypto/distinfo12
-rw-r--r--security/py-crypto/patches/patch-aa10
-rw-r--r--security/py-crypto/patches/patch-ab4
-rw-r--r--security/py-crypto/patches/patch-ac13
6 files changed, 62 insertions, 14 deletions
diff --git a/security/py-crypto/Makefile b/security/py-crypto/Makefile
index bb1d73edf3f..0f7e99ace39 100644
--- a/security/py-crypto/Makefile
+++ b/security/py-crypto/Makefile
@@ -1,20 +1,33 @@
-# $NetBSD: Makefile,v 1.19 2010/07/24 12:33:19 gdt Exp $
+# $NetBSD: Makefile,v 1.20 2010/12/05 17:13:09 gls Exp $
#
-DISTNAME= pycrypto-2.1.0
-PKGREVISION= 3
-PKGNAME= ${PYPKGPREFIX}-crypto-2.1.0
+DISTNAME= pycrypto-2.3
+PKGNAME= ${PYPKGPREFIX}-crypto-2.3
CATEGORIES= security python
MASTER_SITES= http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/
-# mostly public domain, but a few bits are:
-LICENSE= python-software-foundation
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.dlitz.net/software/pycrypto/
COMMENT= Cryptographic and hash functions for Python
+# mostly public domain, but a few bits are:
+LICENSE= python-software-foundation
+
+CONFLICTS+= py-amkCrypto-[0-9]*
PKG_DESTDIR_SUPPORT= user-destdir
+SUBST_CLASSES+= python
+SUBST_STAGE.python= post-patch
+SUBST_MESSAGE.python= Fix hardcoded paths
+SUBST_FILES.python= lib/Crypto/Util/RFC1751.py
+SUBST_SED.python= -e 's,@@PYTHON@@,${PYTHONBIN},'
+
+SUBST_CLASSES+= libdir
+SUBST_STAGE.libdir= post-patch
+SUBST_MESSAGE.libdir= Fix hardcoded libraries directory paths
+SUBST_FILES.libdir+= setup.py
+SUBST_SED.libdir= -e 's,@@LIBDIR@@,${PREFIX}/lib,'
+
.include "../../devel/gmp/buildlink3.mk"
.include "../../lang/python/distutils.mk"
.include "../../security/openssl/buildlink3.mk"
diff --git a/security/py-crypto/PLIST b/security/py-crypto/PLIST
index be8ea4830fa..8461af47740 100644
--- a/security/py-crypto/PLIST
+++ b/security/py-crypto/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.5 2010/07/24 12:33:19 gdt Exp $
+@comment $NetBSD: PLIST,v 1.6 2010/12/05 17:13:09 gls Exp $
${PYSITELIB}/Crypto/Cipher/AES.so
${PYSITELIB}/Crypto/Cipher/ARC2.so
${PYSITELIB}/Crypto/Cipher/ARC4.so
@@ -56,6 +56,7 @@ ${PYSITELIB}/Crypto/PublicKey/_RSA.pyo
${PYSITELIB}/Crypto/PublicKey/__init__.py
${PYSITELIB}/Crypto/PublicKey/__init__.pyc
${PYSITELIB}/Crypto/PublicKey/__init__.pyo
+${PYSITELIB}/Crypto/PublicKey/_fastmath.so
${PYSITELIB}/Crypto/PublicKey/_slowmath.py
${PYSITELIB}/Crypto/PublicKey/_slowmath.pyc
${PYSITELIB}/Crypto/PublicKey/_slowmath.pyo
@@ -176,6 +177,9 @@ ${PYSITELIB}/Crypto/SelfTest/PublicKey/test_DSA.pyo
${PYSITELIB}/Crypto/SelfTest/PublicKey/test_RSA.py
${PYSITELIB}/Crypto/SelfTest/PublicKey/test_RSA.pyc
${PYSITELIB}/Crypto/SelfTest/PublicKey/test_RSA.pyo
+${PYSITELIB}/Crypto/SelfTest/PublicKey/test_importKey.py
+${PYSITELIB}/Crypto/SelfTest/PublicKey/test_importKey.pyc
+${PYSITELIB}/Crypto/SelfTest/PublicKey/test_importKey.pyo
${PYSITELIB}/Crypto/SelfTest/Random/Fortuna/__init__.py
${PYSITELIB}/Crypto/SelfTest/Random/Fortuna/__init__.pyc
${PYSITELIB}/Crypto/SelfTest/Random/Fortuna/__init__.pyo
@@ -221,6 +225,9 @@ ${PYSITELIB}/Crypto/SelfTest/Util/__init__.pyo
${PYSITELIB}/Crypto/SelfTest/Util/test_Counter.py
${PYSITELIB}/Crypto/SelfTest/Util/test_Counter.pyc
${PYSITELIB}/Crypto/SelfTest/Util/test_Counter.pyo
+${PYSITELIB}/Crypto/SelfTest/Util/test_asn1.py
+${PYSITELIB}/Crypto/SelfTest/Util/test_asn1.pyc
+${PYSITELIB}/Crypto/SelfTest/Util/test_asn1.pyo
${PYSITELIB}/Crypto/SelfTest/Util/test_number.py
${PYSITELIB}/Crypto/SelfTest/Util/test_number.pyc
${PYSITELIB}/Crypto/SelfTest/Util/test_number.pyo
@@ -246,6 +253,9 @@ ${PYSITELIB}/Crypto/Util/_counter.so
${PYSITELIB}/Crypto/Util/_number_new.py
${PYSITELIB}/Crypto/Util/_number_new.pyc
${PYSITELIB}/Crypto/Util/_number_new.pyo
+${PYSITELIB}/Crypto/Util/asn1.py
+${PYSITELIB}/Crypto/Util/asn1.pyc
+${PYSITELIB}/Crypto/Util/asn1.pyo
${PYSITELIB}/Crypto/Util/number.py
${PYSITELIB}/Crypto/Util/number.pyc
${PYSITELIB}/Crypto/Util/number.pyo
diff --git a/security/py-crypto/distinfo b/security/py-crypto/distinfo
index 46f104f457d..adfcce05dee 100644
--- a/security/py-crypto/distinfo
+++ b/security/py-crypto/distinfo
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.4 2010/07/22 19:34:11 gdt Exp $
+$NetBSD: distinfo,v 1.5 2010/12/05 17:13:09 gls Exp $
-SHA1 (pycrypto-2.1.0.tar.gz) = b4baa1b5f349a7e5c497f4c7b4070c3f630519f8
-RMD160 (pycrypto-2.1.0.tar.gz) = 57589935b0aad4bee9008a840fda9b12c8e8c0f5
-Size (pycrypto-2.1.0.tar.gz) = 265388 bytes
-SHA1 (patch-ab) = 3a2839d62e5d7d26cf8128ca0ee34a8e86820ea7
+SHA1 (pycrypto-2.3.tar.gz) = 96b33b77e729893bd0837a09a6aa7a12b5070037
+RMD160 (pycrypto-2.3.tar.gz) = 5b7b15aab3f5e33113ba197a2edd629c72595374
+Size (pycrypto-2.3.tar.gz) = 331476 bytes
+SHA1 (patch-aa) = e486ada26ed3f25f0795c886bc824fecda0cc060
+SHA1 (patch-ab) = 2c72b0e70fdebd2e62aff28284afd919e935de08
+SHA1 (patch-ac) = 34efe262c56619c010879e96cfb8b2ae87bd03af
diff --git a/security/py-crypto/patches/patch-aa b/security/py-crypto/patches/patch-aa
new file mode 100644
index 00000000000..5c91acaa431
--- /dev/null
+++ b/security/py-crypto/patches/patch-aa
@@ -0,0 +1,10 @@
+$NetBSD: patch-aa,v 1.3 2010/12/05 17:13:09 gls Exp $
+
+--- lib/Crypto/Util/RFC1751.py.orig 2010-08-27 04:41:55.000000000 +0000
++++ lib/Crypto/Util/RFC1751.py
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/python
++#!@@PYTHON@@
+ # rfc1751.py : Converts between 128-bit strings and a human-readable
+ # sequence of words, as defined in RFC1751: "A Convention for
+ # Human-Readable 128-bit Keys", by Daniel L. McDonald.
diff --git a/security/py-crypto/patches/patch-ab b/security/py-crypto/patches/patch-ab
index 0411b007613..bf5b09dc5d6 100644
--- a/security/py-crypto/patches/patch-ab
+++ b/security/py-crypto/patches/patch-ab
@@ -1,9 +1,9 @@
-$NetBSD: patch-ab,v 1.3 2010/07/22 19:34:11 gdt Exp $
+$NetBSD: patch-ab,v 1.4 2010/12/05 17:13:09 gls Exp $
Something in the build fails to detect that we have wchar.h. This
change make it build on NetBSD; a better fix is welcome.
---- src/libtom/tomcrypt_pk.h.orig 2009-12-13 20:39:29.000000000 +0000
+--- src/libtom/tomcrypt_pk.h.orig 2010-08-27 04:41:55.000000000 +0000
+++ src/libtom/tomcrypt_pk.h
@@ -495,12 +495,7 @@ int der_length_printable_string(const un
int der_printable_char_encode(int c);
diff --git a/security/py-crypto/patches/patch-ac b/security/py-crypto/patches/patch-ac
new file mode 100644
index 00000000000..70e1091715a
--- /dev/null
+++ b/security/py-crypto/patches/patch-ac
@@ -0,0 +1,13 @@
+$NetBSD: patch-ac,v 1.3 2010/12/05 17:13:09 gls Exp $
+
+--- setup.py.orig 2010-08-27 04:41:55.000000000 +0000
++++ setup.py
+@@ -157,7 +157,7 @@ class PCTBuildExt (build_ext):
+ self.compiler.include_dirs.insert(0, "src/inc-msvc/")
+
+ # Detect libgmp and don't build _fastmath if it is missing.
+- lib_dirs = self.compiler.library_dirs + ['/lib', '/usr/lib']
++ lib_dirs = self.compiler.library_dirs + ['/lib', '/usr/lib', '@@LIBDIR@@']
+ if not (self.compiler.find_library_file(lib_dirs, 'gmp')):
+ print >>sys.stderr, "warning: GMP library not found; Not building Crypto.PublicKey._fastmath."
+ self.__remove_extensions(["Crypto.PublicKey._fastmath"])