Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Issue 19885002: WebCrypto: Add interfaces for importKey(). (Closed)

Created:
7 years, 5 months ago by eroman
Modified:
7 years, 5 months ago
Reviewers:
abarth-chromium
CC:
blink-reviews, jamesr, dglazkov+blink, eae+blinkwatch
Visibility:
Public.

Description

WebCrypto: Add interfaces for importKey(). Adds WebKit API interfaces importKey(). Also refactors CryptoOperation to match. The key operations support both synchronous and asynchronous completions, as well as a separate synchronous initialization failure. The asynchronous operation is abortable (however nothing aborts it yet) In order to test this, added a mock implementation of the interfaces which hardcodes some actions based on the bytes of the key. This allows for layout tests that verify the parsing and reflection of parameters. BUG=245025 R=abarth@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=154860

Patch Set 1 : #

Total comments: 3

Patch Set 2 : Move test stuff into MockWebCrypto #

Total comments: 18

Patch Set 3 : Use a wrapper for the result rather than raw pointer #

Total comments: 10

Patch Set 4 : Address remaining comments #

Patch Set 5 : cleanup related code to use the keyusage table #

Patch Set 6 : rebase onto master (ExceptionCode --> ExceptionState) #

Patch Set 7 : Add testing interface #

Total comments: 1

Patch Set 8 : Split up CryptoOperation --> CryptoOperationImpl and remove m_testInterface #

Total comments: 1

