UPSTREAM PR #30940: Avoid duplicate export of EC key point format#686
Open
loci-dev wants to merge 3 commits into
Open
UPSTREAM PR #30940: Avoid duplicate export of EC key point format#686loci-dev wants to merge 3 commits into
loci-dev wants to merge 3 commits into
Conversation
added 3 commits
April 26, 2026 04:29
The EC point conversion form was stored in two places that could disagree: the EC_KEY's conv_form and the EC_GROUP's asn1_form. Encoders read the key, but provider keygen wrote only the group, so genpkey -pkeyopt point-format:compressed produced keys whose encoded public point was uncompressed. Make the group canonical. Encoders, OSSL_PARAM output, and the EVP_PKEY_get_ec_point_conv_form() legacy fallback all read EC_GROUP_get_point_conversion_form(). EC_KEY_oct2key mirrors the decoded form onto the group, and provider keygen mirrors the group's form onto the key, so the two fields stay aligned. The deprecated EC_KEY_set_conv_form() and EC_KEY_get_conv_form() remain functional for legacy callers. openssl genpkey -pkeyopt point-format:<format> now outputs the specified form.
tls1_check_pkey_comp() only compared the cert's point form to the peer's advertised list, never to our own. If a server held a compressed EC leaf, the peer advertised compressed, and we didn't, the cert-selector picked the leaf anyway and the peer responded with an illegal_parameter alert -- the mismatch only got caught after the cert had already gone out on the wire. Now we also require the cert's form to appear in our own advertised list. The new 33-compressed-spki ssl_new test runs through ten stanzas: both sides advertise compressed (cert selected), either side leaves the option off (server aborts), TLS 1.3 (the option is unused), mixed RSA+EC fallback, and an uncompressed control to confirm we're filtering by point form rather than cert type. This is also our first end-to-end TLS test of compressed EC public keys in certificates, made possible now that genpkey has working support for: -algorithm ec -pkeyopt point-format:compressed
|
Target version: The target version adds 💬 Questions? Tag @loci-dev |
2 tasks
421b135 to
770bf14
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Note
Source pull request: openssl/openssl#30940
See commits for more details. The second fixes a bug in TLS 1.2 certificate selection and exercises the first.
Checklist