-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test test/parallel/test-crypto-oneshot-hash.js fails in OpenSSL 3.4.0 due to breaking changes in OpenSSL #56159
Comments
crypto.hash('shake128', "wefwwfe", "utf-8")
I started looking at the issue too and AFAIU, Also, code as what follows does not make the libraries give an error but the result is erroneous nonetheless:
Thus, the question is whether not passing options should be accepted. Not preventing progress after such code seems like a footgun to me but I'm not sure which part should throw an error ( BTW, if you want to read more about the change, the relevant documentation change in openssl is openssl/openssl@ad3f28c |
OpenSSL 3.4 has intentionally broken EVP_DigestFinal for SHAKE128 and SHAKE256 when OSSL_DIGEST_PARAM_XOFLEN is not set because a) the default length used weakened them from their maximum strength and b) a static length does not fully make sense for XOFs (which SHAKE* are). Unfortunately, while crypto.createHash accepts an option argument that can be something like `{ outputLength: 128 }`, crypto.hash doesn't offer a similar API. Therefore there is little choice but to skip the test completely for shake128 and shake256 on openssl >= 3.4. Refs: nodejs#56159 Refs: openssl/openssl@b911fef Refs: openssl/openssl@ad3f28c
OpenSSL 3.4 has intentionally broken EVP_DigestFinal for SHAKE128 and SHAKE256 when OSSL_DIGEST_PARAM_XOFLEN is not set because a) the default length used weakened them from their maximum strength and b) a static length does not fully make sense for XOFs (which SHAKE* are). Unfortunately, while crypto.createHash accepts an option argument that can be something like `{ outputLength: 128 }`, crypto.hash doesn't offer a similar API. Therefore there is little choice but to skip the test completely for shake128 and shake256 on openssl >= 3.4. Fixes: nodejs#56159 Refs: openssl/openssl@b911fef Refs: openssl/openssl@ad3f28c
Version
23.3.0 and main
Platform
Subsystem
crypto
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
100%
What is the expected behavior? Why is that the expected behavior?
Hashing does not throw an Error
What do you see instead?
Additional information
This is due to a breaking change in OpenSSL 3.4.0 which makes providing an output length mandatory.
See also, how this is completely broken.
Further writeup available here.
The text was updated successfully, but these errors were encountered: