1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
http://sourceforge.net/tracker/index.php?func=detail&aid=1849383&group_id=20937&atid=320937
--- pycrypto-2.0.1/Hash/MD5.py
+++ pycrypto-2.0.1/Hash/MD5.py
@@ -13,11 +13,14 @@
digest_size = new().digest_size
except ImportError:
- from md5 import *
+ # cannot import 'md5' from within 'MD5.py',
+ # because on case insensitive filesystems it will find myself.
+ # thus need to do the actual 'import md5' from somewhere else.
+ from extmd5 import *
- import md5
- if hasattr(md5, 'digestsize'):
+ import extmd5
+ if hasattr(extmd5, 'digestsize'):
digest_size = digestsize
del digestsize
- del md5
+ del extmd5
--- pycrypto-2.0.1/Hash/SHA.py
+++ pycrypto-2.0.1/Hash/SHA.py
@@ -13,9 +13,12 @@
digest_size = new().digest_size
except ImportError:
- from sha import *
- import sha
- if hasattr(sha, 'digestsize'):
+ # cannot import 'sha' from within 'SHA.py',
+ # because on case insensitive filesystems it will find myself.
+ # thus need to do the actual 'import sha' from somewhere else.
+ from extsha import *
+ import extsha
+ if hasattr(extsha, 'digestsize'):
digest_size = digestsize
del digestsize
- del sha
+ del extsha
--- pycrypto-2.0.1/Hash/extmd5/__init__.py
+++ pycrypto-2.0.1/Hash/extmd5/__init__.py
@@ -0,0 +1,2 @@
+# see ../MD5.py for why this is done
+from md5 import *
--- pycrypto-2.0.1/Hash/extsha/__init__.py
+++ pycrypto-2.0.1/Hash/extsha/__init__.py
@@ -0,0 +1,2 @@
+# see ../SHA.py for why this is done
+from sha import *
--- pycrypto-2.0.1/setup.py
+++ pycrypto-2.0.1/setup.py
@@ -132,7 +132,7 @@
'url':"http://www.amk.ca/python/code/crypto",
'cmdclass' : {'build_ext':PCTBuildExt},
- 'packages' : ["Crypto", "Crypto.Hash", "Crypto.Cipher", "Crypto.Util",
+ 'packages' : ["Crypto", "Crypto.Hash", "Crypto.Hash.extmd5", "Crypto.Hash.extsha", "Crypto.Cipher", "Crypto.Util",
"Crypto.Protocol", "Crypto.PublicKey"],
'package_dir' : { "Crypto":"." },
# One module is defined here, because build_ext won't be
|