You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ValueError: [Provider routines] invalid salt length in test_hashlibtest_pbkdf2_hmac_c on FIPS w/ OpenSSL 4.0.3 #161739
$ OPENSSL_FORCE_FIPS_MODE=1 python3.16 -m test test_hashlib # or python3.15
Using random seed: 3310403751
0:00:00 load avg: 6.69 mem: 20.6 MiB Run 1 test sequentially in a single process
0:00:00 load avg: 6.69 mem: 20.6 MiB [1/1] test_hashlib
test test_hashlib failed -- Traceback (most recent call last):
File "/usr/lib64/python3.16/test/test_hashlib.py", line 1330, in test_pbkdf2_hmac_c
self._test_pbkdf2_hmac(openssl_hashlib.pbkdf2_hmac, openssl_md_meth_names)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.16/test/test_hashlib.py", line 1288, in _test_pbkdf2_hmac
out = pbkdf2(digest_name, password, salt, rounds, dklen)
ValueError: [Provider routines] invalid salt length
0:00:01 load avg: 6.69 mem: 42.6 MiB [1/1/1] test_hashlib failed (1 error)
== Tests result: FAILURE ==
1 test failed:
test_hashlib
Total duration: 1.1 sec
Total tests: run=94 skipped=20
Total test files: run=1/1 failed=1
Result: FAILURE
Yeah I think so. Or just change the salt to something longer if this doesn't slow the tests too much. But some tests might exercise very small salts maybe.
Yeah official test vectors must be skipped for that. I'd appreciate if the fix uses a decorator-approach or some self.pbkdf2_hmac_check_fips_compatibility(salt)
Activity
hroncok commentedon Nov 10, 2026
I can reproduce from main, 4575fb9
picnixz commentedon Nov 10, 2026
FIPS builds are really a pain to maintain in tests. I'm assuming it's because we are using either a too small value or something like that?
hroncok commentedon Nov 10, 2026
https://nukib.gov.cz/download/publications_en/Minimum%20Requirements%20for%20Cryptographic%20Algorithms.pdf
Sounds plausible :)
hroncok commentedon Nov 10, 2026
I suppose keeping the tests, adding:
and possibly adding a few more with longer salt?
picnixz commentedon Nov 10, 2026
Yeah I think so. Or just change the salt to something longer if this doesn't slow the tests too much. But some tests might exercise very small salts maybe.
hroncok commentedon Nov 10, 2026
hroncok commentedon Nov 10, 2026
Some of the tests say official test vectors from RFC 6070 so I don't want to change them
picnixz commentedon Nov 10, 2026
Yeah official test vectors must be skipped for that. I'd appreciate if the fix uses a decorator-approach or some
self.pbkdf2_hmac_check_fips_compatibility(salt)fixup! pythonGH-161739: Don't test PBKDF2 HMAC on FIPS with len(salt)…