[proxy] github.com← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public

Conversation

Copy link
Member

tiran commented Apr 9, 2019

The random module now prefers the lean internal _sha512 module over hashlib
for seed(version=2) to optimize import time.

Signed-off-by: Christian Heimes christian@python.org

https://bugs.python.org/issue36559

Copy link
Member

Does it work without OpenSSL?

Copy link
Member

vstinner commented Apr 9, 2019

Travis CI failed:

$ ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST
...
Fixing Python file whitespace ... 1 file:
  Lib/random.py

Copy link
Member

vstinner commented Apr 9, 2019

Does it work without OpenSSL?

Yes, the _sha512 module is unrelated to OpenSSL. Moreover, _sha512 is available if even _hashlib (_hashopenssl.c) is missing. The _sha512 module is available even if OpenSSL is available.

The random module now prefers the lean internal _sha512 module over hashlib
for seed(version=2) to optimize import time.

Signed-off-by: Christian Heimes <christian@python.org>
tiran force-pushed the bpo36559_random_sha512 branch from 161956d to 8f45246 Compare April 9, 2019 17:18
Copy link
Member Author

tiran commented Apr 9, 2019

The _sha512 module contains a full implementation of sha512 and sha384 based on code from libtomcrypt. Python always builds these modules. Some vendors may not deliver the modules, because the code is not FIPS approved crypto. That's why I have included a fallback to hashlib.

rhettinger merged commit d914596 into python:master Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants