Bug 169257 - [WebCrypto] Implement ECDH ImportKey/ExportKey operations
Summary: [WebCrypto] Implement ECDH ImportKey/ExportKey operations
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jiewen Tan
URL:
Keywords: InRadar
Depends on:
Blocks: 166746
  Show dependency treegraph
 
Reported: 2017-03-06 20:45 PST by Jiewen Tan
Modified: 2017-03-12 14:42 PDT (History)
5 users (show)

See Also:


Attachments
Patch (153.00 KB, patch)
2017-03-07 16:13 PST, Jiewen Tan
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews116 for mac-elcapitan (1.50 MB, application/zip)
2017-03-07 17:28 PST, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiewen Tan 2017-03-06 20:45:11 PST
Implement ECDH ImportKey/ExportKey operations according to: https://www.w3.org/TR/WebCryptoAPI/#ecdh-operations.
Comment 1 Jiewen Tan 2017-03-06 20:46:00 PST
<rdar://problem/23789585>
Comment 2 Jiewen Tan 2017-03-07 16:13:36 PST
Created attachment 303742 [details]
Patch
Comment 3 WebKit Commit Bot 2017-03-07 16:15:35 PST
Attachment 303742 [details] did not pass style-queue:


ERROR: Source/WebCore/crypto/CommonCryptoUtilities.h:91:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
ERROR: Source/WebCore/crypto/CommonCryptoUtilities.h:92:  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 71 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Brent Fulgham 2017-03-07 17:15:53 PST
Comment on attachment 303742 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=303742&action=review

r=me

> Source/WebCore/crypto/CommonCryptoUtilities.h:109
> +extern "C" CCCryptorStatus CCECCryptorGetKeyComponents(CCECCryptorRef ecKey, size_t *keySize, uint8_t *qX, size_t *qXLength, uint8_t *qY, size_t *qYLength, uint8_t *d, size_t *dLength);

Is all of this just re-declaring CoreCrypto stuff? Seems like it should live in our SPI folder if so! Note: you do not need to address this comment in this patch.

> LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/import_export/ec_importKey.worker-expected.txt:26
> +FAIL Good parameters: P-256 bits (spki, buffer(91), {name: ECDH, namedCurve: P-256}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code

Why do so many of these still fail? Is that due to the missing SPKI/PKCS8 support (based on the output I assume the answer is yes).
Comment 5 Build Bot 2017-03-07 17:28:39 PST
Comment on attachment 303742 [details]
Patch

Attachment 303742 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/3262386

New failing tests:
media/track/track-in-band-style.html
Comment 6 Build Bot 2017-03-07 17:28:41 PST
Created attachment 303747 [details]
Archive of layout-test-results from ews116 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 7 Jiewen Tan 2017-03-07 17:36:02 PST
Comment on attachment 303742 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=303742&action=review

Thanks Brent for r+ my patch.

>> Source/WebCore/crypto/CommonCryptoUtilities.h:109
>> +extern "C" CCCryptorStatus CCECCryptorGetKeyComponents(CCECCryptorRef ecKey, size_t *keySize, uint8_t *qX, size_t *qXLength, uint8_t *qY, size_t *qYLength, uint8_t *d, size_t *dLength);
> 
> Is all of this just re-declaring CoreCrypto stuff? Seems like it should live in our SPI folder if so! Note: you do not need to address this comment in this patch.

Yes. They are just re-declaring CommonCrypto stuff.

>> LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/import_export/ec_importKey.worker-expected.txt:26
>> +FAIL Good parameters: P-256 bits (spki, buffer(91), {name: ECDH, namedCurve: P-256}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError (DOM Exception 9): The algorithm is not supported Reached unreachable code
> 
> Why do so many of these still fail? Is that due to the missing SPKI/PKCS8 support (based on the output I assume the answer is yes).

Yes, I'm expecting these will pass once Bug 169318 is fixed. I have already had a plan for hacking the CommonCrypto SPIs such that we could properly do the SPKI/PKCS8 import/export.
Comment 8 WebKit Commit Bot 2017-03-07 18:09:42 PST
Comment on attachment 303742 [details]
Patch

Clearing flags on attachment: 303742

Committed r213560: <http://trac.webkit.org/changeset/213560>
Comment 9 WebKit Commit Bot 2017-03-07 18:09:46 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Javier Fernandez 2017-03-10 08:43:34 PST
This patch caused several tests to fail in GTK. 
see bug #169469 for details.