WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 170636
[WebCrypto] Support HKDF
https://bugs.webkit.org/show_bug.cgi?id=170636
Summary
[WebCrypto] Support HKDF
Jiewen Tan
Reported
2017-04-07 19:27:47 PDT
WebCrypto should support HKDF as being specified in:
https://www.w3.org/TR/WebCryptoAPI/#hkdf
.
Attachments
Patch
(3.05 MB, patch)
2017-04-07 19:37 PDT
,
Jiewen Tan
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Jiewen Tan
Comment 1
2017-04-07 19:28:18 PDT
<
rdar://problem/23539827
>
Jiewen Tan
Comment 2
2017-04-07 19:37:13 PDT
Created
attachment 306563
[details]
Patch
Jiewen Tan
Comment 3
2017-04-07 19:37:44 PDT
(In reply to Jiewen Tan from
comment #2
)
> Created
attachment 306563
[details]
> Patch
The patch is huge because of W3C tests rebasing.
Build Bot
Comment 4
2017-04-07 19:40:05 PDT
Attachment 306563
[details]
did not pass style-queue: ERROR: Source/WebCore/crypto/CryptoAlgorithmIdentifier.h:53: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/bindings/js/SerializedScriptValue.cpp:241: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] Total errors found: 2 in 46 files If any of these errors are false positives, please file a bug against check-webkit-style.
Brent Fulgham
Comment 5
2017-04-12 21:19:35 PDT
Comment on
attachment 306563
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=306563&action=review
Looks good. Can you please confirm the failure are expected? Are they dependent on other unfinished work?
> LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker-expected.txt:5 > +FAIL Derived key of type name: AES-CBC length: 128 using short derivedKey, normal salt, SHA-384, with normal info with bad hash name SHA384 assert_equals: deriveKey with bad hash name correctly threw NotSupportedError: Member HkdfParams.info is required and must be an instance of BufferSource expected "NotSupportedError" but got "TypeError"
Is this expected?
> LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker-expected.txt:9 > +FAIL Derived key of type name: AES-CBC length: 192 using short derivedKey, normal salt, SHA-384, with normal info with bad hash name SHA384 assert_equals: deriveKey with bad hash name correctly threw NotSupportedError: Member HkdfParams.info is required and must be an instance of BufferSource expected "NotSupportedError" but got "TypeError"
Ditto all the other instances of these...
> LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker-expected.txt:623 > +FAIL Derived key of type name: AES-CBC length: 128 using short derivedKey, empty salt, SHA-384, with normal info with bad hash name SHA384 assert_equals: deriveKey with bad hash name correctly threw NotSupportedError: Member HkdfParams.info is required and must be an instance of BufferSource expected "NotSupportedError" but got "TypeError"
Ditto...
> LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker-expected.txt:1241 > +FAIL Derived key of type name: AES-CBC length: 128 using long derivedKey, normal salt, SHA-384, with normal info with bad hash name SHA384 assert_equals: deriveKey with bad hash name correctly threw NotSupportedError: Member HkdfParams.info is required and must be an instance of BufferSource expected "NotSupportedError" but got "TypeError"
Ditto ...
> LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker-expected.txt:1859 > +FAIL Derived key of type name: AES-CBC length: 128 using long derivedKey, empty salt, SHA-384, with normal info with bad hash name SHA384 assert_equals: deriveKey with bad hash name correctly threw NotSupportedError: Member HkdfParams.info is required and must be an instance of BufferSource expected "NotSupportedError" but got "TypeError"
Ditto...
> LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker-expected.txt:2477 > +FAIL Derived key of type name: AES-CBC length: 128 using empty derivedKey, normal salt, SHA-384, with normal info with bad hash name SHA384 assert_equals: deriveKey with bad hash name correctly threw NotSupportedError: Member HkdfParams.info is required and must be an instance of BufferSource expected "NotSupportedError" but got "TypeError"
Ditto...
> LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker-expected.txt:3092 > +FAIL empty derivedKey, empty salt, SHA-384, with normal info assert_unreached: deriveBits failed with error OperationError: The operation failed for an operation-specific reason Reached unreachable code
Ditto...
Jiewen Tan
Comment 6
2017-04-14 16:46:10 PDT
Comment on
attachment 306563
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=306563&action=review
Thanks Brent for r+ my patch.
>> LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker-expected.txt:5 >> +FAIL Derived key of type name: AES-CBC length: 128 using short derivedKey, normal salt, SHA-384, with normal info with bad hash name SHA384 assert_equals: deriveKey with bad hash name correctly threw NotSupportedError: Member HkdfParams.info is required and must be an instance of BufferSource expected "NotSupportedError" but got "TypeError" > > Is this expected?
Yes. Since we detect the TypeError before the NotSupportedError, we return early. The problem with these tests is that they don't have the required dictionary member info. Therefore, we can't convert the supplied dictionaries into HkdfParams.
>> LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker-expected.txt:3092 >> +FAIL empty derivedKey, empty salt, SHA-384, with normal info assert_unreached: deriveBits failed with error OperationError: The operation failed for an operation-specific reason Reached unreachable code > > Ditto...
Not sure what this test case expects. OperationError is expected for this case.
WebKit Commit Bot
Comment 7
2017-04-14 17:17:26 PDT
Comment on
attachment 306563
[details]
Patch Clearing flags on attachment: 306563 Committed
r215382
: <
http://trac.webkit.org/changeset/215382
>
WebKit Commit Bot
Comment 8
2017-04-14 17:17:27 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug