-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Do not set the salt or info if they are NULL for OpenSSL HKDF. #114864
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
Conversation
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.
Pull Request Overview
This PR updates the HKDF implementation to no longer set a NULL salt or info parameter in order to comply with OpenSSL 3.x behavior.
- Conditionally includes the salt and info parameters only when they are non-null and have a non-zero length.
- Updates the construction of the OSSL_PARAM array accordingly.
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones |
/backport to release/9.0-staging |
Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/14581934220 |
OpenSSL 3.x has introduced a change that stops allowing HKDF's salt to be set to
NULL
in openssl/openssl#27305.This breaks our HKDF implementation which sets a NULL salt and info, depending on the mode.
This broke plenty of existing tests with failures like:
In this case, we no longer set the info or salt if they are NULL, and tests are green again.
This was found in a nightly run against OpenSSL 3.5. https://github.com/vcsjones/runtime-ci/actions/runs/14574054040/job/40876380622
Fixes vcsjones/runtime-ci#5