RESOLVED FIXED 169319
[WebCrypto] Implement ECDH DeriveBits operation
https://bugs.webkit.org/show_bug.cgi?id=169319
Summary [WebCrypto] Implement ECDH DeriveBits operation
Jiewen Tan
Reported 2017-03-07 16:58:31 PST
Implement ECDH DeriveKey/DeriveBits operations according to the spec: https://www.w3.org/TR/WebCryptoAPI/#ecdh-operations.
Attachments
Patch (62.79 KB, patch)
2017-03-08 14:08 PST, Jiewen Tan
no flags
Patch (68.30 KB, patch)
2017-03-08 14:24 PST, Jiewen Tan
no flags
Patch (63.61 KB, patch)
2017-03-08 15:03 PST, Jiewen Tan
bfulgham: review+
commit-queue: commit-queue-
Jiewen Tan
Comment 1 2017-03-07 16:59:00 PST
Jiewen Tan
Comment 2 2017-03-08 14:08:59 PST
Jiewen Tan
Comment 3 2017-03-08 14:10:28 PST
This bug only implements ECDH DeriveBits for now. The DeriveKey operation will be tracked on another bug.
Jiewen Tan
Comment 4 2017-03-08 14:24:12 PST
Brent Fulgham
Comment 5 2017-03-08 14:38:17 PST
Comment on attachment 303842 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=303842&action=review Looks good. Does this not cause any W3C test cases to start passing? Maybe you need the DeriveKey part, too. > Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp:-63 > - DeriveKey, Should we leave this in as a "NotSupportedError" case until your second patch? > Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp:-162 > - case Operations::DeriveKey: Ditto here? Just handle "NotSupported" for now, rather than remove it completely?
Jiewen Tan
Comment 6 2017-03-08 14:45:09 PST
Comment on attachment 303842 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=303842&action=review Thanks Brent for r+ my patch. Sadly, all the w3c test cases use SPKI/PKCS as the de facto formats for importing EC keys. Therefore, the test won't run on WebKit until we support SPKI/PKCS. Good news though Firefox doesn't support SPKI/PKCS as well. So the tests don't run on Firefox too. >> Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp:-63 >> - DeriveKey, > > Should we leave this in as a "NotSupportedError" case until your second patch? Sure. >> Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp:-162 >> - case Operations::DeriveKey: > > Ditto here? Just handle "NotSupported" for now, rather than remove it completely? Fixed.
Jiewen Tan
Comment 7 2017-03-08 15:03:58 PST
Brent Fulgham
Comment 8 2017-03-08 15:09:03 PST
Comment on attachment 303850 [details] Patch r=me.
WebKit Commit Bot
Comment 9 2017-03-08 18:17:12 PST
Comment on attachment 303850 [details] Patch Rejecting attachment 303850 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 303850, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit Last 500 characters of output: ilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc ... Currently at 213615 = 4ca78b286ae45bc70b983c531c3b927abd5f921f r213616 = f89f40e92bc59b44ebaf3e209362eaf1c89dfbf2 r213617 = 196c89ab01ab2d2311a910cb5fb43773dff9e9f2 Done rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc First, rewinding head to replay your work on top of it... Fast-forwarded master to refs/remotes/origin/master. Total errors found: 0 in 1 files Full output: http://webkit-queues.webkit.org/results/3273373
Jiewen Tan
Comment 10 2017-03-08 20:04:42 PST
Joseph Pecoraro
Comment 11 2017-03-08 20:45:11 PST
Comment on attachment 303850 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=303850&action=review > Source/WebCore/crypto/keys/CryptoKeyEC.h:88 > + PlatformECKey platformKey() { return m_platformKey; } const?
Jiewen Tan
Comment 12 2017-03-08 21:00:51 PST
(In reply to comment #11) > Comment on attachment 303850 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=303850&action=review > > > Source/WebCore/crypto/keys/CryptoKeyEC.h:88 > > + PlatformECKey platformKey() { return m_platformKey; } > > const? PlatformECKey is a opaque C structure from CommonCrypto. Therefore, const will make it impossible to pass to CommonCrypto APIs.
Note You need to log in before you can comment on or make changes to this bug.