summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-05-16 14:41:26 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-05-16 14:41:26 (GMT)
commit019ff19c3902633384cace7a1e488a851a67444c (patch)
tree86e090b229d263765a2b4f9d7a83c655df25d141 /setup.py
parent26fd8feb5e96276bc99d5682865d34deb190b731 (diff)
downloadcpython-019ff19c3902633384cace7a1e488a851a67444c.zip
cpython-019ff19c3902633384cace7a1e488a851a67444c.tar.gz
cpython-019ff19c3902633384cace7a1e488a851a67444c.tar.bz2
Issue #14693: Under non-Windows platforms, hashlib's fallback modules are always compiled, even if OpenSSL is present at build time.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py25
1 files changed, 11 insertions, 14 deletions
diff --git a/setup.py b/setup.py
index f7a8a65..155156b 100644
--- a/setup.py
+++ b/setup.py
@@ -749,20 +749,17 @@ class PyBuildExt(build_ext):
openssl_ver)
missing.append('_hashlib')
- min_sha2_openssl_ver = 0x00908000
- if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver:
- # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
- exts.append( Extension('_sha256', ['sha256module.c'],
- depends=['hashlib.h']) )
- exts.append( Extension('_sha512', ['sha512module.c'],
- depends=['hashlib.h']) )
-
- if COMPILED_WITH_PYDEBUG or not have_usable_openssl:
- # no openssl at all, use our own md5 and sha1
- exts.append( Extension('_md5', ['md5module.c'],
- depends=['hashlib.h']) )
- exts.append( Extension('_sha1', ['sha1module.c'],
- depends=['hashlib.h']) )
+ # We always compile these even when OpenSSL is available (issue #14693).
+ # It's harmless and the object code is tiny (40-50 KB per module,
+ # only loaded when actually used).
+ exts.append( Extension('_sha256', ['sha256module.c'],
+ depends=['hashlib.h']) )
+ exts.append( Extension('_sha512', ['sha512module.c'],
+ depends=['hashlib.h']) )
+ exts.append( Extension('_md5', ['md5module.c'],
+ depends=['hashlib.h']) )
+ exts.append( Extension('_sha1', ['sha1module.c'],
+ depends=['hashlib.h']) )
# Modules that provide persistent dictionary-like semantics. You will
# probably want to arrange for at least one of them to be available on