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

Issue 1279163005: Initial Fetch integration for Subresource Integrity (Closed)

Created:
5 years, 4 months ago by jww
Modified:
5 years, 4 months ago
CC:
blink-reviews, Yoav Weiss, blink-reviews-html_chromium.org, gavinp+prerender_chromium.org, sof, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, rwlbuis, horo, tyoshino (SeeGerritForStatus), hiroshige
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/remotes/origin/master
Project:
blink
Visibility:
Public.

Description

Initial Fetch integration for Subresource Integrity This adds support to the fetch() API for the integrity attribute, both the setting of the attribute and the actual SRI enforcement. For the regular integrity attribute on elements, this leaves in place the checking of SRI in the Script element and Style element execution, rather than integrating it more fully into the Resource Loader because of technical complications. This may be worth doing in the future, but will require some significant redesign of how Resource objects are returned from the Memory Cache in ResourceFetcher::requestScript. BUG=502361 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200995

Patch Set 1 #

Total comments: 12

Patch Set 2 : Rebase on ToT (with a few other minor wording changes) #

Patch Set 3 : Improved and mostly working #

Total comments: 14

Patch Set 4 : Address yhirano's comments #

Patch Set 5 : Rebase on ToT #

Patch Set 6 : Add integration with FetchFormDataConsumerHandle #

Total comments: 10

Patch Set 7 : Nits and added Request tests #

Total comments: 6

Patch Set 8 : Simplified asserts #

Total comments: 2

Patch Set 9 : Rebase on ToT #

Patch Set 10 : Fix test expectations #