Patch Set 9 : Rebase and rename Interface --> Private #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1123 lines, -311 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
A LayoutTests/crypto/importKey.html View 1 chunk +219 lines, -0 lines 0 comments Download
A LayoutTests/crypto/importKey-expected.txt View 1 chunk +33 lines, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A + Source/core/platform/chromium/support/WebCrypto.cpp View 1 2 3 4 5 6 7 8 1 chunk +57 lines, -41 lines 0 comments Download
M Source/modules/crypto/CryptoOperation.h View 1 2 3 4 5 6 7 8 2 chunks +62 lines, -22 lines 0 comments Download
M Source/modules/crypto/CryptoOperation.cpp View 1 2 3 4 5 6 7 4 chunks +97 lines, -56 lines 0 comments Download
M Source/modules/crypto/Key.h View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M Source/modules/crypto/Key.cpp View 1 2 3 4 2 chunks +70 lines, -21 lines 0 comments Download
M Source/modules/crypto/Key.idl View 1 chunk +2 lines, -18 lines 0 comments Download
A + Source/modules/crypto/KeyOperation.h View 1 2 3 4 5 6 7 8 1 chunk +41 lines, -15 lines 0 comments Download
A Source/modules/crypto/KeyOperation.cpp View 1 2 3 4 5 6 7 1 chunk +127 lines, -0 lines 0 comments Download
M Source/modules/crypto/NormalizeAlgorithm.h View 1 2 3 4 5 2 chunks +2 lines, -3 lines 0 comments Download
M Source/modules/crypto/NormalizeAlgorithm.cpp View 1 2 3 4 5 2 chunks +28 lines, -9 lines 0 comments Download
M Source/modules/crypto/SubtleCrypto.h View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download
M Source/modules/crypto/SubtleCrypto.cpp View 1 2 3 4 5 6 7 3 chunks +62 lines, -91 lines 0 comments Download
M Source/modules/crypto/SubtleCrypto.idl View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/modules/modules.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M Tools/DumpRenderTree/DumpRenderTree.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
A + Tools/DumpRenderTree/chromium/TestRunner/src/MockWebCrypto.h View 1 2 1 chunk +8 lines, -13 lines 0 comments Download
A Tools/DumpRenderTree/chromium/TestRunner/src/MockWebCrypto.cpp View 1 2 3 1 chunk +132 lines, -0 lines 0 comments Download
M Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp View 1 2 chunks +6 lines, -0 lines 0 comments Download
M public/platform/WebCrypto.h View 1 2 3 4 5 6 7 8 5 chunks +147 lines, -22 lines 0 comments Download
M public/platform/WebCryptoKey.h View 1 chunk +7 lines, -0 lines 0 comments Download
M public/testing/WebTestInterfaces.h View 1 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
eroman
7 years, 5 months ago (2013-07-20 06:28:55 UTC) #1
eroman
https://codereview.chromium.org/19885002/diff/2001/Source/modules/crypto/Key.idl File Source/modules/crypto/Key.idl (left): https://codereview.chromium.org/19885002/diff/2001/Source/modules/crypto/Key.idl#oldcode37 Source/modules/crypto/Key.idl:37: enum KeyUsage { I removed these because it seemed ...
7 years, 5 months ago (2013-07-20 06:31:06 UTC) #2
abarth-chromium
https://codereview.chromium.org/19885002/diff/2001/Source/modules/crypto/SubtleCrypto.cpp File Source/modules/crypto/SubtleCrypto.cpp (right): https://codereview.chromium.org/19885002/diff/2001/Source/modules/crypto/SubtleCrypto.cpp#newcode108 Source/modules/crypto/SubtleCrypto.cpp:108: class MockPlatformCrypto : public WebKit::WebCrypto { It would be ...
7 years, 5 months ago (2013-07-20 06:31:59 UTC) #3
eroman
https://codereview.chromium.org/19885002/diff/2001/Source/modules/crypto/SubtleCrypto.cpp File Source/modules/crypto/SubtleCrypto.cpp (right): https://codereview.chromium.org/19885002/diff/2001/Source/modules/crypto/SubtleCrypto.cpp#newcode108 Source/modules/crypto/SubtleCrypto.cpp:108: class MockPlatformCrypto : public WebKit::WebCrypto { On 2013/07/20 06:32:00, ...
7 years, 5 months ago (2013-07-22 17:02:06 UTC) #4
abarth-chromium
On 2013/07/22 17:02:06, eroman wrote: > I am trying to wrap my head around how ...
7 years, 5 months ago (2013-07-22 18:12:53 UTC) #5
eroman
PTAL: I have moved the mocks into the TestRunner library. The corresponding blink side changes ...
7 years, 5 months ago (2013-07-23 01:37:25 UTC) #6
eroman
https://codereview.chromium.org/19885002/diff/10001/LayoutTests/TestExpectations File LayoutTests/TestExpectations (right): https://codereview.chromium.org/19885002/diff/10001/LayoutTests/TestExpectations#newcode1729 LayoutTests/TestExpectations:1729: Bug(eroman) crypto/ [ Skip ] This seems wrong. Perhaps ...
7 years, 5 months ago (2013-07-23 01:38:22 UTC) #7
abarth-chromium
https://codereview.chromium.org/19885002/diff/10001/LayoutTests/TestExpectations File LayoutTests/TestExpectations (right): https://codereview.chromium.org/19885002/diff/10001/LayoutTests/TestExpectations#newcode1729 LayoutTests/TestExpectations:1729: Bug(eroman) crypto/ [ Skip ] On 2013/07/23 01:38:22, eroman ...
7 years, 5 months ago (2013-07-23 06:22:07 UTC) #8
eroman
https://codereview.chromium.org/19885002/diff/10001/Source/modules/crypto/SubtleCrypto.cpp File Source/modules/crypto/SubtleCrypto.cpp (right): https://codereview.chromium.org/19885002/diff/10001/Source/modules/crypto/SubtleCrypto.cpp#newcode93 Source/modules/crypto/SubtleCrypto.cpp:93: ExceptionCode* m_exceptionCode; On 2013/07/23 06:22:07, abarth wrote: > I ...
7 years, 5 months ago (2013-07-23 06:53:41 UTC) #9
abarth-chromium
https://codereview.chromium.org/19885002/diff/10001/Source/modules/crypto/SubtleCrypto.cpp File Source/modules/crypto/SubtleCrypto.cpp (right): https://codereview.chromium.org/19885002/diff/10001/Source/modules/crypto/SubtleCrypto.cpp#newcode93 Source/modules/crypto/SubtleCrypto.cpp:93: ExceptionCode* m_exceptionCode; On 2013/07/23 06:53:41, eroman wrote: > It ...
7 years, 5 months ago (2013-07-23 07:06:14 UTC) #10
eroman
Thanks Adam. I have responded to your comment in this google doc (in order to ...
7 years, 5 months ago (2013-07-23 18:10:56 UTC) #11
abarth-chromium
I don't seem to be able to comment on the doc, so I'm replying here: ...
7 years, 5 months ago (2013-07-23 18:18:50 UTC) #12
abarth-chromium
s/result/resort/
7 years, 5 months ago (2013-07-23 18:19:23 UTC) #13
eroman
I have changed to giving the embedder a result object rather than pointer in patchset ...
7 years, 5 months ago (2013-07-23 21:31:33 UTC) #14
abarth-chromium
Thanks for iterating on the design. This CL LGTM with the comments below addressed. https://codereview.chromium.org/19885002/diff/32001/Source/modules/crypto/CryptoOperation.h ...
7 years, 5 months ago (2013-07-23 21:45:48 UTC) #15
abarth-chromium
On 2013/07/23 06:53:41, eroman wrote: > I saw that DumpRenderTree already depended on "base" so ...
7 years, 5 months ago (2013-07-23 21:47:23 UTC) #16
eroman
https://codereview.chromium.org/19885002/diff/10001/Source/modules/crypto/Key.cpp File Source/modules/crypto/Key.cpp (right): https://codereview.chromium.org/19885002/diff/10001/Source/modules/crypto/Key.cpp#newcode95 Source/modules/crypto/Key.cpp:95: return WebKit::WebCryptoKeyUsageUnwrapKey; On 2013/07/23 06:22:07, abarth wrote: > Maybe ...
7 years, 5 months ago (2013-07-23 23:29:02 UTC) #17
eroman
One issue I have found with using the wrapper result object, is it makes unittests ...
7 years, 5 months ago (2013-07-23 23:49:16 UTC) #18
abarth-chromium
On 2013/07/23 23:49:16, eroman wrote: > One issue I have found with using the wrapper ...
7 years, 5 months ago (2013-07-24 00:05:01 UTC) #19
eroman
I have uploaded one more patchset, which includes a way to construct mockable result objects ...
7 years, 5 months ago (2013-07-24 01:06:04 UTC) #20
abarth-chromium
I'm not super excited about all this test-specific code, but I also don't want to ...
7 years, 5 months ago (2013-07-24 01:19:10 UTC) #21
eroman
Being able to test on the blink side helps with the iterative development process. I ...
7 years, 5 months ago (2013-07-24 01:46:01 UTC) #22
eroman
s/blink/chromium
7 years, 5 months ago (2013-07-24 01:46:18 UTC) #23
eroman
Sigh, this is going to need some more work :( It occurs to me that ...
7 years, 5 months ago (2013-07-24 02:45:36 UTC) #24
eroman
Fixed the issues in patchset 8: (1) Removed the m_testInterface pollution: https://codereview.chromium.org/19885002/diff2/51002:71001/Source/core/p latform/chromium/support/WebCrypto.cpp (2) Split ...
7 years, 5 months ago (2013-07-24 18:46:44 UTC) #25
abarth-chromium
I'm sorry, this CL has gotten too big and I've read it too many times ...
7 years, 5 months ago (2013-07-24 22:40:28 UTC) #26
abarth-chromium
LGTM
7 years, 5 months ago (2013-07-24 22:40:33 UTC) #27
eroman
7 years, 5 months ago (2013-07-24 23:36:25 UTC) #28
Message was sent while issue was closed.
Committed patchset #9 manually as r154860 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698