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

Issue 19082002: WebCrypto: Add SHA-1 support to crypto.subtle.digest(). (Closed)

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

Description

WebCrypto: Add SHA-1 support to crypto.subtle.digest(). This change sets up more WebKit API interfaces for embedders to implement CryptoOperation, and connects them together using SHA-1 as an end-to-end test. The SHA-1 support is implemented on the blink side as a proof of concept, since it is just a few lines of extra code. However this will be moved over to the chromium side once more plumbing is in place. Not that this change does not make CryptoOperation inherit from Promise. Instead it directly returns a Promise from finish() and abort(). This was done to avoid potential cycles and memory leaks. Will follow up with the working group to resolve the spec's behavior. BUG=245025 R=abarth@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=154344

Patch Set 1 : . #

Patch Set 2 : delete unused test function #

Patch Set 3 : reorder headers even though it violates style #

Total comments: 4

Patch Set 4 : don't hold a ScriptObject #

Total comments: 10

Patch Set 5 : Rebase on master #

Patch Set 6 : Move WebArrayBuffer.h from public/web --> public/platform #

Patch Set 7 : Update README #

Patch Set 8 : separate sections by 2 lines #

Patch Set 9 : Add ScriptValue::createNull() #

Patch Set 10 : Remove CryptoOperation.promise(), instead make finish() and abort() return Promise #

Total comments: 6

Patch Set 11 : rebase onto master #

Patch Set 12 : Lazily create the ScriptPromiseResolver #

Patch Set 13 : Simplify include path after header move #

Patch Set 14 : Rebase onto master #

Patch Set 15 : Re-upload after revert #

Patch Set 16 : BUGFIX: Don't create a ScriptPromiseResolver in CryptoOperation destructor, as that can crash #

Patch Set 17 : Improve the layout tests #

Patch Set 18 : Remove an extra newline #