Unified diffs Side-by-side diffs Delta from patch set Stats (+262 lines, -16 lines) Patch
M LayoutTests/http/tests/fetch/script-tests/request.js View 1 2 3 4 5 6 7 8 1 chunk +23 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html View 1 2 3 4 5 6 7 1 chunk +49 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/ScriptLoader.cpp View 1 chunk +18 lines, -0 lines 0 comments Download
M Source/core/frame/SubresourceIntegrity.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/frame/SubresourceIntegrity.cpp View 1 2 3 4 5 6 7 8 2 chunks +12 lines, -3 lines 0 comments Download
M Source/core/html/HTMLLinkElement.cpp View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/modules/fetch/FetchManager.cpp View 1 2 3 4 5 6 11 chunks +125 lines, -11 lines 0 comments Download
M Source/modules/fetch/FetchRequestData.h View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M Source/modules/fetch/FetchRequestData.cpp View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/fetch/Request.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/fetch/Request.cpp View 1 2 3 4 5 6 7 8 4 chunks +16 lines, -2 lines 0 comments Download
M Source/modules/fetch/Request.idl View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/fetch/RequestInit.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/fetch/RequestInit.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 49 (14 generated)
jww
horo@ and tyoshino@, this is my initial attempt at integrating the subresource integrity spec into ...
5 years, 4 months ago (2015-08-08 01:46:10 UTC) #1
horo
looks-good for me. But yhirano@ knows more about Streams than I. Added yhirano@ to CC.
5 years, 4 months ago (2015-08-10 08:15:12 UTC) #3
jww
On 2015/08/10 08:15:12, horo wrote: > looks-good for me. > But yhirano@ knows more about ...
5 years, 4 months ago (2015-08-10 13:32:41 UTC) #4
yhirano
WebDataConsumerHandle::obtainReader is called on any thread and the obtained reader run on the thread. I ...
5 years, 4 months ago (2015-08-11 09:22:08 UTC) #6
yhirano
> WebDataConsumerHandle::obtainReader is called on any thread and the obtained > reader run on the ...
5 years, 4 months ago (2015-08-11 15:02:36 UTC) #7
jww
On 2015/08/11 15:02:36, yhirano wrote: > > WebDataConsumerHandle::obtainReader is called on any thread and the ...
5 years, 4 months ago (2015-08-12 16:26:05 UTC) #8
jww
https://codereview.chromium.org/1279163005/diff/1/Source/modules/fetch/BodyStreamBuffer.h File Source/modules/fetch/BodyStreamBuffer.h (right): https://codereview.chromium.org/1279163005/diff/1/Source/modules/fetch/BodyStreamBuffer.h#newcode93 Source/modules/fetch/BodyStreamBuffer.h:93: String m_integrity; On 2015/08/11 09:22:08, yhirano wrote: > Is ...
5 years, 4 months ago (2015-08-12 16:40:14 UTC) #9
jww
On 2015/08/12 16:40:14, jww wrote: > https://codereview.chromium.org/1279163005/diff/1/Source/modules/fetch/BodyStreamBuffer.h > File Source/modules/fetch/BodyStreamBuffer.h (right): > > https://codereview.chromium.org/1279163005/diff/1/Source/modules/fetch/BodyStreamBuffer.h#newcode93 > ...
5 years, 4 months ago (2015-08-13 04:12:53 UTC) #10
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1279163005/diff/1/Source/modules/fetch/Request.cpp File Source/modules/fetch/Request.cpp (right): https://codereview.chromium.org/1279163005/diff/1/Source/modules/fetch/Request.cpp#newcode161 Source/modules/fetch/Request.cpp:161: // surrounding numbers should be corrected.) now this step ...
5 years, 4 months ago (2015-08-13 06:53:38 UTC) #12
jww
https://codereview.chromium.org/1279163005/diff/1/Source/modules/fetch/Request.cpp File Source/modules/fetch/Request.cpp (right): https://codereview.chromium.org/1279163005/diff/1/Source/modules/fetch/Request.cpp#newcode161 Source/modules/fetch/Request.cpp:161: // surrounding numbers should be corrected.) On 2015/08/13 06:53:38, ...
5 years, 4 months ago (2015-08-13 14:32:11 UTC) #13
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1279163005/diff/1/Source/modules/fetch/Request.cpp File Source/modules/fetch/Request.cpp (right): https://codereview.chromium.org/1279163005/diff/1/Source/modules/fetch/Request.cpp#newcode161 Source/modules/fetch/Request.cpp:161: // surrounding numbers should be corrected.) On 2015/08/13 14:32:11, ...
5 years, 4 months ago (2015-08-13 15:02:31 UTC) #14
yhirano
On 2015/08/12 16:26:05, jww wrote: > > Thanks, but based on my understanding, I'm not ...
5 years, 4 months ago (2015-08-13 18:10:28 UTC) #15
yhirano
https://codereview.chromium.org/1279163005/diff/1/Source/modules/fetch/FetchManager.cpp File Source/modules/fetch/FetchManager.cpp (right): https://codereview.chromium.org/1279163005/diff/1/Source/modules/fetch/FetchManager.cpp#newcode93 Source/modules/fetch/FetchManager.cpp:93: while (m_reader->read(buf, 1000, flags, &amt) == Ok) On 2015/08/12 ...
5 years, 4 months ago (2015-08-13 18:10:36 UTC) #16
jww
I believe this implementation is basically working at this point, modulo the TODO in FetchManager.cpp ...
5 years, 4 months ago (2015-08-13 23:57:13 UTC) #17
yhirano
Thanks, I think it will work. https://codereview.chromium.org/1279163005/diff/40001/Source/modules/fetch/FetchManager.cpp File Source/modules/fetch/FetchManager.cpp (right): https://codereview.chromium.org/1279163005/diff/40001/Source/modules/fetch/FetchManager.cpp#newcode129 Source/modules/fetch/FetchManager.cpp:129: DEFINE_INLINE_TRACE() { visitor->trace(m_updater); ...
5 years, 4 months ago (2015-08-17 11:53:45 UTC) #18
yhirano
https://codereview.chromium.org/1279163005/diff/40001/Source/modules/fetch/FetchManager.cpp File Source/modules/fetch/FetchManager.cpp (right): https://codereview.chromium.org/1279163005/diff/40001/Source/modules/fetch/FetchManager.cpp#newcode276 Source/modules/fetch/FetchManager.cpp:276: return; On 2015/08/17 11:53:45, yhirano wrote: > I think ...
5 years, 4 months ago (2015-08-17 11:54:44 UTC) #19
jww
https://codereview.chromium.org/1279163005/diff/40001/Source/modules/fetch/FetchManager.cpp File Source/modules/fetch/FetchManager.cpp (right): https://codereview.chromium.org/1279163005/diff/40001/Source/modules/fetch/FetchManager.cpp#newcode129 Source/modules/fetch/FetchManager.cpp:129: DEFINE_INLINE_TRACE() { visitor->trace(m_updater); } On 2015/08/17 11:53:45, yhirano wrote: ...
5 years, 4 months ago (2015-08-17 15:40:59 UTC) #20
yhirano
FetchFormDataConsumerHandle CL was landed. ServiceWorker interaction is not clear to me (though it may be ...
5 years, 4 months ago (2015-08-18 09:31:54 UTC) #21
jww
Your Service Worker question is a good one, but I think that it is orthogonal ...
5 years, 4 months ago (2015-08-18 19:26:20 UTC) #22
yhirano
Can you add integrity property settings tests (the simplest case and the no-cors case) in ...
5 years, 4 months ago (2015-08-19 10:42:36 UTC) #23
jww
Let me know if the added Request tests are what you're looking for. https://codereview.chromium.org/1279163005/diff/100001/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html File ...
5 years, 4 months ago (2015-08-19 16:43:40 UTC) #24
jww
mkwst@, can you take a look at changes to: Source/core/dom/ScriptLoader.cpp Source/core/frame/SubresourceIntegrity.h Source/core/frame/SubresourceIntegrity.cpp Source/core/html/HTMLLinkElement.cpp
5 years, 4 months ago (2015-08-19 18:08:00 UTC) #26
yhirano
lgtm https://codereview.chromium.org/1279163005/diff/120001/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html File LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html (right): https://codereview.chromium.org/1279163005/diff/120001/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html#newcode30 LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html:30: if (!pass) assert_true(pass, ...); https://codereview.chromium.org/1279163005/diff/120001/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html#newcode33 LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html:33: if (pass ...
5 years, 4 months ago (2015-08-20 02:23:38 UTC) #27
jww
https://codereview.chromium.org/1279163005/diff/120001/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html File LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html (right): https://codereview.chromium.org/1279163005/diff/120001/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html#newcode30 LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html:30: if (!pass) On 2015/08/20 02:23:37, yhirano wrote: > assert_true(pass, ...
5 years, 4 months ago (2015-08-20 02:57:28 UTC) #28
Mike West
On 2015/08/19 at 18:08:00, jww wrote: > mkwst@, can you take a look at changes ...
5 years, 4 months ago (2015-08-20 20:13:14 UTC) #29
sof
https://codereview.chromium.org/1279163005/diff/140001/Source/core/frame/SubresourceIntegrity.cpp File Source/core/frame/SubresourceIntegrity.cpp (right): https://codereview.chromium.org/1279163005/diff/140001/Source/core/frame/SubresourceIntegrity.cpp#newcode119 Source/core/frame/SubresourceIntegrity.cpp:119: logErrorToConsole(errorMessage, document); Don't you need to consider 'result' before ...
5 years, 4 months ago (2015-08-20 20:29:30 UTC) #31
jww
https://codereview.chromium.org/1279163005/diff/140001/Source/core/frame/SubresourceIntegrity.cpp File Source/core/frame/SubresourceIntegrity.cpp (right): https://codereview.chromium.org/1279163005/diff/140001/Source/core/frame/SubresourceIntegrity.cpp#newcode119 Source/core/frame/SubresourceIntegrity.cpp:119: logErrorToConsole(errorMessage, document); On 2015/08/20 20:29:29, sof wrote: > Don't ...
5 years, 4 months ago (2015-08-20 23:16:45 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1279163005/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1279163005/160001
5 years, 4 months ago (2015-08-20 23:17:29 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/101551)
5 years, 4 months ago (2015-08-21 00:24:14 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1279163005/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1279163005/180001
5 years, 4 months ago (2015-08-21 05:28:54 UTC) #40
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/96613)
5 years, 4 months ago (2015-08-21 08:00:01 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1279163005/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1279163005/180001
5 years, 4 months ago (2015-08-21 13:11:05 UTC) #44
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/96756)
5 years, 4 months ago (2015-08-21 14:52:08 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1279163005/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1279163005/180001
5 years, 4 months ago (2015-08-21 16:35:22 UTC) #48
commit-bot: I haz the power
5 years, 4 months ago (2015-08-21 17:40:07 UTC) #49
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=200995

Powered by Google App Engine
This is Rietveld 408576698