cpython icon indicating copy to clipboard operation
cpython copied to clipboard

[3.10] gh-95231: Disable md5 & crypt modules if FIPS is enabled (GH-94742)

Open miss-islington opened this issue 2 years ago • 4 comments

If kernel fips is enabled, we get permission error upon doing import crypt. So, if kernel fips is enabled, disable the unallowed hashing methods.

Python 3.9.1 (default, May 10 2022, 11:36:26) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import crypt Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.9/crypt.py", line 117, in _add_method('MD5', '1', 8, 34) File "/usr/lib/python3.9/crypt.py", line 94, in _add_method result = crypt('', salt) File "/usr/lib/python3.9/crypt.py", line 82, in crypt return _crypt.crypt(word, salt) PermissionError: [Errno 1] Operation not permitted

Signed-off-by: Shreenidhi Shedi [email protected] (cherry picked from commit 2fa03b1b0708d5d74630c351ec9abd2aac7550da)

Co-authored-by: Shreenidhi Shedi [email protected]

  • Issue: gh-95231

miss-islington avatar Aug 15 '22 14:08 miss-islington

Status check is done, and it's a success ✅ .

miss-islington avatar Aug 15 '22 14:08 miss-islington

Status check is done, and it's a success ✅ .

miss-islington avatar Aug 15 '22 14:08 miss-islington

Status check is done, and it's a success ✅ .

miss-islington avatar Aug 15 '22 14:08 miss-islington

Status check is done, and it's a success ✅ .

miss-islington avatar Aug 15 '22 15:08 miss-islington