-
Notifications
You must be signed in to change notification settings - Fork 848
Move HKDF to OpenSSL 3 interfaces #8909
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
|
Oops, looks like I missed some references in QUICTLS.cc. (Not sure why this didn't cause my local builds to fail.) I'll fix these tomorrow. |
|
Thank you for taking care of the test failure in test_HKDF and also making this progress.
I'm fine with either way. It seems like OPENSSL_VERSION_NUMBER was un-deprecated at some point.
+1. I'd add HKDF_openssl3.cc since almost all the code in HKDF_openssl.cc is ifdef-ed and we already have HKDF_boringssl.cc, but that's just my preference and not a blocker at all.
Sounds reasonable.
Did you see any performance difference between EVP_MAC interface and HMAC interface? I made a similar change on #7447 and decided to use the old interface as long as it's available (even if it's deprecated) because the new interface was slow. According to #8615 the performance issue may be resolved on the latest version, but it'd be great if you could confirm there's no (big) difference between the new and old interfaces. Calling EVP_MAC_CTX_new/free is concerning in terms of memory allocation. |
|
In case it's helpful, here's the Fedora build results: The Rocky (our CentOS replacement for CI) seems to be failing for the same reason: |
|
Yeah, I've already fixed it; working on the other suggested changes now. |
… missing QUIC changes
|
I've reverted the HMAC changes since I have no reason to believe the EVP interface is faster. We can shelf this until the deprecated interfaces go away. I moved the HKDF openssl3 implementation into a separate file as suggested. Switched to using the OPENSSL_VERSION_NUMBER symbol. Watching for build results now... |
|
Sorry about the flapping there; for some reason my test environment is not running all the QUIC tests. Everything is passing now. |
include/tscore/HKDF.h
Outdated
| protected: | ||
| const EVP_MD *_digest = nullptr; | ||
| EVP_PKEY_CTX *_pctx = nullptr; | ||
| const char *_digest = nullptr; |
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.
It seems like only the constructor needs a digest name. Maybe we can remove this member variable.
|
Overall looks good. Just a minor comment on the unnecessary member variable. |
|
Good catch; removed the unnecessary member variable. |
|
cherry pick to 9.2.x needed for fedora 36 |
|
Cherry-picked to v9.2.x |
* Move HKDF and HMACs to openssl 3 interfaces * clang-format changed files * Revert HMAC change, move EVP_KDF to separate implementation file, add missing QUIC changes * switch back to OPENSSL_IS_OPENSSL3 symbol due to conflict with API_COMPAT symbol * Get digest size from name * Remove extraneous HKDF member variable '_digest' (cherry picked from commit 8ca74ee)
* Move HKDF and HMACs to openssl 3 interfaces * clang-format changed files * Revert HMAC change, move EVP_KDF to separate implementation file, add missing QUIC changes * switch back to OPENSSL_IS_OPENSSL3 symbol due to conflict with API_COMPAT symbol * Get digest size from name * Remove extraneous HKDF member variable '_digest' (cherry picked from commit 8ca74ee)
|
Cherry picked to 9.1.x |
* Move HKDF and HMACs to openssl 3 interfaces * clang-format changed files * Revert HMAC change, move EVP_KDF to separate implementation file, add missing QUIC changes * switch back to OPENSSL_IS_OPENSSL3 symbol due to conflict with API_COMPAT symbol * Get digest size from name * Remove extraneous HKDF member variable '_digest' (cherry picked from commit 8ca74ee)
This patch does a few related things to get building successfully with OpenSSL 3.
Adds a new conditional compilation identifier OPENSSL_IS_OPENSSL3 (parallel to OPENSSL_IS_BORINGSSL). I considered using OPENSSL_VERSION_NUMBER instead, but there seems to be precedent for this model -- happy to change.
Modifies tscore/HKDF to accept a char* digest name instead of an EVP_MD* object for compatibility with the new EVP_KDF interface, and updates the other HKDF implementations and HKDF clients.
Provides an EVP_KDF implementation of the HKDF class. EVP_PKEY isn't deprecated yet, but it's slower and currently has a blocking bug.
Moves experimental/access_control/utils to the new EVP_MAC interface; the old HMAC interface is deprecated, and removes test cases using deprecated hashes (MD4, RIPEMD160).
This makes some progress on #7341 .