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

Side by Side Diff: Source/core/frame/SubresourceIntegrityTest.cpp

Issue 1166003004: SRI fail open on ineligible resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove a bunch of -expected.txt files Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « Source/core/frame/SubresourceIntegrity.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/frame/SubresourceIntegrity.h" 6 #include "core/frame/SubresourceIntegrity.h"
7 7
8 #include "core/HTMLNames.h" 8 #include "core/HTMLNames.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/fetch/Resource.h" 10 #include "core/fetch/Resource.h"
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 expectIntegrity(kSha256Integrity, kBasicScript, secureURL, insecureURL); 432 expectIntegrity(kSha256Integrity, kBasicScript, secureURL, insecureURL);
433 expectIntegrity(kSha256IntegrityLenientSyntax, kBasicScript, secureURL, inse cureURL); 433 expectIntegrity(kSha256IntegrityLenientSyntax, kBasicScript, secureURL, inse cureURL);
434 expectIntegrity(kSha384Integrity, kBasicScript, secureURL, insecureURL); 434 expectIntegrity(kSha384Integrity, kBasicScript, secureURL, insecureURL);
435 expectIntegrity(kSha512Integrity, kBasicScript, secureURL, insecureURL); 435 expectIntegrity(kSha512Integrity, kBasicScript, secureURL, insecureURL);
436 expectIntegrityFailure(kSha384IntegrityLabeledAs256, kBasicScript, secureURL , insecureURL); 436 expectIntegrityFailure(kSha384IntegrityLabeledAs256, kBasicScript, secureURL , insecureURL);
437 expectIntegrity(kUnsupportedHashFunctionIntegrity, kBasicScript, secureURL, insecureURL); 437 expectIntegrity(kUnsupportedHashFunctionIntegrity, kBasicScript, secureURL, insecureURL);
438 438
439 expectIntegrity(kSha256AndSha384Integrities, kBasicScript, secureURL, insecu reURL); 439 expectIntegrity(kSha256AndSha384Integrities, kBasicScript, secureURL, insecu reURL);
440 expectIntegrity(kBadSha256AndGoodSha384Integrities, kBasicScript, secureURL, insecureURL); 440 expectIntegrity(kBadSha256AndGoodSha384Integrities, kBasicScript, secureURL, insecureURL);
441 441
442 // The cross origin (http -> https case) should return true, but it will
443 // output a console error.
444 expectIntegrity(kSha256Integrity, kBasicScript, secureURL, insecureURL, NoCo rs);
445
442 expectIntegrityFailure(kGoodSha256AndBadSha384Integrities, kBasicScript, sec ureURL, insecureURL); 446 expectIntegrityFailure(kGoodSha256AndBadSha384Integrities, kBasicScript, sec ureURL, insecureURL);
443
444 // This check should fail because, unlike in the
445 // CheckSubresourceIntegrityInSecureOrigin case, this is cross origin
446 // (secure origin requesting a resource on an insecure origin)
447 expectIntegrityFailure(kSha256Integrity, kBasicScript, secureURL, insecureUR L, NoCors);
448 } 447 }
449 448
450 } // namespace blink 449 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/SubresourceIntegrity.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698