Unified diffs Side-by-side diffs Delta from patch set Stats (+607 lines, -171 lines) Patch
A LayoutTests/crypto/digest.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +198 lines, -0 lines 0 comments Download
A LayoutTests/crypto/digest-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +39 lines, -0 lines 0 comments Download
M Source/bindings/v8/ScriptValue.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
A + Source/core/platform/chromium/support/WebArrayBuffer.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/crypto/CryptoOperation.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +44 lines, -2 lines 0 comments Download
M Source/modules/crypto/CryptoOperation.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +115 lines, -1 line 0 comments Download
M Source/modules/crypto/CryptoOperation.idl View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M Source/modules/crypto/NormalizeAlgorithm.cpp View 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/crypto/SubtleCrypto.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +63 lines, -6 lines 0 comments Download
D Source/web/WebArrayBuffer.cpp View 1 2 3 4 5 1 chunk +0 lines, -103 lines 0 comments Download
M Source/web/WebBindings.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +1 line, -1 line 0 comments Download
M Source/web/WebSocketImpl.cpp View 1 2 3 4 5 2 chunks +1 line, -1 line 0 comments Download
M Source/web/web.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1 line 0 comments Download
M public/README View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M public/platform/Platform.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +9 lines, -0 lines 0 comments Download
A + public/platform/WebArrayBuffer.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -2 lines 0 comments Download
A public/platform/WebCrypto.h View 1 chunk +119 lines, -0 lines 0 comments Download
M public/web/WebArrayBuffer.h View 1 2 3 4 5 2 chunks +3 lines, -53 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
eroman
7 years, 5 months ago (2013-07-12 02:38:23 UTC) #1
eroman
https://codereview.chromium.org/19082002/diff/11/Source/modules/crypto/CryptoOperation.cpp File Source/modules/crypto/CryptoOperation.cpp (right): https://codereview.chromium.org/19082002/diff/11/Source/modules/crypto/CryptoOperation.cpp#newcode34 Source/modules/crypto/CryptoOperation.cpp:34: #include "bindings/v8/custom/V8ArrayBufferCustom.h" // MUST precede ScriptPromiseResolver for compilation to ...
7 years, 5 months ago (2013-07-12 02:58:43 UTC) #2
abarth-chromium
https://codereview.chromium.org/19082002/diff/11/Source/modules/crypto/CryptoOperation.cpp File Source/modules/crypto/CryptoOperation.cpp (right): https://codereview.chromium.org/19082002/diff/11/Source/modules/crypto/CryptoOperation.cpp#newcode34 Source/modules/crypto/CryptoOperation.cpp:34: #include "bindings/v8/custom/V8ArrayBufferCustom.h" // MUST precede ScriptPromiseResolver for compilation to ...
7 years, 5 months ago (2013-07-12 03:53:23 UTC) #3
eroman
https://codereview.chromium.org/19082002/diff/11/Source/modules/crypto/CryptoOperation.h File Source/modules/crypto/CryptoOperation.h (right): https://codereview.chromium.org/19082002/diff/11/Source/modules/crypto/CryptoOperation.h#newcode91 Source/modules/crypto/CryptoOperation.h:91: ScriptObject m_promise; On 2013/07/12 03:53:24, abarth wrote: > This ...
7 years, 5 months ago (2013-07-12 04:24:37 UTC) #4
abarth-chromium
On 2013/07/12 04:24:37, eroman wrote: > I have changed it so the accessor returns a ...
7 years, 5 months ago (2013-07-12 04:34:37 UTC) #5
abarth-chromium
https://codereview.chromium.org/19082002/diff/16001/Source/modules/crypto/CryptoOperation.cpp File Source/modules/crypto/CryptoOperation.cpp (right): https://codereview.chromium.org/19082002/diff/16001/Source/modules/crypto/CryptoOperation.cpp#newcode38 Source/modules/crypto/CryptoOperation.cpp:38: #include "public/web/WebArrayBuffer.h" This is a backwards dependency. You can ...
7 years, 5 months ago (2013-07-12 16:58:30 UTC) #6
abarth-chromium
I think there's a larger memory leak problem here. Suppose the web page calls then(func) ...
7 years, 5 months ago (2013-07-12 17:41:42 UTC) #7
eroman
Thanks for the reviews! Good point about the circular reference, I am raising this issue ...
7 years, 5 months ago (2013-07-12 20:38:18 UTC) #8
jamesr
On 2013/07/12 20:38:18, eroman wrote: > https://codereview.chromium.org/19082002/diff/16001/public/platform/WebCrypto.h#newcode38 > public/platform/WebCrypto.h:38: class WebArrayBuffer; > On 2013/07/12 16:58:31, ...
7 years, 5 months ago (2013-07-12 20:39:57 UTC) #9
Ryan Sleevi
On 2013/07/12 17:41:42, abarth wrote: > I think there's a larger memory leak problem here. ...
7 years, 5 months ago (2013-07-13 03:44:57 UTC) #10
eroman
@abarth: Anything else you want me to do in this CL?
7 years, 5 months ago (2013-07-16 00:11:32 UTC) #11
abarth-chromium
LGTM. Thanks! https://codereview.chromium.org/19082002/diff/45001/Source/modules/crypto/CryptoOperation.cpp File Source/modules/crypto/CryptoOperation.cpp (right): https://codereview.chromium.org/19082002/diff/45001/Source/modules/crypto/CryptoOperation.cpp#newcode81 Source/modules/crypto/CryptoOperation.cpp:81: m_promiseResolver = ScriptPromiseResolver::create(); Can we delay creating ...
7 years, 5 months ago (2013-07-16 00:29:10 UTC) #12
eroman
https://codereview.chromium.org/19082002/diff/45001/Source/modules/crypto/CryptoOperation.cpp File Source/modules/crypto/CryptoOperation.cpp (right): https://codereview.chromium.org/19082002/diff/45001/Source/modules/crypto/CryptoOperation.cpp#newcode81 Source/modules/crypto/CryptoOperation.cpp:81: m_promiseResolver = ScriptPromiseResolver::create(); On 2013/07/16 00:29:10, abarth wrote: > ...
7 years, 5 months ago (2013-07-16 07:28:06 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eroman@chromium.org/19082002/65001
7 years, 5 months ago (2013-07-16 07:28:55 UTC) #14
commit-bot: I haz the power
Retried try job too often on linux_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_layout_rel&number=16967
7 years, 5 months ago (2013-07-16 12:10:09 UTC) #15
eroman
Committed patchset #14 manually as r154310 (presubmit successful).
7 years, 5 months ago (2013-07-16 17:36:43 UTC) #16
eroman
I reverted this changelist due to a crash that happened on buildbot. I have fixed ...
7 years, 5 months ago (2013-07-16 23:06:27 UTC) #17
abarth-chromium
LGTM
7 years, 5 months ago (2013-07-17 00:30:32 UTC) #18
eroman
7 years, 5 months ago (2013-07-17 01:16:38 UTC) #19
Message was sent while issue was closed.
Committed patchset #18 manually as r154344 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698