LibCrypto+LibWeb: Support EC compressed point and raw format aliases#8895
Open
tete17 wants to merge 3 commits intoLadybirdBrowser:masterfrom
Open
LibCrypto+LibWeb: Support EC compressed point and raw format aliases#8895tete17 wants to merge 3 commits intoLadybirdBrowser:masterfrom
tete17 wants to merge 3 commits intoLadybirdBrowser:masterfrom
Conversation
Add SECPxxxr1Point::from_compressed() to decompress SEC 1 compressed EC public keys using OpenSSL's EC_POINT_oct2point. Refactor read_ec_public_key() to delegate to SECPxxxr1Point::from_uncompressed and from_compressed, removing duplicated parsing logic. Also add a length validation to from_uncompressed to reject truncated keys. This fixes 48 WPT tests that were previously marked as "Optional Feature Unsupported" for compressed EC point import across ECDSA and ECDH for P-256, P-384, and P-521.
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.
This PR does 3 things:
raw-secretis treated as an alias forraw. For all asymmetric algorithms (ECDSA, ECDH, Ed25519, X25519),raw-publicis treated as an alias forrawSECPxxxr1Point::from_compressed()that uses OpenSSL'sEC_POINT_oct2pointfor decompressionread_ec_public_key()to delegate toSECPxxxr1Point::from_uncompressedandfrom_compressed, removing duplicated parsing logic and adding length validation to reject truncated keysThis fixes 48 WPT tests for compressed EC point import (ECDSA/ECDH across P-256, P-384, P-521) and passes all 20 tests from the
raw_format_aliasesWPT, for a total of 68 new passing WPT tests.