Bug 260469

Summary: [WebCrypto] We lack a check for the Ed25519 priv/pub key pair during the JWK import
Product: WebKit Reporter: Javier Fernandez <jfernandez>
Component: WebCore Misc.Assignee: Javier Fernandez <jfernandez>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 245778    

Description Javier Fernandez 2023-08-21 08:46:36 PDT
When importing an Ed25519 key pair in JWK format we need to ensure that the value in the 'x' and 'd' keys correspond valid key pair. We need to ensure that the public key generated from the value got from the 'd' key matches the value imported from the 'x' value. 

It's worth mentioning that the Web Cryptography API spec doesn't describes explicitly such test, but I think it's implied by the need of ensure the integrity of the import of key pairs in the JWK format. Additionally, there are Web Platform Tests that fail due t the lack of this check in WebKit's implementation of the Ed25519 algorithm.
Comment 1 Javier Fernandez 2023-08-21 09:01:28 PDT
Pull request: https://github.com/WebKit/WebKit/pull/16888
Comment 2 EWS 2023-08-23 07:26:38 PDT
Committed 267184@main (8c9a448b18a4): <https://commits.webkit.org/267184@main>

Reviewed commits have been landed. Closing PR #16888 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-08-23 07:27:14 PDT
<rdar://problem/114322427>