- security update of py-crypto to 2.6

Fixes  CVE-2012-2417, PyCrypto <= 2.5 insecure ElGamal key generation.

ok mpi@ (MAINTAINER)
This commit is contained in:
jasper 2012-05-25 12:13:01 +00:00
parent ceab43ba83
commit 13607ba6bc
11 changed files with 112 additions and 80 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.25 2012/02/17 09:32:18 mpi Exp $
# $OpenBSD: Makefile,v 1.26 2012/05/25 12:13:01 jasper Exp $
SHARED_ONLY = Yes
COMMENT = cryptographic tools for Python
MODPY_EGG_VERSION = 2.5
MODPY_EGG_VERSION = 2.6
DISTNAME = pycrypto-${MODPY_EGG_VERSION}
PKGNAME = py-crypto-${MODPY_EGG_VERSION}
CATEGORIES = security devel
@ -31,7 +31,7 @@ LIB_DEPENDS = ${MODPY_LIB_DEPENDS} \
WANTLIB = ${MODPY_WANTLIB} gmp
# XXX Don't set CONFIGURE_STYLE=simple otherwise python.port.mk will
# not define do-build and do-install
# not define do-build and do-install
CONFIGURE_ARGS = CFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
CFLAGS += -I${LOCALBASE}/include

View File

@ -1,5 +1,5 @@
MD5 (pycrypto-2.5.tar.gz) = eD5F1KGjCeA6s3iwD5eykQ==
RMD160 (pycrypto-2.5.tar.gz) = EvgUt8XohCqmG/KMXod7ukQz/b4=
SHA1 (pycrypto-2.5.tar.gz) = H+UHEuB3a0WQD4AyNXIBI5Ijq34=
SHA256 (pycrypto-2.5.tar.gz) = 6VCngYTip978z11F4MKcHp7espmEQz8NEQoh6WMeON4=
SIZE (pycrypto-2.5.tar.gz) = 426802
MD5 (pycrypto-2.6.tar.gz) = iNrQonDR/oOjngRnpmoiuw==
RMD160 (pycrypto-2.6.tar.gz) = V4K1KdWfKmKVFgf9r6pDSuoT7go=
SHA1 (pycrypto-2.6.tar.gz) = wX5BqAs/vy7k6PLYu54oxdCLu4Q=
SHA256 (pycrypto-2.6.tar.gz) = cpPJ1+ivLkSoL4brnDsFiID0vMiEvzrWyKNLZJhu3eg=
SIZE (pycrypto-2.6.tar.gz) = 443445

View File

