-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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: make test-crypto-hash compatible with OpenSSL > 3.4.0 #56160
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56160 +/- ##
==========================================
+ Coverage 88.53% 88.54% +0.01%
==========================================
Files 657 657
Lines 190285 190285
Branches 36535 36534 -1
==========================================
+ Hits 168470 168490 +20
+ Misses 14991 14983 -8
+ Partials 6824 6812 -12 |
test/common/index.js
Outdated
get hasOpenSSL34() { | ||
return hasOpenSSL(3, 4); | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I added hasOpenSSL()
in #53456, the idea was to stop adding new functions for every OpenSSL version to common
, and instead directly call, e.g.hasOpenSSL(3, 4)
in the test.
Can you please rebase to fix the conflict and address Richard's review? Let me know if you'd prefer me to do it instead |
93eabf6
to
4f8bc73
Compare
OpenSSL 3.4 has a breaking change where the outputLength is now mandatory for shake* hash algorithms. openssl/openssl@b911fef
The shake128/shake256 hashing algorithms broke due to an OpenSSL 3.4 incompatible change and now throws an Error.
Now that the holidays are over, done :) |
for (const outputEncoding of ['buffer', 'hex', 'base64', undefined]) { | ||
// Skip failing tests on OpenSSL 3.4.0 | ||
if (method.startsWith("shake")) | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (const outputEncoding of ['buffer', 'hex', 'base64', undefined]) { | |
// Skip failing tests on OpenSSL 3.4.0 | |
if (method.startsWith("shake")) | |
continue; | |
// Skip failing tests on OpenSSL 3.4.0 | |
if (method.startsWith("shake") && common.hasOpenSSL(3, 4)) | |
continue; | |
for (const outputEncoding of ['buffer', 'hex', 'base64', undefined]) { |
OpenSSL 3.4 has a breaking change where the outputLength is now mandatory for shake* hash algorithms.
openssl/openssl@b911fef
This only fixes one of the tree issues with OpenSSL 3.4. and it doesn't fix
crypto.createHash()
which likely should be adjusted to be compatible with the new OpenSSL behaviour but I am unsure how that is done. I assume it should raise an InvalidArgumentError now.Refs: #56159