diff options
author | Li-Wen Hsu <lwhsu@FreeBSD.org> | 2010-01-01 04:47:56 +0000 |
---|---|---|
committer | Li-Wen Hsu <lwhsu@FreeBSD.org> | 2010-01-01 04:47:56 +0000 |
commit | 86757971bfa147c0e9684d87b364b3577e659e20 (patch) | |
tree | ec4ed3b0d3ceff86e8dbaaae8e8fb7a4a1f0ab15 /security/py-pycrypto/files | |
parent | 7579722329584cf4ff96d337ee632efc4ca7bde8 (diff) | |
download | ports-86757971bfa147c0e9684d87b364b3577e659e20.tar.gz ports-86757971bfa147c0e9684d87b364b3577e659e20.zip |
Notes
Diffstat (limited to 'security/py-pycrypto/files')
-rw-r--r-- | security/py-pycrypto/files/patch-setup.py | 39 | ||||
-rw-r--r-- | security/py-pycrypto/files/patch-src-ARC2.c | 25 | ||||
-rw-r--r-- | security/py-pycrypto/files/python25+.txt | 58 |
3 files changed, 23 insertions, 99 deletions
diff --git a/security/py-pycrypto/files/patch-setup.py b/security/py-pycrypto/files/patch-setup.py index 8c89fdc14df6..d959eedfeb1a 100644 --- a/security/py-pycrypto/files/patch-setup.py +++ b/security/py-pycrypto/files/patch-setup.py @@ -1,20 +1,27 @@ ---- setup.py.orig Sat Aug 14 01:44:47 2004 -+++ setup.py Fri Oct 1 21:21:45 2004 -@@ -116,13 +116,14 @@ - build_ext.build_extensions(self) +--- ./setup.py.orig 2009-12-13 21:39:29.000000000 +0100 ++++ ./setup.py 2009-12-14 16:48:47.000000000 +0100 +@@ -136,6 +136,7 @@ + # especially helps the DES modules. + self.__add_compiler_option("-O3") + self.__add_compiler_option("-fomit-frame-pointer") ++ self.__add_compiler_option("-D_WCHAR_T_DEFINED") + # Don't include debug symbols unless debugging + self.__remove_compiler_option("-g") + if USE_GCOV: +@@ -152,7 +153,7 @@ + self.compiler.include_dirs.insert(0, "src/inc-msvc/") - def detect_modules (self): + # Detect libgmp and don't build _fastmath if it is missing. - lib_dirs = self.compiler.library_dirs + ['/lib', '/usr/lib'] -- inc_dirs = self.compiler.include_dirs + ['/usr/include'] + lib_dirs = self.compiler.library_dirs + ['/lib', '/usr/lib', '%%LOCALBASE%%/lib'] -+ inc_dirs = self.compiler.include_dirs + ['/usr/include', '%%LOCALBASE%%/include'] - exts = [] - if (self.compiler.find_library_file(lib_dirs, 'gmp')): - exts.append(Extension("Crypto.PublicKey._fastmath", -- include_dirs=['src/'], -+ include_dirs=['src/', '%%LOCALBASE%%/include'], - libraries=['gmp'], -+ library_dirs=['%%LOCALBASE%%/lib'], - sources=["src/_fastmath.c"])) - self.extensions += exts + 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"]) +@@ -259,6 +260,7 @@ + Extension("Crypto.PublicKey._fastmath", + include_dirs=['src/'], + libraries=['gmp'], ++ library_dirs=['%%LOCALBASE%%/lib'], + sources=["src/_fastmath.c"]), + # Hash functions diff --git a/security/py-pycrypto/files/patch-src-ARC2.c b/security/py-pycrypto/files/patch-src-ARC2.c deleted file mode 100644 index e4df631c1ce2..000000000000 --- a/security/py-pycrypto/files/patch-src-ARC2.c +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/src/ARC2.c b/src/ARC2.c -index eb61713..35d9151 100644 ---- src/ARC2.c -+++ src/ARC2.c -@@ -11,6 +11,7 @@ - */ - - #include <string.h> -+#include "Python.h" - - #define MODULE_NAME ARC2 - #define BLOCK_SIZE 8 -@@ -144,6 +145,12 @@ block_init(block_state *self, U8 *key, int keylength) - 197,243,219, 71,229,165,156,119, 10,166, 32,104,254,127,193,173 - }; - -+ if ((U32)keylength > sizeof(self->xkey)) { -+ PyErr_SetString(PyExc_ValueError, -+ "ARC2 key length must be less than 128 bytes"); -+ return; -+ } -+ - memcpy(self->xkey, key, keylength); - - /* Phase 1: Expand input key to 128 bytes */ diff --git a/security/py-pycrypto/files/python25+.txt b/security/py-pycrypto/files/python25+.txt deleted file mode 100644 index 7e00448b75a7..000000000000 --- a/security/py-pycrypto/files/python25+.txt +++ /dev/null @@ -1,58 +0,0 @@ ---- Hash/MD5.py.orig 2009-06-19 12:46:41.000000000 +0100 -+++ Hash/MD5.py 2009-06-19 12:50:24.000000000 +0100 -@@ -3,11 +3,20 @@ - - __revision__ = "$Id: MD5.py,v 1.4 2002/07/11 14:31:19 akuchling Exp $" - --from md5 import * -+__all__ = ['new', 'digest_size'] - --import md5 --if hasattr(md5, 'digestsize'): -- digest_size = digestsize -- del digestsize --del md5 - -+try: -+ # The md5 module is deprecated in Python 2.6, so use hashlib when possible. -+ import hashlib -+ def new(data=""): -+ return hashlib.md5(data) -+ digest_size = new().digest_size -+ -+except ImportError: -+ from md5 import * -+ import md5 -+ if hasattr(md5, 'digestsize'): -+ digest_size = digestsize -+ del digestsize -+ del md5 ---- Hash/SHA.py.orig 2009-06-19 12:46:52.000000000 +0100 -+++ Hash/SHA.py 2009-06-19 12:49:49.000000000 +0100 -@@ -3,9 +3,20 @@ - - __revision__ = "$Id: SHA.py,v 1.4 2002/07/11 14:31:19 akuchling Exp $" - --from sha import * --import sha --if hasattr(sha, 'digestsize'): -- digest_size = digestsize -- del digestsize --del sha -+__all__ = ['new', 'digest_size'] -+ -+ -+try: -+ # The md5 module is deprecated in Python 2.6, so use hashlib when possible. -+ import hashlib -+ def new(data=""): -+ return hashlib.sha1(data) -+ digest_size = new().digest_size -+ -+except ImportError: -+ from sha import * -+ import sha -+ if hasattr(sha, 'digestsize'): -+ digest_size = digestsize -+ del digestsize -+ del sha |