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

Unified Diff: Source/core/frame/csp/CSPDirectiveList.cpp

Issue 1360693002: Apply CSP default-src hash values to script-src and style src. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Test fix Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-default-src.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/csp/CSPDirectiveList.cpp
diff --git a/Source/core/frame/csp/CSPDirectiveList.cpp b/Source/core/frame/csp/CSPDirectiveList.cpp
index d88ffc3725a9747107df8c71f57d77f543c839fa..b99bb2809e1da107ab7d3bd4b9f86c5b03cddaf8 100644
--- a/Source/core/frame/csp/CSPDirectiveList.cpp
+++ b/Source/core/frame/csp/CSPDirectiveList.cpp
@@ -748,6 +748,11 @@ void CSPDirectiveList::addDirective(const String& name, const String& value)
if (equalIgnoringCase(name, ContentSecurityPolicy::DefaultSrc)) {
setCSPDirective<SourceListDirective>(name, value, m_defaultSrc);
+ // TODO(mkwst) It seems unlikely that developers would use different
+ // algorithms for scripts and styles. We may want to combine the
+ // usesScriptHashAlgorithms() and usesStyleHashAlgorithms.
+ m_policy->usesScriptHashAlgorithms(m_defaultSrc->hashAlgorithmsUsed());
+ m_policy->usesStyleHashAlgorithms(m_defaultSrc->hashAlgorithmsUsed());
} else if (equalIgnoringCase(name, ContentSecurityPolicy::ScriptSrc)) {
setCSPDirective<SourceListDirective>(name, value, m_scriptSrc);
m_policy->usesScriptHashAlgorithms(m_scriptSrc->hashAlgorithmsUsed());
« no previous file with comments | « LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-default-src.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698