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

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: 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
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..822ff1b5b5150d48faa197cda5a181d7f0c5eedd 100644
--- a/Source/core/frame/csp/CSPDirectiveList.cpp
+++ b/Source/core/frame/csp/CSPDirectiveList.cpp
@@ -748,6 +748,8 @@ void CSPDirectiveList::addDirective(const String& name, const String& value)
if (equalIgnoringCase(name, ContentSecurityPolicy::DefaultSrc)) {
setCSPDirective<SourceListDirective>(name, value, m_defaultSrc);
+ m_policy->usesScriptHashAlgorithms(m_defaultSrc->hashAlgorithmsUsed());
+ m_policy->usesStyleHashAlgorithms(m_defaultSrc->hashAlgorithmsUsed());
Mike West 2015/09/22 04:37:38 Hrm. I wonder if we can get away with combining th
jww 2015/09/22 16:55:38 Sure, I think another CL makes sense.
} else if (equalIgnoringCase(name, ContentSecurityPolicy::ScriptSrc)) {
setCSPDirective<SourceListDirective>(name, value, m_scriptSrc);
m_policy->usesScriptHashAlgorithms(m_scriptSrc->hashAlgorithmsUsed());

Powered by Google App Engine
This is Rietveld 408576698