diff options
author | Legrandin <gooksankoo@hoiptorrow.mailexpire.com> | 2011-12-22 14:55:40 +0100 |
---|---|---|
committer | Legrandin <gooksankoo@hoiptorrow.mailexpire.com> | 2011-12-22 14:55:40 +0100 |
commit | 114ca5b4d467617489817eee77ed0621665ee362 (patch) | |
tree | 982344b2853ada3508961cf7383a524eb2b4cbbc | |
parent | db6f4555e60b48a3b9ffa232061d460c3c18a06f (diff) | |
parent | 6fedd15136e8de6a98c46cd1d92c6e6cf2790fae (diff) | |
download | pycrypto-114ca5b4d467617489817eee77ed0621665ee362.tar.gz |
Merge from upstream
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Doc/pycrypt.rst | 4 | ||||
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | lib/Crypto/Random/__init__.py | 4 | ||||
-rw-r--r-- | lib/Crypto/SelfTest/Cipher/__init__.py | 20 | ||||
-rw-r--r-- | lib/Crypto/SelfTest/Hash/__init__.py | 20 | ||||
-rw-r--r-- | lib/Crypto/SelfTest/Protocol/__init__.py | 7 | ||||
-rw-r--r-- | lib/Crypto/SelfTest/PublicKey/__init__.py | 6 | ||||
-rw-r--r-- | lib/Crypto/SelfTest/PublicKey/test_importKey.py | 44 | ||||
-rw-r--r-- | lib/Crypto/SelfTest/Random/Fortuna/__init__.py | 6 | ||||
-rw-r--r-- | lib/Crypto/SelfTest/Random/OSRNG/__init__.py | 10 | ||||
-rw-r--r-- | lib/Crypto/SelfTest/Random/__init__.py | 8 | ||||
-rw-r--r-- | lib/Crypto/SelfTest/Util/__init__.py | 6 | ||||
-rw-r--r-- | lib/Crypto/SelfTest/__init__.py | 18 | ||||
-rw-r--r-- | lib/Crypto/__init__.py | 2 | ||||
-rw-r--r-- | setup.py | 13 |
17 files changed, 102 insertions, 78 deletions
@@ -1,3 +1,8 @@ +2.4.1 +===== + * Fix "error: Setup script exited with error: src/config.h: No such file or + directory" when installing via easy_install. (Sebastian Ramacher) + 2.4 === * Python 3 support! (Thorsten E. Behrens, Anders Sundman) diff --git a/Doc/pycrypt.rst b/Doc/pycrypt.rst index 94f2535..9c6d770 100644 --- a/Doc/pycrypt.rst +++ b/Doc/pycrypt.rst @@ -2,7 +2,7 @@ Python Cryptography Toolkit ==================================== -**Version 2.3** +**Version 2.4.1** The Python Cryptography Toolkit describes a package containing various cryptographic modules for the Python programming language. This @@ -692,7 +692,7 @@ An example of using the RSA module to sign a message:: >>> from Crypto.PublicKey import RSA >>> from Crypto import Random >>> rng = Random.new().read - >>> RSAkey = RSA.generate(1024, rng) # This will take a while... + >>> RSAkey = RSA.generate(2048, rng) # This will take a while... >>> hash = MD5.new(plaintext).digest() >>> signature = RSAkey.sign(hash, rng) >>> signature # Print what an RSA sig looks like--you don't really care. diff --git a/MANIFEST.in b/MANIFEST.in index eac077e..4a456fe 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,4 +2,6 @@ include MANIFEST.in include ACKS ChangeLog COPYRIGHT Doc/* TODO graft LEGAL recursive-include src *.h *.c +include src/config.h.in include *.py +include configure configure.ac @@ -62,9 +62,8 @@ using os.fork() Installation ============ -PyCrypto is written and tested using Python version 2.1 through 2.6, -though support for Python 2.1 will be dropped soon. Python 1.5.2 is -not supported. +PyCrypto is written and tested using Python version 2.1 through 3.2. Python +1.5.2 is not supported. The modules are packaged using the Distutils, so you can simply run "python setup.py build" to build the package, and "python setup.py diff --git a/lib/Crypto/Random/__init__.py b/lib/Crypto/Random/__init__.py index 0d0e6f2..659ffee 100644 --- a/lib/Crypto/Random/__init__.py +++ b/lib/Crypto/Random/__init__.py @@ -25,8 +25,8 @@ __revision__ = "$Id$" __all__ = ['new'] -import OSRNG -import _UserFriendlyRNG +from Crypto.Random import OSRNG +from Crypto.Random import _UserFriendlyRNG def new(*args, **kwargs): """Return a file-like object that outputs cryptographically random bytes.""" diff --git a/lib/Crypto/SelfTest/Cipher/__init__.py b/lib/Crypto/SelfTest/Cipher/__init__.py index 4eaf31b..63e9c57 100644 --- a/lib/Crypto/SelfTest/Cipher/__init__.py +++ b/lib/Crypto/SelfTest/Cipher/__init__.py @@ -28,16 +28,16 @@ __revision__ = "$Id$" def get_tests(config={}): tests = [] - import test_AES; tests += test_AES.get_tests(config=config) - import test_ARC2; tests += test_ARC2.get_tests(config=config) - import test_ARC4; tests += test_ARC4.get_tests(config=config) - import test_Blowfish; tests += test_Blowfish.get_tests(config=config) - import test_CAST; tests += test_CAST.get_tests(config=config) - import test_DES3; tests += test_DES3.get_tests(config=config) - import test_DES; tests += test_DES.get_tests(config=config) - import test_XOR; tests += test_XOR.get_tests(config=config) - import test_pkcs1_15; tests += test_pkcs1_15.get_tests(config=config) - import test_pkcs1_oaep; tests += test_pkcs1_oaep.get_tests(config=config) + from Crypto.SelfTest.Cipher import test_AES; tests += test_AES.get_tests(config=config) + from Crypto.SelfTest.Cipher import test_ARC2; tests += test_ARC2.get_tests(config=config) + from Crypto.SelfTest.Cipher import test_ARC4; tests += test_ARC4.get_tests(config=config) + from Crypto.SelfTest.Cipher import test_Blowfish; tests += test_Blowfish.get_tests(config=config) + from Crypto.SelfTest.Cipher import test_CAST; tests += test_CAST.get_tests(config=config) + from Crypto.SelfTest.Cipher import test_DES3; tests += test_DES3.get_tests(config=config) + from Crypto.SelfTest.Cipher import test_DES; tests += test_DES.get_tests(config=config) + from Crypto.SelfTest.Cipher import test_XOR; tests += test_XOR.get_tests(config=config) + from Crypto.SelfTest.Cipher import test_pkcs1_15; tests += test_pkcs1_15.get_tests(config=config) + from Crypto.SelfTest.Cipher import test_pkcs1_oaep; tests += test_pkcs1_oaep.get_tests(config=config) return tests if __name__ == '__main__': diff --git a/lib/Crypto/SelfTest/Hash/__init__.py b/lib/Crypto/SelfTest/Hash/__init__.py index d457519..bb19f9b 100644 --- a/lib/Crypto/SelfTest/Hash/__init__.py +++ b/lib/Crypto/SelfTest/Hash/__init__.py @@ -28,17 +28,17 @@ __revision__ = "$Id$" def get_tests(config={}): tests = [] - import test_HMAC; tests += test_HMAC.get_tests(config=config) - import test_MD2; tests += test_MD2.get_tests(config=config) - import test_MD4; tests += test_MD4.get_tests(config=config) - import test_MD5; tests += test_MD5.get_tests(config=config) - import test_RIPEMD; tests += test_RIPEMD.get_tests(config=config) - import test_SHA; tests += test_SHA.get_tests(config=config) - import test_SHA256; tests += test_SHA256.get_tests(config=config) + from Crypto.SelfTest.Hash import test_HMAC; tests += test_HMAC.get_tests(config=config) + from Crypto.SelfTest.Hash import test_MD2; tests += test_MD2.get_tests(config=config) + from Crypto.SelfTest.Hash import test_MD4; tests += test_MD4.get_tests(config=config) + from Crypto.SelfTest.Hash import test_MD5; tests += test_MD5.get_tests(config=config) + from Crypto.SelfTest.Hash import test_RIPEMD; tests += test_RIPEMD.get_tests(config=config) + from Crypto.SelfTest.Hash import test_SHA; tests += test_SHA.get_tests(config=config) + from Crypto.SelfTest.Hash import test_SHA256; tests += test_SHA256.get_tests(config=config) try: - import test_SHA224; tests += test_SHA224.get_tests(config=config) - import test_SHA384; tests += test_SHA384.get_tests(config=config) - import test_SHA512; tests += test_SHA512.get_tests(config=config) + from Crypto.SelfTest.Hash import test_SHA224; tests += test_SHA224.get_tests(config=config) + from Crypto.SelfTest.Hash import test_SHA384; tests += test_SHA384.get_tests(config=config) + from Crypto.SelfTest.Hash import test_SHA512; tests += test_SHA512.get_tests(config=config) except ImportError: import sys sys.stderr.write("SelfTest: warning: not testing SHA224/SHA384/SHA512 modules (not available)\n") diff --git a/lib/Crypto/SelfTest/Protocol/__init__.py b/lib/Crypto/SelfTest/Protocol/__init__.py index f1726a8..a62c670 100644 --- a/lib/Crypto/SelfTest/Protocol/__init__.py +++ b/lib/Crypto/SelfTest/Protocol/__init__.py @@ -28,10 +28,9 @@ __revision__ = "$Id$" def get_tests(config={}): tests = [] - import test_chaffing; tests += test_chaffing.get_tests(config=config) - import test_rfc1751; tests += test_rfc1751.get_tests(config=config) - import test_KDF; tests += test_KDF.get_tests(config=config) - import test_AllOrNothing; tests += test_AllOrNothing.get_tests(config=config) + from Crypto.SelfTest.Protocol import test_chaffing; tests += test_chaffing.get_tests(config=config) + from Crypto.SelfTest.Protocol import test_rfc1751; tests += test_rfc1751.get_tests(config=config) + from Crypto.SelfTest.Protocol import test_AllOrNothing; tests += test_AllOrNothing.get_tests(config=config) return tests if __name__ == '__main__': diff --git a/lib/Crypto/SelfTest/PublicKey/__init__.py b/lib/Crypto/SelfTest/PublicKey/__init__.py index f29ae51..88a62ea 100644 --- a/lib/Crypto/SelfTest/PublicKey/__init__.py +++ b/lib/Crypto/SelfTest/PublicKey/__init__.py @@ -30,9 +30,9 @@ import os def get_tests(config={}): tests = [] - import test_DSA; tests += test_DSA.get_tests(config=config) - import test_RSA; tests += test_RSA.get_tests(config=config) - import test_importKey; tests += test_importKey.get_tests(config=config) + from Crypto.SelfTest.PublicKey import test_DSA; tests += test_DSA.get_tests(config=config) + from Crypto.SelfTest.PublicKey import test_RSA; tests += test_RSA.get_tests(config=config) + from Crypto.SelfTest.PublicKey import test_importKey; tests += test_importKey.get_tests(config=config) return tests if __name__ == '__main__': diff --git a/lib/Crypto/SelfTest/PublicKey/test_importKey.py b/lib/Crypto/SelfTest/PublicKey/test_importKey.py index ed4d004..9e62fcf 100644 --- a/lib/Crypto/SelfTest/PublicKey/test_importKey.py +++ b/lib/Crypto/SelfTest/PublicKey/test_importKey.py @@ -33,7 +33,7 @@ from Crypto.Util.number import inverse class ImportKeyTests(unittest.TestCase): # 512-bit RSA key generated with openssl - rsaKeyPEM = '''-----BEGIN RSA PRIVATE KEY----- + rsaKeyPEM = u'''-----BEGIN RSA PRIVATE KEY----- MIIBOwIBAAJBAL8eJ5AKoIsjURpcEoGubZMxLD7+kT+TLr7UkvEtFrRhDDKMtuII q19FrL4pUIMymPMSLBn3hJLe30Dw48GQM4UCAwEAAQJACUSDEp8RTe32ftq8IwG8 Wojl5mAd1wFiIOrZ/Uv8b963WJOJiuQcVN29vxU5+My9GPZ7RA3hrDBEAoHUDPrI @@ -44,7 +44,7 @@ n0CnZCJ6IZYqSt0H5N7+Q+2Ro64nuwV/OSQfM6sBwQ== -----END RSA PRIVATE KEY-----''' # As above, but this is actually an unencrypted PKCS#8 key - rsaKeyPEM8 = '''-----BEGIN PRIVATE KEY----- + rsaKeyPEM8 = u'''-----BEGIN PRIVATE KEY----- MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAvx4nkAqgiyNRGlwS ga5tkzEsPv6RP5MuvtSS8S0WtGEMMoy24girX0WsvilQgzKY8xIsGfeEkt7fQPDj wZAzhQIDAQABAkAJRIMSnxFN7fZ+2rwjAbxaiOXmYB3XAWIg6tn9S/xv3rdYk4mK @@ -59,7 +59,7 @@ BX85JB8zqwHB rsaKeyEncryptedPEM=( # With DES and passphrase 'test' - ('test', '''-----BEGIN RSA PRIVATE KEY----- + ('test', u'''-----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-CBC,AF8F9A40BD2FA2FC @@ -74,7 +74,7 @@ dysKznQ6P+IoqML1WxAID4aGRMWka+uArOJ148Rbj9s= "\xAF\x8F\x9A\x40\xBD\x2F\xA2\xFC"), # With Triple-DES and passphrase 'rocking' - ('rocking', '''-----BEGIN RSA PRIVATE KEY----- + ('rocking', u'''-----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,C05D6C07F7FC02F6 @@ -89,7 +89,7 @@ YSxC7qDQIT/RECvV3+oQKEcmpEujn45wAnkTi12BH30= "\xC0\x5D\x6C\x07\xF7\xFC\x02\xF6"), ) - rsaPublicKeyPEM = '''-----BEGIN PUBLIC KEY----- + rsaPublicKeyPEM = u'''-----BEGIN PUBLIC KEY----- MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL8eJ5AKoIsjURpcEoGubZMxLD7+kT+T Lr7UkvEtFrRhDDKMtuIIq19FrL4pUIMymPMSLBn3hJLe30Dw48GQM4UCAwEAAQ== -----END PUBLIC KEY-----''' @@ -161,30 +161,45 @@ Lr7UkvEtFrRhDDKMtuIIq19FrL4pUIMymPMSLBn3hJLe30Dw48GQM4UCAwEAAQ== self.assertEqual(key.n, self.n) self.assertEqual(key.e, self.e) - def testImportKey3(self): - key = self.rsa.importKey(self.rsaKeyPEM) - self.failUnless(key.has_private()) + def testImportKey3unicode(self): + key = RSA.importKey(b(self.rsaKeyPEM)) + self.assertEqual(key.has_private(),True) # assert_ self.assertEqual(key.n, self.n) self.assertEqual(key.e, self.e) self.assertEqual(key.d, self.d) self.assertEqual(key.p, self.p) self.assertEqual(key.q, self.q) - def testImportKey4(self): - key = self.rsa.importKey(self.rsaPublicKeyPEM) - self.failIf(key.has_private()) + def testImportKey3bytes(self): + key = RSA.importKey(b(self.rsaKeyPEM)) + self.assertEqual(key.has_private(),True) # assert_ + self.assertEqual(key.n, self.n) + self.assertEqual(key.e, self.e) + self.assertEqual(key.d, self.d) + self.assertEqual(key.p, self.p) + self.assertEqual(key.q, self.q) + + def testImportKey4unicode(self): + key = RSA.importKey(self.rsaPublicKeyPEM) + self.assertEqual(key.has_private(),False) # failIf + self.assertEqual(key.n, self.n) + self.assertEqual(key.e, self.e) + + def testImportKey4bytes(self): + key = RSA.importKey(self.rsaPublicKeyPEM.encode('ascii')) + self.assertEqual(key.has_private(),False) # failIf self.assertEqual(key.n, self.n) self.assertEqual(key.e, self.e) def testImportKey5(self): """Verifies that the imported key is still a valid RSA pair""" - key = self.rsa.importKey(self.rsaKeyPEM) + key = RSA.importKey(self.rsaKeyPEM) idem = key.encrypt(key.decrypt(b("Test")),0) self.assertEqual(idem[0],b("Test")) def testImportKey6(self): """Verifies that the imported key is still a valid RSA pair""" - key = self.rsa.importKey(self.rsaKeyDER) + key = RSA.importKey(self.rsaKeyDER) idem = key.encrypt(key.decrypt(b("Test")),0) self.assertEqual(idem[0],b("Test")) @@ -221,7 +236,6 @@ Lr7UkvEtFrRhDDKMtuIIq19FrL4pUIMymPMSLBn3hJLe30Dw48GQM4UCAwEAAQ== self.assertEqual(key.p, self.p) self.assertEqual(key.q, self.q) - ### def testExportKey1(self): key = self.rsa.construct([self.n, self.e, self.d, self.p, self.q, self.pInv]) @@ -286,7 +300,7 @@ def get_tests(config={}): from Crypto.PublicKey import _fastmath tests += list_test_cases(ImportKeyTestsFast) except ImportError: - false + pass tests += list_test_cases(ImportKeyTestsSlow) return tests diff --git a/lib/Crypto/SelfTest/Random/Fortuna/__init__.py b/lib/Crypto/SelfTest/Random/Fortuna/__init__.py index bd31e72..81a0e13 100644 --- a/lib/Crypto/SelfTest/Random/Fortuna/__init__.py +++ b/lib/Crypto/SelfTest/Random/Fortuna/__init__.py @@ -30,9 +30,9 @@ import os def get_tests(config={}): tests = [] - import test_FortunaAccumulator; tests += test_FortunaAccumulator.get_tests(config=config) - import test_FortunaGenerator; tests += test_FortunaGenerator.get_tests(config=config) - import test_SHAd256; tests += test_SHAd256.get_tests(config=config) + from Crypto.SelfTest.Random.Fortuna import test_FortunaAccumulator; tests += test_FortunaAccumulator.get_tests(config=config) + from Crypto.SelfTest.Random.Fortuna import test_FortunaGenerator; tests += test_FortunaGenerator.get_tests(config=config) + from Crypto.SelfTest.Random.Fortuna import test_SHAd256; tests += test_SHAd256.get_tests(config=config) return tests if __name__ == '__main__': diff --git a/lib/Crypto/SelfTest/Random/OSRNG/__init__.py b/lib/Crypto/SelfTest/Random/OSRNG/__init__.py index b41bb7d..44b3fa1 100644 --- a/lib/Crypto/SelfTest/Random/OSRNG/__init__.py +++ b/lib/Crypto/SelfTest/Random/OSRNG/__init__.py @@ -31,13 +31,13 @@ import os def get_tests(config={}): tests = [] if os.name == 'nt': - import test_nt; tests += test_nt.get_tests(config=config) - import test_winrandom; tests += test_winrandom.get_tests(config=config) + from Crypto.SelfTest.Random.OSRNG import test_nt; tests += test_nt.get_tests(config=config) + from Crypto.SelfTest.Random.OSRNG import test_winrandom; tests += test_winrandom.get_tests(config=config) elif os.name == 'posix': - import test_posix; tests += test_posix.get_tests(config=config) + from Crypto.SelfTest.Random.OSRNG import test_posix; tests += test_posix.get_tests(config=config) if hasattr(os, 'urandom'): - import test_fallback; tests += test_fallback.get_tests(config=config) - import test_generic; tests += test_generic.get_tests(config=config) + from Crypto.SelfTest.Random.OSRNG import test_fallback; tests += test_fallback.get_tests(config=config) + from Crypto.SelfTest.Random.OSRNG import test_generic; tests += test_generic.get_tests(config=config) return tests if __name__ == '__main__': diff --git a/lib/Crypto/SelfTest/Random/__init__.py b/lib/Crypto/SelfTest/Random/__init__.py index 5dcad2d..48d84ff 100644 --- a/lib/Crypto/SelfTest/Random/__init__.py +++ b/lib/Crypto/SelfTest/Random/__init__.py @@ -28,10 +28,10 @@ __revision__ = "$Id$" def get_tests(config={}): tests = [] - import Fortuna; tests += Fortuna.get_tests(config=config) - import OSRNG; tests += OSRNG.get_tests(config=config) - import test_random; tests += test_random.get_tests(config=config) - import test_rpoolcompat; tests += test_rpoolcompat.get_tests(config=config) + from Crypto.SelfTest.Random import Fortuna; tests += Fortuna.get_tests(config=config) + from Crypto.SelfTest.Random import OSRNG; tests += OSRNG.get_tests(config=config) + from Crypto.SelfTest.Random import test_random; tests += test_random.get_tests(config=config) + from Crypto.SelfTest.Random import test_rpoolcompat; tests += test_rpoolcompat.get_tests(config=config) return tests if __name__ == '__main__': diff --git a/lib/Crypto/SelfTest/Util/__init__.py b/lib/Crypto/SelfTest/Util/__init__.py index e81053f..abd640a 100644 --- a/lib/Crypto/SelfTest/Util/__init__.py +++ b/lib/Crypto/SelfTest/Util/__init__.py @@ -31,9 +31,9 @@ import os def get_tests(config={}): tests = [] if os.name == 'nt': - import test_winrandom; tests += test_winrandom.get_tests(config=config) - import test_number; tests += test_number.get_tests(config=config) - import test_Counter; tests += test_Counter.get_tests(config=config) + from Crypto.SelfTest.Util import test_winrandom; tests += test_winrandom.get_tests(config=config) + from Crypto.SelfTest.Util import test_number; tests += test_number.get_tests(config=config) + from Crypto.SelfTest.Util import test_Counter; tests += test_Counter.get_tests(config=config) return tests if __name__ == '__main__': diff --git a/lib/Crypto/SelfTest/__init__.py b/lib/Crypto/SelfTest/__init__.py index f56cbf9..40b3969 100644 --- a/lib/Crypto/SelfTest/__init__.py +++ b/lib/Crypto/SelfTest/__init__.py @@ -32,7 +32,7 @@ __revision__ = "$Id$" import sys import unittest -import StringIO +from StringIO import StringIO class SelfTestError(Exception): def __init__(self, message, result): @@ -65,7 +65,7 @@ def run(module=None, verbosity=0, stream=None, tests=None, config=None, **kwargs else: raise ValueError("'module' and 'tests' arguments are mutually exclusive") if stream is None: - kwargs['stream'] = StringIO.StringIO() + kwargs['stream'] = StringIO() runner = unittest.TextTestRunner(verbosity=verbosity, **kwargs) result = runner.run(suite) if not result.wasSuccessful(): @@ -76,13 +76,13 @@ def run(module=None, verbosity=0, stream=None, tests=None, config=None, **kwargs def get_tests(config={}): tests = [] - import Cipher; tests += Cipher.get_tests(config=config) - import Hash; tests += Hash.get_tests(config=config) - import Protocol; tests += Protocol.get_tests(config=config) - import PublicKey; tests += PublicKey.get_tests(config=config) - import Random; tests += Random.get_tests(config=config) - import Util; tests += Util.get_tests(config=config) - import Signature; tests += Signature.get_tests(config=config) + from Crypto.SelfTest import Cipher; tests += Cipher.get_tests(config=config) + from Crypto.SelfTest import Hash; tests += Hash.get_tests(config=config) + from Crypto.SelfTest import Protocol; tests += Protocol.get_tests(config=config) + from Crypto.SelfTest import PublicKey; tests += PublicKey.get_tests(config=config) + from Crypto.SelfTest import Random; tests += Random.get_tests(config=config) + from Crypto.SelfTest import Util; tests += Util.get_tests(config=config) + from Crypto.SelfTest import Signature; tests += Signature.get_tests(config=config) return tests if __name__ == '__main__': diff --git a/lib/Crypto/__init__.py b/lib/Crypto/__init__.py index b709859..4d0ef7c 100644 --- a/lib/Crypto/__init__.py +++ b/lib/Crypto/__init__.py @@ -43,7 +43,7 @@ Crypto.Util __all__ = ['Cipher', 'Hash', 'Protocol', 'PublicKey', 'Util', 'Signature'] -__version__ = '2.3' # See also below and setup.py +__version__ = '2.4.1' # See also below and setup.py __revision__ = "$Id$" # New software should look at this instead of at __version__ above. @@ -242,12 +242,17 @@ class PCTBuildExt (build_ext): f.close() return result -class PCTBuild(build): + def run(self): + for cmd_name in self.get_sub_commands(): + self.run_command(cmd_name) + + build_ext.run(self) + def has_configure(self): compiler = new_compiler(compiler=self.compiler) return compiler.compiler_type != 'msvc' - sub_commands = [ ('build_configure', has_configure) ] + build.sub_commands + sub_commands = [ ('build_configure', has_configure) ] + build_ext.sub_commands class PCTBuildConfigure(Command): description = "Generate config.h using ./configure (autoconf)" @@ -333,13 +338,13 @@ class TestCommand(Command): self.announce("running extended self-tests") kw = {'name':"pycrypto", - 'version':"2.3", # See also: lib/Crypto/__init__.py + 'version':"2.4.1", # See also: lib/Crypto/__init__.py 'description':"Cryptographic modules for Python.", 'author':"Dwayne C. Litzenberger", 'author_email':"dlitz@dlitz.net", 'url':"http://www.pycrypto.org/", - 'cmdclass' : {'build': PCTBuild, 'build_configure': PCTBuildConfigure, 'build_ext':PCTBuildExt, 'build_py': PCTBuildPy, 'test': TestCommand }, + 'cmdclass' : {'build_configure': PCTBuildConfigure, 'build_ext': PCTBuildExt, 'build_py': PCTBuildPy, 'test': TestCommand }, 'packages' : ["Crypto", "Crypto.Hash", "Crypto.Cipher", "Crypto.Util", "Crypto.Random", "Crypto.Random.Fortuna", |