Bug 1774471
Summary: | Python os.urandom() is not FIPS compliant | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Christian Heimes <cheimes> | ||||||
Component: | python3 | Assignee: | Python Maintainers <python-maint> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Lukáš Zachar <lzachar> | ||||||
Severity: | high | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 8.2 | CC: | abokovoy, cheimes, cstratak, jkejda, mkosek, pviktori, ssorce, torsava | ||||||
Target Milestone: | rc | Flags: | cheimes:
needinfo-
|
||||||
Target Release: | 8.2 | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | python3-3.6.8-23.el8 | Doc Type: | No Doc Update | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2020-04-28 16:08:30 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 1760850 | ||||||||
Attachments: |
|
Description
Christian Heimes
2019-11-20 11:15:30 UTC
Created attachment 1638086 [details]
Experimental patch for Python master
The patch adds RAND_bytes() as preferred RNG source for Python.
A patched Python calls getrandom() three times when OpenSSL initializes its DRBG. There may be more calls under FIPS. os.urandom() does not call getrandom() any more.
$ strace -e getrandom ./python -c "import os; os.urandom(8); os.urandom(8); os.urandom(8)"
getrandom("...", 16, 0) = 16
getrandom("...", 16, 0) = 16
getrandom("...", 16, 0) = 16
Created attachment 1639525 [details] Updated FIPS getrandom patch on top of Petr's FIPS branch https://github.com/encukou/cpython/compare/fips...tiran:fips_getrandom?expand=1 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2020:1764 |