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

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 1578993003: Add Expect CT policy that gets checked on all certs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix browser tests, kinda hacky :( Created 4 years, 11 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 | « no previous file | net/cert/ct_policy_enforcer.h » ('j') | net/cert/ct_policy_enforcer.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <utility> 5 #include <utility>
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after
2498 2498
2499 content::NavigationEntry* entry = tab->GetController().GetActiveEntry(); 2499 content::NavigationEntry* entry = tab->GetController().GetActiveEntry();
2500 ASSERT_TRUE(entry); 2500 ASSERT_TRUE(entry);
2501 content::SSLStatus interstitial_ssl_status = entry->GetSSL(); 2501 content::SSLStatus interstitial_ssl_status = entry->GetSSL();
2502 2502
2503 ProceedThroughInterstitial(tab); 2503 ProceedThroughInterstitial(tab);
2504 EXPECT_FALSE(tab->ShowingInterstitialPage()); 2504 EXPECT_FALSE(tab->ShowingInterstitialPage());
2505 entry = tab->GetController().GetActiveEntry(); 2505 entry = tab->GetController().GetActiveEntry();
2506 ASSERT_TRUE(entry); 2506 ASSERT_TRUE(entry);
2507 2507
2508 // Certificate Transparency compliance is not checked until the
2509 // connection completes successfully, so the certificate will not have
2510 // been marked as failing CT on the interstitial.
Ryan Sleevi 2016/01/22 23:49:41 That's... weird.
estark 2016/01/23 01:38:41 Yeah :/ Not sure how else to deal with it though..
2511 EXPECT_EQ(0u, interstitial_ssl_status.cert_status &
2512 net::CERT_STATUS_CT_COMPLIANCE_FAILED);
2513 interstitial_ssl_status.cert_status = interstitial_ssl_status.cert_status |
2514 net::CERT_STATUS_CT_COMPLIANCE_FAILED;
2515
2508 content::SSLStatus after_interstitial_ssl_status = entry->GetSSL(); 2516 content::SSLStatus after_interstitial_ssl_status = entry->GetSSL();
2509 ASSERT_NO_FATAL_FAILURE(CheckSSLStatusesEquals(after_interstitial_ssl_status, 2517 ASSERT_NO_FATAL_FAILURE(CheckSSLStatusesEquals(after_interstitial_ssl_status,
2510 interstitial_ssl_status)); 2518 interstitial_ssl_status));
2511 } 2519 }
2512 2520
2513 // As above, but for a bad clock interstitial. Tests that a clock 2521 // As above, but for a bad clock interstitial. Tests that a clock
2514 // interstitial's SSLStatus matches the SSLStatus of the HTTPS page 2522 // interstitial's SSLStatus matches the SSLStatus of the HTTPS page
2515 // after proceeding through a normal SSL interstitial. 2523 // after proceeding through a normal SSL interstitial.
2516 IN_PROC_BROWSER_TEST_F(SSLUITest, 2524 IN_PROC_BROWSER_TEST_F(SSLUITest,
2517 SSLStatusMatchesonClockInterstitialAndAfterProceed) { 2525 SSLStatusMatchesonClockInterstitialAndAfterProceed) {
(...skipping 29 matching lines...) Expand all
2547 ASSERT_TRUE(ssl_interstitial); 2555 ASSERT_TRUE(ssl_interstitial);
2548 EXPECT_EQ(SSLBlockingPage::kTypeForTesting, 2556 EXPECT_EQ(SSLBlockingPage::kTypeForTesting,
2549 ssl_interstitial->GetDelegateForTesting()->GetTypeForTesting()); 2557 ssl_interstitial->GetDelegateForTesting()->GetTypeForTesting());
2550 ProceedThroughInterstitial(tab); 2558 ProceedThroughInterstitial(tab);
2551 EXPECT_FALSE(tab->ShowingInterstitialPage()); 2559 EXPECT_FALSE(tab->ShowingInterstitialPage());
2552 2560
2553 // Grab the SSLStatus from the page and check that it is the same as 2561 // Grab the SSLStatus from the page and check that it is the same as
2554 // on the clock interstitial. 2562 // on the clock interstitial.
2555 entry = tab->GetController().GetActiveEntry(); 2563 entry = tab->GetController().GetActiveEntry();
2556 ASSERT_TRUE(entry); 2564 ASSERT_TRUE(entry);
2565 // Certificate Transparency compliance is not checked until the
2566 // connection completes successfully, so the certificate will not have
2567 // been marked as failing CT on the interstitial.
2568 EXPECT_EQ(0u, clock_interstitial_ssl_status.cert_status &
2569 net::CERT_STATUS_CT_COMPLIANCE_FAILED);
2570 clock_interstitial_ssl_status.cert_status =
2571 clock_interstitial_ssl_status.cert_status |
2572 net::CERT_STATUS_CT_COMPLIANCE_FAILED;
2557 content::SSLStatus after_interstitial_ssl_status = entry->GetSSL(); 2573 content::SSLStatus after_interstitial_ssl_status = entry->GetSSL();
2558 ASSERT_NO_FATAL_FAILURE(CheckSSLStatusesEquals( 2574 ASSERT_NO_FATAL_FAILURE(CheckSSLStatusesEquals(
2559 after_interstitial_ssl_status, clock_interstitial_ssl_status)); 2575 after_interstitial_ssl_status, clock_interstitial_ssl_status));
2560 } 2576 }
2561 2577
2562 class CommonNameMismatchBrowserTest : public CertVerifierBrowserTest { 2578 class CommonNameMismatchBrowserTest : public CertVerifierBrowserTest {
2563 public: 2579 public:
2564 CommonNameMismatchBrowserTest() : CertVerifierBrowserTest() {} 2580 CommonNameMismatchBrowserTest() : CertVerifierBrowserTest() {}
2565 ~CommonNameMismatchBrowserTest() override {} 2581 ~CommonNameMismatchBrowserTest() override {}
2566 2582
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
2931 2947
2932 // Visit a page over https that contains a frame with a redirect. 2948 // Visit a page over https that contains a frame with a redirect.
2933 2949
2934 // XMLHttpRequest insecure content in synchronous mode. 2950 // XMLHttpRequest insecure content in synchronous mode.
2935 2951
2936 // XMLHttpRequest insecure content in asynchronous mode. 2952 // XMLHttpRequest insecure content in asynchronous mode.
2937 2953
2938 // XMLHttpRequest over bad ssl in synchronous mode. 2954 // XMLHttpRequest over bad ssl in synchronous mode.
2939 2955
2940 // XMLHttpRequest over OK ssl in synchronous mode. 2956 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « no previous file | net/cert/ct_policy_enforcer.h » ('j') | net/cert/ct_policy_enforcer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698