Repository navigation
Conversation
To compensate the skipped test coverage, add some tests with longer salt.
picnixz
left a comment
There was a problem hiding this comment.
Does it only fail on OpenSSL 4.x? if it's valid for any OpenSSL version, then it's fine to amend the NEWS entry a bit.
Actually, I only reproduced it on one specific version of 4.x, but that is my understanding, yes. |
|
Mmh. That's weird that it's only in OpenSSL 4.x and not in others, because this looks like it means that the salt validation was not done previously. |
|
I'm double checking. |
|
My testing is heavily based on using |
Co-authored-by: Victor Stinner <vstinner@python.org>
| (b'passwordPASSWORDpassword', b'saltSALTsaltSALTsaltSALTsaltSALTsalt', | ||
| 4096, -1), | ||
| (b'pass\0word', b'sa\0lt', 4096, 16), | ||
| (b'password', b'salt'*4, 1, None), |
There was a problem hiding this comment.
| (b'password', b'salt'*4, 1, None), | |
| # FIPS needs salt of at least 128 bits (b'salt'*4 is 128-bit) | |
| (b'password', b'salt'*4, 1, None), |
There was a problem hiding this comment.
Can you add the FIPS guidelines ref here (it's NIST SP 800-132, §5.1), but since the guidelines will be ervisied (well they are under revs since 2023), you can drop the paragraph actually.
| @@ -1236,6 +1236,9 @@ class KDFTests(unittest.TestCase): | |||
| (b'passwordPASSWORDpassword', b'saltSALTsaltSALTsaltSALTsaltSALTsalt', | |||
| 4096, -1), | |||
| (b'pass\0word', b'sa\0lt', 4096, 16), | |||
There was a problem hiding this comment.
It might be interesting to test also this case (null bytes) using b'sa\0lt'*4.
|
On Fedora 45 with OpenSSL 4.0.3 29 Sep 2026, The test pass with |
|
NIST SP 800-132 actually specifies 1000 as iteration counts as well I think and kLen should be 112 (i think dklen is klen in the NIST guidelines), see https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf |
To compensate the skipped test coverage,
add some tests with longer salt.