Bug 129127

Summary: JWK export should be padded to 8*n bytes
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: bfulgham, jiewen_tan, rob, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 160883    

Description Alexey Proskuryakov 2014-02-20 16:07:17 PST
As AES-KW can only wrap keys that are 8*n bytes bytes long, wrapping a CryptoKey in JWK format is only possible when the exported key happens to be of that size.

See <https://www.w3.org/Bugs/Public/show_bug.cgi?id=24457>. We should probably wait to see if a particular form of padding gets prescribed.

When done, we should re-add a subtest to crypto/subtle/aes-kw-wrap-unwrap-aes.html that was removed in <http://trac.webkit.org/r163244>.
Comment 1 Radar WebKit Bug Importer 2016-08-15 17:59:19 PDT
<rdar://problem/27858069>
Comment 2 Jiewen Tan 2016-11-07 18:30:57 PST
Per discussion of the W3C thread and the most updated spec:
https://www.w3.org/TR/WebCryptoAPI/#aes-kw-operations, and Editor's draft:
https://w3c.github.io/webcrypto/Overview.html#aes-kw-operations.

This padding restriction becomes a check on the wrapKey operation of AES-KW. Therefore, this bug is obsolete.