| Index: third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
|
| index 21d5e070a42b0dfaa8f2da0329e48759df2d5c1d..0ba9245938d6c0f7eacd572460732ce64cc3f8d3 100644
|
| --- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
|
| @@ -417,14 +417,20 @@ bool CSPDirectiveList::allowAncestors(LocalFrame* frame, const KURL& url, Conten
|
| return reportingStatus == ContentSecurityPolicy::SendReport ? checkAncestorsAndReportViolation(m_frameAncestors.get(), frame, url) : checkAncestors(m_frameAncestors.get(), frame);
|
| }
|
|
|
| -bool CSPDirectiveList::allowScriptNonce(const String& nonce) const
|
| +CSPDirectiveList::NoncePolicyDisposition CSPDirectiveList::allowScriptNonce(const String& nonce) const
|
| {
|
| - return checkNonce(operativeDirective(m_scriptSrc.get()), nonce);
|
| + SourceListDirective* directive = operativeDirective(m_scriptSrc.get());
|
| + if (!directive)
|
| + return NoncePolicyDisposition::NoDirective;
|
| + return checkNonce(directive, nonce) ? NoncePolicyDisposition::Allowed : NoncePolicyDisposition::Denied;
|
| }
|
|
|
| -bool CSPDirectiveList::allowStyleNonce(const String& nonce) const
|
| +CSPDirectiveList::NoncePolicyDisposition CSPDirectiveList::allowStyleNonce(const String& nonce) const
|
| {
|
| - return checkNonce(operativeDirective(m_styleSrc.get()), nonce);
|
| + SourceListDirective* directive = operativeDirective(m_styleSrc.get());
|
| + if (!directive)
|
| + return NoncePolicyDisposition::NoDirective;
|
| + return checkNonce(directive, nonce) ? NoncePolicyDisposition::Allowed : NoncePolicyDisposition::Denied;
|
| }
|
|
|
| bool CSPDirectiveList::allowScriptHash(const CSPHashValue& hashValue, ContentSecurityPolicy::InlineType type) const
|
|
|