Bug 227810

Summary: [WebCrypto] deriveBits() incorrectly throws for PBKDF2 algorithm when the password is empty
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, darin, ews-watchlist, ggaren, jiewen_tan, katherine_cheney, sam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2021-07-08 12:43:29 PDT
deriveBits() incorrectly throws for PBKDF2 algorithm when the password is empty.

This is causing Safari to fail subtests in the following WPT test:
- https://wpt.live/WebCryptoAPI/derive_bits_keys/pbkdf2.https.any.html?5001-6000

Empty passwords are supported by both Chrome and Firefox.
Comment 1 Chris Dumez 2021-07-08 12:48:51 PDT
Created attachment 433155 [details]
Patch
Comment 2 Chris Dumez 2021-07-09 09:14:15 PDT
I know the patch is over 900k but the code change is actually 3 lines. The rest is tests rebaselines as this causes a LOT of subtests to start passing :)
Comment 3 Yusuke Suzuki 2021-07-09 09:56:55 PDT
Comment on attachment 433155 [details]
Patch

r=me
Comment 4 EWS 2021-07-09 10:33:02 PDT
Committed r279788 (239555@main): <https://commits.webkit.org/239555@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 433155 [details].
Comment 5 Radar WebKit Bug Importer 2021-07-09 10:34:19 PDT
<rdar://problem/80383544>