@ -1,16 +1,21 @@
$OpenBSD: patch-lib_Crypto_Cypher___init___py,v 1.4 2012/02/17 09:32:18 mpi Exp $
--- lib/Crypto/Cipher/__init__.py.orig Fri Jan 13 15:57:33 2012
+++ lib/Crypto/Cipher/__init__.py Wed Feb 8 17:21:20 2012
$OpenBSD: patch-lib_Crypto_Cypher___init___py,v 1.5 2012/05/25 12:13:01 jasper Exp $
--- lib/Crypto/Cipher/__init__.py.orig Fri May 25 09:15:59 2012
+++ lib/Crypto/Cipher/__init__.py Fri May 25 09:16:18 2012
@@ -40,7 +40,6 @@ standard and has undergone a fair bit of examination.
Module name Description
====================== ====================
Crypto.Cipher.AES Advanced Encryption Standard
-Crypto.Cipher.ARC2 Alleged RC2
Crypto.Cipher.ARC4 Alleged RC4
Crypto.Cipher.Blowfish Blowfish
Crypto.Cipher.CAST CAST
@@ -71,7 +70,7 @@ Crypto.Cipher.PKCS1_OAEP PKCS#1 OAEP encryption, ba
:undocumented: __revision__, __package__
Module name Type Description
======================== ======= ========================
`Crypto.Cipher.AES` Block Advanced Encryption Standard
-`Crypto.Cipher.ARC2` Block Alleged RC2
`Crypto.Cipher.ARC4` Stream Alleged RC4
`Crypto.Cipher.Blowfish` Block Blowfish
`Crypto.Cipher.CAST` Block CAST
@@ -68,11 +67,11 @@ Module name Description
`Crypto.Cipher.PKCS1_OAEP` PKCS#1 OAEP encryption, based on RSA key pairs
========================== =======================
-:undocumented: __revision__, __package__, _AES, _ARC2, _ARC4, _Blowfish
+:undocumented: __revision__, __package__, _AES, _ARC4, _Blowfish
_CAST, _DES, _DES3, _XOR
"""
-__all__ = ['AES', 'ARC2', 'ARC4',

View File

@ -1,19 +1,21 @@
$OpenBSD: patch-lib_Crypto_Hash___init___py,v 1.4 2012/02/17 09:32:18 mpi Exp $
--- lib/Crypto/Hash/__init__.py.orig Fri Jan 13 15:57:33 2012
+++ lib/Crypto/Hash/__init__.py Wed Feb 8 17:27:41 2012
@@ -34,8 +34,6 @@ Submodules:
Crypto.Hash.HMAC
RFC 2104. Keyed-Hashing for Message Authentication.
-Crypto.Hash.MD2
- RFC1319. Rivest's Message Digest algorithm, with a 128 bit digest. This algorithm is both slow and insecure.
Crypto.Hash.MD4
RFC1320. Rivest's Message Digest algorithm, with a 128 bit digest. This algorithm is insecure.
Crypto.Hash.MD5
@@ -55,7 +53,7 @@ Crypto.Hash.SHA512
"""
-__all__ = ['HMAC', 'MD2', 'MD4', 'MD5', 'RIPEMD', 'SHA',
+__all__ = ['HMAC', 'MD4', 'MD5', 'RIPEMD', 'SHA',
'SHA224', 'SHA256', 'SHA384', 'SHA512']
$OpenBSD: patch-lib_Crypto_Hash___init___py,v 1.5 2012/05/25 12:13:01 jasper Exp $
(Patch with reduced context as otherwise $Id: patch-lib_Crypto_Hash___init___py,v 1.5 2012/05/25 12:13:01 jasper Exp $ would get expanded.)
*** lib/Crypto/Hash/__init__.py.orig Thu May 24 14:55:30 2012
--- lib/Crypto/Hash/__init__.py Fri May 25 14:09:50 2012
*************** The hashing modules here all support the interface des
*** 48,53 ****
! :undocumented: _MD2, _MD4, _RIPEMD160, _SHA224, _SHA256, _SHA384, _SHA512
"""
! __all__ = ['HMAC', 'MD2', 'MD4', 'MD5', 'RIPEMD', 'SHA',
'SHA224', 'SHA256', 'SHA384', 'SHA512']
--- 48,53 ----
! :undocumented: _MD4, _RIPEMD160, _SHA224, _SHA256, _SHA384, _SHA512
"""
! __all__ = ['HMAC', 'MD4', 'MD5', 'RIPEMD', 'SHA',
'SHA224', 'SHA256', 'SHA384', 'SHA512']

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-lib_Crypto_SelfTest_Cipher___init___py,v 1.4 2012/02/17 09:32:18 mpi Exp $
--- lib/Crypto/SelfTest/Cipher/__init__.py.orig Fri Jan 13 15:57:33 2012
+++ lib/Crypto/SelfTest/Cipher/__init__.py Wed Feb 8 17:21:20 2012
@@ -29,7 +29,6 @@
$OpenBSD: patch-lib_Crypto_SelfTest_Cipher___init___py,v 1.5 2012/05/25 12:13:01 jasper Exp $
--- lib/Crypto/SelfTest/Cipher/__init__.py.orig Thu May 24 14:55:30 2012
+++ lib/Crypto/SelfTest/Cipher/__init__.py Fri May 25 09:16:28 2012
@@ -29,7 +29,6 @@ __revision__ = "$Id: patch-lib_Crypto_SelfTest_Cipher___init___py,v 1.5 2012/05/25 12:13:01 jasper Exp $"
def get_tests(config={}):
tests = []
from Crypto.SelfTest.Cipher import test_AES; tests += test_AES.get_tests(config=config)

View File

@ -1,6 +1,7 @@
--- lib/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py.orig Wed Feb 15 17:16:24 2012
+++ lib/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py Wed Feb 15 17:17:29 2012
@@ -31,7 +31,7 @@
$OpenBSD: patch-lib_Crypto_SelfTest_Cipher_test_pkcs1_oaep_py,v 1.2 2012/05/25 12:13:01 jasper Exp $
--- lib/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py.orig Thu May 24 14:55:30 2012
+++ lib/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py Fri May 25 09:16:28 2012
@@ -31,7 +31,7 @@ from Crypto.SelfTest.st_common import list_test_cases,
from Crypto.Util.py3compat import *
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP as PKCS
@ -9,7 +10,7 @@
from Crypto import Random
def rws(t):
@@ -326,7 +326,7 @@
@@ -326,7 +326,7 @@ class PKCS1_OAEP_Tests(unittest.TestCase):
asked += N
return self.rng(N)
# Verify that OAEP is friendly to all hashes

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-lib_Crypto_SelfTest_Hash___init__py,v 1.4 2012/02/17 09:32:18 mpi Exp $
--- lib/Crypto/SelfTest/Hash/__init__.py.orig Sat Oct 22 21:06:15 2011
+++ lib/Crypto/SelfTest/Hash/__init__.py Wed Feb 8 17:21:20 2012
@@ -29,7 +29,6 @@
$OpenBSD: patch-lib_Crypto_SelfTest_Hash___init__py,v 1.5 2012/05/25 12:13:01 jasper Exp $
--- lib/Crypto/SelfTest/Hash/__init__.py.orig Thu May 24 14:55:30 2012
+++ lib/Crypto/SelfTest/Hash/__init__.py Fri May 25 09:16:28 2012
@@ -29,7 +29,6 @@ __revision__ = "$Id: patch-lib_Crypto_SelfTest_Hash___init__py,v 1.5 2012/05/25 12:13:01 jasper Exp $"
def get_tests(config={}):
tests = []
from Crypto.SelfTest.Hash import test_HMAC; tests += test_HMAC.get_tests(config=config)

View File

@ -1,6 +1,7 @@
--- lib/Crypto/SelfTest/Signature/test_pkcs1_15.py.orig Wed Feb 15 17:18:43 2012
+++ lib/Crypto/SelfTest/Signature/test_pkcs1_15.py Wed Feb 15 17:22:43 2012
@@ -65,45 +65,6 @@
$OpenBSD: patch-lib_Crypto_SelfTest_Signature_test_pkcs1_15_py,v 1.2 2012/05/25 12:13:01 jasper Exp $
--- lib/Crypto/SelfTest/Signature/test_pkcs1_15.py.orig Thu May 24 14:55:30 2012
+++ lib/Crypto/SelfTest/Signature/test_pkcs1_15.py Fri May 25 09:16:28 2012
@@ -65,45 +65,6 @@ class PKCS1_15_Tests(unittest.TestCase):
_testData = (
#
@ -46,7 +47,7 @@
# RSA keypair generated with openssl
#
(
@@ -197,7 +158,7 @@
@@ -197,7 +158,7 @@ class PKCS1_15_Tests(unittest.TestCase):
rng = Random.new().read
key = RSA.generate(1024, rng)

View File

@ -1,6 +1,7 @@
--- lib/Crypto/SelfTest/Signature/test_pkcs1_pss.py.orig Wed Feb 15 17:24:43 2012
+++ lib/Crypto/SelfTest/Signature/test_pkcs1_pss.py Wed Feb 15 17:25:08 2012
@@ -394,7 +394,7 @@
$OpenBSD: patch-lib_Crypto_SelfTest_Signature_test_pkcs1_pss_py,v 1.2 2012/05/25 12:13:01 jasper Exp $
--- lib/Crypto/SelfTest/Signature/test_pkcs1_pss.py.orig Thu May 24 14:55:30 2012
+++ lib/Crypto/SelfTest/Signature/test_pkcs1_pss.py Fri May 25 09:16:28 2012
@@ -394,7 +394,7 @@ class PKCS1_PSS_Tests(unittest.TestCase):
return bchr(0x00)*maskLen
# Verify that PSS is friendly to all ciphers

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-setup_py,v 1.8 2012/02/17 09:32:18 mpi Exp $
--- setup.py.orig Fri Jan 13 18:21:31 2012
+++ setup.py Wed Feb 8 17:26:19 2012
@@ -128,15 +128,14 @@ class PCTBuildExt (build_ext):
$OpenBSD: patch-setup_py,v 1.9 2012/05/25 12:13:01 jasper Exp $
--- setup.py.orig Fri May 25 09:13:48 2012
+++ setup.py Fri May 25 09:14:53 2012
@@ -132,15 +132,14 @@ class PCTBuildExt (build_ext):
# the libtomcrypt code.
self.__add_compiler_option("-O")
else:
@ -20,7 +20,7 @@ $OpenBSD: patch-setup_py,v 1.8 2012/02/17 09:32:18 mpi Exp $
if USE_GCOV:
self.__add_compiler_option("-fprofile-arcs")
self.__add_compiler_option("-ftest-coverage")
@@ -371,9 +370,6 @@ kw = {'name':"pycrypto",
@@ -375,9 +374,6 @@ kw = {'name':"pycrypto",
sources=["src/_fastmath.c"]),
# Hash functions
@ -30,17 +30,17 @@ $OpenBSD: patch-setup_py,v 1.8 2012/02/17 09:32:18 mpi Exp $
Extension("Crypto.Hash._MD4",
include_dirs=['src/'],
sources=["src/MD4.c"]),
@@ -398,9 +394,10 @@ kw = {'name':"pycrypto",
Extension("Crypto.Cipher.AES",
@@ -402,9 +398,10 @@ kw = {'name':"pycrypto",
Extension("Crypto.Cipher._AES",
include_dirs=['src/'],
sources=["src/AES.c"]),
- Extension("Crypto.Cipher.ARC2",
- Extension("Crypto.Cipher._ARC2",
- include_dirs=['src/'],
- sources=["src/ARC2.c"]),
+# Patented
+# Extension("Crypto.Cipher.ARC2",
+# Extension("Crypto.Cipher._ARC2",
+# include_dirs=['src/'],
+# sources=["src/ARC2.c"]),
Extension("Crypto.Cipher.Blowfish",
Extension("Crypto.Cipher._Blowfish",
include_dirs=['src/'],
sources=["src/Blowfish.c"]),

View File

@ -1,20 +1,38 @@
@comment $OpenBSD: PLIST,v 1.9 2012/02/17 09:32:18 mpi Exp $
@comment $OpenBSD: PLIST,v 1.10 2012/05/25 12:13:01 jasper Exp $
!%%python3%%
lib/python${MODPY_VERSION}/site-packages/Crypto/
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/AES.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/ARC4.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/Blowfish.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/CAST.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/DES.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/DES3.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/AES.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/AES.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/ARC2.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/ARC2.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/ARC4.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/ARC4.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/Blowfish.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/Blowfish.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/CAST.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/CAST.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/DES.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/DES.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/DES3.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/DES3.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/PKCS1_OAEP.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/PKCS1_OAEP.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/PKCS1_v1_5.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/PKCS1_v1_5.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/XOR.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/XOR.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/XOR.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/_AES.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/_ARC4.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/_Blowfish.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/_CAST.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/_DES.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/_DES3.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/_XOR.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/__init__.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/__init__.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/blockalgo.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Cipher/blockalgo.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Hash/
lib/python${MODPY_VERSION}/site-packages/Crypto/Hash/HMAC.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Hash/HMAC.pyc
@ -44,6 +62,8 @@ lib/python${MODPY_VERSION}/site-packages/Crypto/Hash/_SHA384.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Hash/_SHA512.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Hash/__init__.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Hash/__init__.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Hash/hashalgo.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Hash/hashalgo.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Protocol/
lib/python${MODPY_VERSION}/site-packages/Crypto/Protocol/AllOrNothing.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Protocol/AllOrNothing.pyc
@ -71,8 +91,6 @@ lib/python${MODPY_VERSION}/site-packages/Crypto/PublicKey/_slowmath.py
lib/python${MODPY_VERSION}/site-packages/Crypto/PublicKey/_slowmath.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/PublicKey/pubkey.py
lib/python${MODPY_VERSION}/site-packages/Crypto/PublicKey/pubkey.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/PublicKey/qNEW.py
lib/python${MODPY_VERSION}/site-packages/Crypto/PublicKey/qNEW.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Random/
lib/python${MODPY_VERSION}/site-packages/Crypto/Random/Fortuna/
lib/python${MODPY_VERSION}/site-packages/Crypto/Random/Fortuna/FortunaAccumulator.py
@ -88,6 +106,8 @@ lib/python${MODPY_VERSION}/site-packages/Crypto/Random/OSRNG/__init__.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Random/OSRNG/__init__.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Random/OSRNG/fallback.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Random/OSRNG/fallback.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Random/OSRNG/nt.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Random/OSRNG/nt.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Random/OSRNG/posix.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Random/OSRNG/posix.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Random/OSRNG/rng_base.py
@ -161,6 +181,8 @@ lib/python${MODPY_VERSION}/site-packages/Crypto/SelfTest/PublicKey/__init__.py
lib/python${MODPY_VERSION}/site-packages/Crypto/SelfTest/PublicKey/__init__.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/SelfTest/PublicKey/test_DSA.py
lib/python${MODPY_VERSION}/site-packages/Crypto/SelfTest/PublicKey/test_DSA.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/SelfTest/PublicKey/test_ElGamal.py
lib/python${MODPY_VERSION}/site-packages/Crypto/SelfTest/PublicKey/test_ElGamal.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/SelfTest/PublicKey/test_RSA.py
lib/python${MODPY_VERSION}/site-packages/Crypto/SelfTest/PublicKey/test_RSA.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/SelfTest/PublicKey/test_importKey.py
@ -237,6 +259,8 @@ lib/python${MODPY_VERSION}/site-packages/Crypto/Util/asn1.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Util/asn1.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Util/number.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Util/number.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Util/py21compat.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Util/py21compat.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Util/py3compat.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Util/py3compat.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Util/randpool.py
@ -244,8 +268,6 @@ lib/python${MODPY_VERSION}/site-packages/Crypto/Util/randpool.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Util/strxor.so
lib/python${MODPY_VERSION}/site-packages/Crypto/Util/winrandom.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Util/winrandom.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/Util/wrapper.py
lib/python${MODPY_VERSION}/site-packages/Crypto/Util/wrapper.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/__init__.py
lib/python${MODPY_VERSION}/site-packages/Crypto/__init__.pyc
lib/python${MODPY_VERSION}/site-packages/Crypto/pct_warnings.py