This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python 2.5 windows builds should link hashlib with OpenSSL
Type: Stage:
Components: Windows Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: anthonybaxter Nosy List: anthonybaxter, gregory.p.smith, loewis
Priority: normal Keywords:

Created on 2006-08-06 19:38 by gregory.p.smith, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
build_hashlib_with_ssl-01.patch gregory.p.smith, 2006-08-08 07:48 adds _hashlib.pyd to the windows build and uses OpenSSL x86 asm when possible
build_hashlib_with_ssl-02.patch loewis, 2006-08-09 14:34
Messages (5)
msg29457 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2006-08-06 19:38
The Windows builds of Python 2.5 need to be updated to
build and link the hashlib modules with OpenSSL 0.9.8.  

The OpenSSL implementations of the hash algorithms are
*much* faster (often 2-3x) than the fallback C
implementations that python includes for use when
OpenSSL isn't available.

I just tested the python 2.5b3 installer on windows. 
its using the fallback versions rather than OpenSSL:

here's a simple way to check from a running python:

Without OpenSSL:

>>> import hashlib
>>> hashlib.sha1
<built-in function new>

With OpenSSL:

>>> import hashlib
>>> hashlib.sha1
<built-in function openssl_sha1>


(please use openssl 0.9.8; older versions don't include
sha256 and sha512 implementations)
msg29458 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2006-08-08 06:02
Logged In: YES 
user_id=413

i've attached a patch to PCbuild/build_ssl.py that should
build the assembly optimized OpenSSL on windows by default.

Still todo: a _hashlib.vcproj file is needed.  though
wouldn't it be easier for me to just build _hashlib.pyd from
within the _ssl.mak file?
msg29459 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2006-08-08 07:48
Logged In: YES 
user_id=413

attached is a patch that works for me on Win XP with MSVS
2003 (vc++ 7.1):  build_hashlib_with_ssl-01.patch

It does several things:

build_ssl.py  --  this is fixed to use do_masm.bat instead
of a modified 32all.bat to build OpenSSL with x86 asm
optimizations on Win32.  It is also fixed to work when under
a directory tree with spaces in the directory names.

_ssl.mak  --  since both _ssl and _hashlib depend on OpenSSL
it made the most sense for both to be built by the same
makefile.  I added _hashlib's build here.

_ssl.vcproj  --  adds the dependancy on Modules/_hashopenssl.c


Things still TODO - make sure _hashlib.pyd is added to the
MSI installer.
msg29460 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-08-09 14:34
Logged In: YES 
user_id=21627

I changed the patch to support the Win64 build process, and
added packaging support (msi.py). It looks fine to me now.

Anthony, is this ok to apply?
msg29461 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-08-16 13:08
Logged In: YES 
user_id=21627

With Anthony's approval, this is now committed as r51310.
History
Date User Action Args
2022-04-11 14:56:19adminsetgithub: 43786
2006-08-06 19:38:01gregory.p.smithcreate