Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "net/http/transport_security_state.h" | 5 #include "net/http/transport_security_state.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1425 EXPECT_TRUE(state.ShouldUpgradeToSSL("www.google.com")); | 1425 EXPECT_TRUE(state.ShouldUpgradeToSSL("www.google.com")); |
| 1426 } | 1426 } |
| 1427 | 1427 |
| 1428 TEST_F(TransportSecurityStateTest, HPKPReporting) { | 1428 TEST_F(TransportSecurityStateTest, HPKPReporting) { |
| 1429 HostPortPair host_port_pair(kHost, kPort); | 1429 HostPortPair host_port_pair(kHost, kPort); |
| 1430 HostPortPair subdomain_host_port_pair(kSubdomain, kPort); | 1430 HostPortPair subdomain_host_port_pair(kSubdomain, kPort); |
| 1431 GURL report_uri(kReportUri); | 1431 GURL report_uri(kReportUri); |
| 1432 // Two dummy certs to use as the server-sent and validated chains. The | 1432 // Two dummy certs to use as the server-sent and validated chains. The |
| 1433 // contents don't matter. | 1433 // contents don't matter. |
| 1434 scoped_refptr<X509Certificate> cert1 = | 1434 scoped_refptr<X509Certificate> cert1 = |
| 1435 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 1435 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 1436 ASSERT_TRUE(cert1); | |
| 1436 scoped_refptr<X509Certificate> cert2 = | 1437 scoped_refptr<X509Certificate> cert2 = |
| 1437 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 1438 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 1438 ASSERT_TRUE(cert1); | |
| 1439 ASSERT_TRUE(cert2); | 1439 ASSERT_TRUE(cert2); |
| 1440 | 1440 |
| 1441 HashValueVector good_hashes, bad_hashes; | 1441 HashValueVector good_hashes, bad_hashes; |
| 1442 | 1442 |
| 1443 for (size_t i = 0; kGoodPath[i]; i++) | 1443 for (size_t i = 0; kGoodPath[i]; i++) |
| 1444 EXPECT_TRUE(AddHash(kGoodPath[i], &good_hashes)); | 1444 EXPECT_TRUE(AddHash(kGoodPath[i], &good_hashes)); |
| 1445 for (size_t i = 0; kBadPath[i]; i++) | 1445 for (size_t i = 0; kBadPath[i]; i++) |
| 1446 EXPECT_TRUE(AddHash(kBadPath[i], &bad_hashes)); | 1446 EXPECT_TRUE(AddHash(kBadPath[i], &bad_hashes)); |
| 1447 | 1447 |
| 1448 TransportSecurityState state; | 1448 TransportSecurityState state; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1533 // Tests that a histogram entry is recorded when TransportSecurityState | 1533 // Tests that a histogram entry is recorded when TransportSecurityState |
| 1534 // fails to send an HPKP violation report. | 1534 // fails to send an HPKP violation report. |
| 1535 TEST_F(TransportSecurityStateTest, UMAOnHPKPReportingFailure) { | 1535 TEST_F(TransportSecurityStateTest, UMAOnHPKPReportingFailure) { |
| 1536 base::HistogramTester histograms; | 1536 base::HistogramTester histograms; |
| 1537 const std::string histogram_name = "Net.PublicKeyPinReportSendingFailure2"; | 1537 const std::string histogram_name = "Net.PublicKeyPinReportSendingFailure2"; |
| 1538 HostPortPair host_port_pair(kHost, kPort); | 1538 HostPortPair host_port_pair(kHost, kPort); |
| 1539 GURL report_uri(kReportUri); | 1539 GURL report_uri(kReportUri); |
| 1540 // Two dummy certs to use as the server-sent and validated chains. The | 1540 // Two dummy certs to use as the server-sent and validated chains. The |
| 1541 // contents don't matter. | 1541 // contents don't matter. |
| 1542 scoped_refptr<X509Certificate> cert1 = | 1542 scoped_refptr<X509Certificate> cert1 = |
| 1543 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 1543 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 1544 ASSERT_TRUE(cert1); | |
| 1544 scoped_refptr<X509Certificate> cert2 = | 1545 scoped_refptr<X509Certificate> cert2 = |
| 1545 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 1546 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 1546 ASSERT_TRUE(cert1); | |
| 1547 ASSERT_TRUE(cert2); | 1547 ASSERT_TRUE(cert2); |
| 1548 | 1548 |
| 1549 HashValueVector good_hashes, bad_hashes; | 1549 HashValueVector good_hashes, bad_hashes; |
| 1550 | 1550 |
| 1551 for (size_t i = 0; kGoodPath[i]; i++) | 1551 for (size_t i = 0; kGoodPath[i]; i++) |
| 1552 EXPECT_TRUE(AddHash(kGoodPath[i], &good_hashes)); | 1552 EXPECT_TRUE(AddHash(kGoodPath[i], &good_hashes)); |
| 1553 for (size_t i = 0; kBadPath[i]; i++) | 1553 for (size_t i = 0; kBadPath[i]; i++) |
| 1554 EXPECT_TRUE(AddHash(kBadPath[i], &bad_hashes)); | 1554 EXPECT_TRUE(AddHash(kBadPath[i], &bad_hashes)); |
| 1555 | 1555 |
| 1556 // The histogram should start off empty. | 1556 // The histogram should start off empty. |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 1576 histograms.ExpectBucketCount(histogram_name, -mock_report_sender.net_error(), | 1576 histograms.ExpectBucketCount(histogram_name, -mock_report_sender.net_error(), |
| 1577 1); | 1577 1); |
| 1578 } | 1578 } |
| 1579 | 1579 |
| 1580 TEST_F(TransportSecurityStateTest, HPKPReportOnly) { | 1580 TEST_F(TransportSecurityStateTest, HPKPReportOnly) { |
| 1581 HostPortPair host_port_pair(kHost, kPort); | 1581 HostPortPair host_port_pair(kHost, kPort); |
| 1582 GURL report_uri(kReportUri); | 1582 GURL report_uri(kReportUri); |
| 1583 // Two dummy certs to use as the server-sent and validated chains. The | 1583 // Two dummy certs to use as the server-sent and validated chains. The |
| 1584 // contents don't matter. | 1584 // contents don't matter. |
| 1585 scoped_refptr<X509Certificate> cert1 = | 1585 scoped_refptr<X509Certificate> cert1 = |
| 1586 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 1586 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 1587 ASSERT_TRUE(cert1); | |
| 1587 scoped_refptr<X509Certificate> cert2 = | 1588 scoped_refptr<X509Certificate> cert2 = |
| 1588 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 1589 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 1589 ASSERT_TRUE(cert1); | |
| 1590 ASSERT_TRUE(cert2); | 1590 ASSERT_TRUE(cert2); |
| 1591 | 1591 |
| 1592 TransportSecurityState state; | 1592 TransportSecurityState state; |
| 1593 MockCertificateReportSender mock_report_sender; | 1593 MockCertificateReportSender mock_report_sender; |
| 1594 state.SetReportSender(&mock_report_sender); | 1594 state.SetReportSender(&mock_report_sender); |
| 1595 | 1595 |
| 1596 SSLInfo ssl_info; | 1596 SSLInfo ssl_info; |
| 1597 ssl_info.is_issued_by_known_root = true; | 1597 ssl_info.is_issued_by_known_root = true; |
| 1598 ssl_info.unverified_cert = cert1; | 1598 ssl_info.unverified_cert = cert1; |
| 1599 ssl_info.cert = cert2; | 1599 ssl_info.cert = cert2; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1643 } | 1643 } |
| 1644 | 1644 |
| 1645 // Tests that Report-Only reports are not sent on certs that chain to | 1645 // Tests that Report-Only reports are not sent on certs that chain to |
| 1646 // local roots. | 1646 // local roots. |
| 1647 TEST_F(TransportSecurityStateTest, HPKPReportOnlyOnLocalRoot) { | 1647 TEST_F(TransportSecurityStateTest, HPKPReportOnlyOnLocalRoot) { |
| 1648 HostPortPair host_port_pair(kHost, kPort); | 1648 HostPortPair host_port_pair(kHost, kPort); |
| 1649 GURL report_uri(kReportUri); | 1649 GURL report_uri(kReportUri); |
| 1650 // Two dummy certs to use as the server-sent and validated chains. The | 1650 // Two dummy certs to use as the server-sent and validated chains. The |
| 1651 // contents don't matter. | 1651 // contents don't matter. |
| 1652 scoped_refptr<X509Certificate> cert1 = | 1652 scoped_refptr<X509Certificate> cert1 = |
| 1653 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 1653 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 1654 ASSERT_TRUE(cert1); | |
| 1654 scoped_refptr<X509Certificate> cert2 = | 1655 scoped_refptr<X509Certificate> cert2 = |
| 1655 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 1656 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 1656 ASSERT_TRUE(cert1); | |
| 1657 ASSERT_TRUE(cert2); | 1657 ASSERT_TRUE(cert2); |
| 1658 | 1658 |
| 1659 std::string header = | 1659 std::string header = |
| 1660 "pin-sha256=\"" + std::string(kGoodPin1) + "\";pin-sha256=\"" + | 1660 "pin-sha256=\"" + std::string(kGoodPin1) + "\";pin-sha256=\"" + |
| 1661 std::string(kGoodPin2) + "\";pin-sha256=\"" + std::string(kGoodPin3) + | 1661 std::string(kGoodPin2) + "\";pin-sha256=\"" + std::string(kGoodPin3) + |
| 1662 "\";report-uri=\"" + report_uri.spec() + "\";includeSubdomains"; | 1662 "\";report-uri=\"" + report_uri.spec() + "\";includeSubdomains"; |
| 1663 | 1663 |
| 1664 TransportSecurityState state; | 1664 TransportSecurityState state; |
| 1665 MockCertificateReportSender mock_report_sender; | 1665 MockCertificateReportSender mock_report_sender; |
| 1666 state.SetReportSender(&mock_report_sender); | 1666 state.SetReportSender(&mock_report_sender); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 1680 } | 1680 } |
| 1681 | 1681 |
| 1682 // Tests that ProcessHPKPReportOnlyHeader() returns false if a report-uri | 1682 // Tests that ProcessHPKPReportOnlyHeader() returns false if a report-uri |
| 1683 // wasn't specified or if the header fails to parse. | 1683 // wasn't specified or if the header fails to parse. |
| 1684 TEST_F(TransportSecurityStateTest, HPKPReportOnlyParseErrors) { | 1684 TEST_F(TransportSecurityStateTest, HPKPReportOnlyParseErrors) { |
| 1685 HostPortPair host_port_pair(kHost, kPort); | 1685 HostPortPair host_port_pair(kHost, kPort); |
| 1686 GURL report_uri(kReportUri); | 1686 GURL report_uri(kReportUri); |
| 1687 // Two dummy certs to use as the server-sent and validated chains. The | 1687 // Two dummy certs to use as the server-sent and validated chains. The |
| 1688 // contents don't matter. | 1688 // contents don't matter. |
| 1689 scoped_refptr<X509Certificate> cert1 = | 1689 scoped_refptr<X509Certificate> cert1 = |
| 1690 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 1690 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 1691 ASSERT_TRUE(cert1); | |
| 1691 scoped_refptr<X509Certificate> cert2 = | 1692 scoped_refptr<X509Certificate> cert2 = |
| 1692 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 1693 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 1693 ASSERT_TRUE(cert1); | |
| 1694 ASSERT_TRUE(cert2); | 1694 ASSERT_TRUE(cert2); |
| 1695 | 1695 |
| 1696 std::string header = "pin-sha256=\"" + std::string(kGoodPin1) + | 1696 std::string header = "pin-sha256=\"" + std::string(kGoodPin1) + |
| 1697 "\";pin-sha256=\"" + std::string(kGoodPin2) + | 1697 "\";pin-sha256=\"" + std::string(kGoodPin2) + |
| 1698 "\";pin-sha256=\"" + std::string(kGoodPin3) + "\""; | 1698 "\";pin-sha256=\"" + std::string(kGoodPin3) + "\""; |
| 1699 | 1699 |
| 1700 TransportSecurityState state; | 1700 TransportSecurityState state; |
| 1701 MockCertificateReportSender mock_report_sender; | 1701 MockCertificateReportSender mock_report_sender; |
| 1702 state.SetReportSender(&mock_report_sender); | 1702 state.SetReportSender(&mock_report_sender); |
| 1703 | 1703 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1735 ASSERT_TRUE(pkp_state.HasPublicKeyPins()); | 1735 ASSERT_TRUE(pkp_state.HasPublicKeyPins()); |
| 1736 | 1736 |
| 1737 GURL report_uri = pkp_state.report_uri; | 1737 GURL report_uri = pkp_state.report_uri; |
| 1738 ASSERT_TRUE(report_uri.is_valid()); | 1738 ASSERT_TRUE(report_uri.is_valid()); |
| 1739 ASSERT_FALSE(report_uri.is_empty()); | 1739 ASSERT_FALSE(report_uri.is_empty()); |
| 1740 | 1740 |
| 1741 // Two dummy certs to use as the server-sent and validated chains. The | 1741 // Two dummy certs to use as the server-sent and validated chains. The |
| 1742 // contents don't matter, as long as they are not the real google.com | 1742 // contents don't matter, as long as they are not the real google.com |
| 1743 // certs in the pins. | 1743 // certs in the pins. |
| 1744 scoped_refptr<X509Certificate> cert1 = | 1744 scoped_refptr<X509Certificate> cert1 = |
| 1745 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 1745 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 1746 ASSERT_TRUE(cert1); | |
| 1746 scoped_refptr<X509Certificate> cert2 = | 1747 scoped_refptr<X509Certificate> cert2 = |
| 1747 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 1748 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 1748 ASSERT_TRUE(cert1); | |
| 1749 ASSERT_TRUE(cert2); | 1749 ASSERT_TRUE(cert2); |
| 1750 | 1750 |
| 1751 HashValueVector bad_hashes; | 1751 HashValueVector bad_hashes; |
| 1752 for (size_t i = 0; kBadPath[i]; i++) | 1752 for (size_t i = 0; kBadPath[i]; i++) |
| 1753 EXPECT_TRUE(AddHash(kBadPath[i], &bad_hashes)); | 1753 EXPECT_TRUE(AddHash(kBadPath[i], &bad_hashes)); |
| 1754 | 1754 |
| 1755 // Trigger a violation and check that it sends a report. | 1755 // Trigger a violation and check that it sends a report. |
| 1756 std::string failure_log; | 1756 std::string failure_log; |
| 1757 EXPECT_EQ(TransportSecurityState::PKPStatus::VIOLATED, | 1757 EXPECT_EQ(TransportSecurityState::PKPStatus::VIOLATED, |
| 1758 state.CheckPublicKeyPins( | 1758 state.CheckPublicKeyPins( |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 1783 const base::Time current_time = base::Time::Now(); | 1783 const base::Time current_time = base::Time::Now(); |
| 1784 const base::Time expiry = current_time + base::TimeDelta::FromSeconds(1000); | 1784 const base::Time expiry = current_time + base::TimeDelta::FromSeconds(1000); |
| 1785 HashValueVector good_hashes; | 1785 HashValueVector good_hashes; |
| 1786 for (size_t i = 0; kGoodPath[i]; i++) | 1786 for (size_t i = 0; kGoodPath[i]; i++) |
| 1787 EXPECT_TRUE(AddHash(kGoodPath[i], &good_hashes)); | 1787 EXPECT_TRUE(AddHash(kGoodPath[i], &good_hashes)); |
| 1788 | 1788 |
| 1789 // Two dummy certs to use as the server-sent and validated chains. The | 1789 // Two dummy certs to use as the server-sent and validated chains. The |
| 1790 // contents don't matter, as long as they are not the real google.com | 1790 // contents don't matter, as long as they are not the real google.com |
| 1791 // certs in the pins. | 1791 // certs in the pins. |
| 1792 scoped_refptr<X509Certificate> cert1 = | 1792 scoped_refptr<X509Certificate> cert1 = |
| 1793 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 1793 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 1794 ASSERT_TRUE(cert1); | |
| 1794 scoped_refptr<X509Certificate> cert2 = | 1795 scoped_refptr<X509Certificate> cert2 = |
| 1795 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 1796 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 1796 ASSERT_TRUE(cert1); | |
| 1797 ASSERT_TRUE(cert2); | 1797 ASSERT_TRUE(cert2); |
| 1798 | 1798 |
| 1799 HashValueVector bad_hashes; | 1799 HashValueVector bad_hashes; |
| 1800 for (size_t i = 0; kBadPath[i]; i++) | 1800 for (size_t i = 0; kBadPath[i]; i++) |
| 1801 EXPECT_TRUE(AddHash(kBadPath[i], &bad_hashes)); | 1801 EXPECT_TRUE(AddHash(kBadPath[i], &bad_hashes)); |
| 1802 | 1802 |
| 1803 state.AddHPKP(kHost, expiry, true, good_hashes, https_report_uri); | 1803 state.AddHPKP(kHost, expiry, true, good_hashes, https_report_uri); |
| 1804 | 1804 |
| 1805 // Trigger a violation and check that it does not send a report | 1805 // Trigger a violation and check that it does not send a report |
| 1806 // because the report-uri is HTTPS and same-host as the pins. | 1806 // because the report-uri is HTTPS and same-host as the pins. |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 1823 } | 1823 } |
| 1824 | 1824 |
| 1825 // Tests that redundant reports are rate-limited. | 1825 // Tests that redundant reports are rate-limited. |
| 1826 TEST_F(TransportSecurityStateTest, HPKPReportRateLimiting) { | 1826 TEST_F(TransportSecurityStateTest, HPKPReportRateLimiting) { |
| 1827 HostPortPair host_port_pair(kHost, kPort); | 1827 HostPortPair host_port_pair(kHost, kPort); |
| 1828 HostPortPair subdomain_host_port_pair(kSubdomain, kPort); | 1828 HostPortPair subdomain_host_port_pair(kSubdomain, kPort); |
| 1829 GURL report_uri(kReportUri); | 1829 GURL report_uri(kReportUri); |
| 1830 // Two dummy certs to use as the server-sent and validated chains. The | 1830 // Two dummy certs to use as the server-sent and validated chains. The |
| 1831 // contents don't matter. | 1831 // contents don't matter. |
| 1832 scoped_refptr<X509Certificate> cert1 = | 1832 scoped_refptr<X509Certificate> cert1 = |
| 1833 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 1833 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 1834 ASSERT_TRUE(cert1); | |
| 1834 scoped_refptr<X509Certificate> cert2 = | 1835 scoped_refptr<X509Certificate> cert2 = |
| 1835 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 1836 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 1836 ASSERT_TRUE(cert1); | |
| 1837 ASSERT_TRUE(cert2); | 1837 ASSERT_TRUE(cert2); |
| 1838 | 1838 |
| 1839 HashValueVector good_hashes, bad_hashes; | 1839 HashValueVector good_hashes, bad_hashes; |
| 1840 | 1840 |
| 1841 for (size_t i = 0; kGoodPath[i]; i++) | 1841 for (size_t i = 0; kGoodPath[i]; i++) |
| 1842 EXPECT_TRUE(AddHash(kGoodPath[i], &good_hashes)); | 1842 EXPECT_TRUE(AddHash(kGoodPath[i], &good_hashes)); |
| 1843 for (size_t i = 0; kBadPath[i]; i++) | 1843 for (size_t i = 0; kBadPath[i]; i++) |
| 1844 EXPECT_TRUE(AddHash(kBadPath[i], &bad_hashes)); | 1844 EXPECT_TRUE(AddHash(kBadPath[i], &bad_hashes)); |
| 1845 | 1845 |
| 1846 TransportSecurityState state; | 1846 TransportSecurityState state; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1944 | 1944 |
| 1945 // Tests that the Expect CT reporter is not notified for invalid or absent | 1945 // Tests that the Expect CT reporter is not notified for invalid or absent |
| 1946 // header values. | 1946 // header values. |
| 1947 TEST_F(TransportSecurityStateTest, InvalidExpectCTHeader) { | 1947 TEST_F(TransportSecurityStateTest, InvalidExpectCTHeader) { |
| 1948 HostPortPair host_port(kExpectCTStaticHostname, 443); | 1948 HostPortPair host_port(kExpectCTStaticHostname, 443); |
| 1949 SSLInfo ssl_info; | 1949 SSLInfo ssl_info; |
| 1950 ssl_info.ct_compliance_details_available = true; | 1950 ssl_info.ct_compliance_details_available = true; |
| 1951 ssl_info.ct_cert_policy_compliance = | 1951 ssl_info.ct_cert_policy_compliance = |
| 1952 ct::CertPolicyCompliance::CERT_POLICY_NOT_ENOUGH_SCTS; | 1952 ct::CertPolicyCompliance::CERT_POLICY_NOT_ENOUGH_SCTS; |
| 1953 ssl_info.is_issued_by_known_root = true; | 1953 ssl_info.is_issued_by_known_root = true; |
| 1954 scoped_refptr<X509Certificate> cert1 = | |
| 1955 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); | |
| 1956 ASSERT_TRUE(cert1); | |
| 1957 scoped_refptr<X509Certificate> cert2 = | |
| 1958 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | |
| 1959 ASSERT_TRUE(cert2); | |
| 1960 ssl_info.unverified_cert = cert1; | |
| 1961 ssl_info.cert = cert2; | |
|
Ryan Sleevi
2017/06/05 19:04:14
These are all just correctness fixes
| |
| 1954 | 1962 |
| 1955 TransportSecurityState state; | 1963 TransportSecurityState state; |
| 1956 TransportSecurityStateTest::EnableStaticExpectCT(&state); | 1964 TransportSecurityStateTest::EnableStaticExpectCT(&state); |
| 1957 MockExpectCTReporter reporter; | 1965 MockExpectCTReporter reporter; |
| 1958 state.SetExpectCTReporter(&reporter); | 1966 state.SetExpectCTReporter(&reporter); |
| 1959 state.ProcessExpectCTHeader("", host_port, ssl_info); | 1967 state.ProcessExpectCTHeader("", host_port, ssl_info); |
| 1960 EXPECT_EQ(0u, reporter.num_failures()); | 1968 EXPECT_EQ(0u, reporter.num_failures()); |
| 1961 | 1969 |
| 1962 state.ProcessExpectCTHeader("blah blah", host_port, ssl_info); | 1970 state.ProcessExpectCTHeader("blah blah", host_port, ssl_info); |
| 1963 EXPECT_EQ(0u, reporter.num_failures()); | 1971 EXPECT_EQ(0u, reporter.num_failures()); |
| 1964 | 1972 |
| 1965 state.ProcessExpectCTHeader("preload", host_port, ssl_info); | 1973 state.ProcessExpectCTHeader("preload", host_port, ssl_info); |
| 1966 EXPECT_EQ(1u, reporter.num_failures()); | 1974 EXPECT_EQ(1u, reporter.num_failures()); |
| 1967 } | 1975 } |
| 1968 | 1976 |
| 1969 // Tests that the Expect CT reporter is only notified about certificates | 1977 // Tests that the Expect CT reporter is only notified about certificates |
| 1970 // chaining to public roots. | 1978 // chaining to public roots. |
| 1971 TEST_F(TransportSecurityStateTest, ExpectCTNonPublicRoot) { | 1979 TEST_F(TransportSecurityStateTest, ExpectCTNonPublicRoot) { |
| 1972 HostPortPair host_port(kExpectCTStaticHostname, 443); | 1980 HostPortPair host_port(kExpectCTStaticHostname, 443); |
| 1973 SSLInfo ssl_info; | 1981 SSLInfo ssl_info; |
| 1974 ssl_info.ct_compliance_details_available = true; | 1982 ssl_info.ct_compliance_details_available = true; |
| 1975 ssl_info.ct_cert_policy_compliance = | 1983 ssl_info.ct_cert_policy_compliance = |
| 1976 ct::CertPolicyCompliance::CERT_POLICY_NOT_ENOUGH_SCTS; | 1984 ct::CertPolicyCompliance::CERT_POLICY_NOT_ENOUGH_SCTS; |
| 1977 ssl_info.is_issued_by_known_root = false; | 1985 ssl_info.is_issued_by_known_root = false; |
| 1986 scoped_refptr<X509Certificate> cert1 = | |
| 1987 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); | |
| 1988 ASSERT_TRUE(cert1); | |
| 1989 scoped_refptr<X509Certificate> cert2 = | |
| 1990 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | |
| 1991 ASSERT_TRUE(cert2); | |
| 1992 ssl_info.unverified_cert = cert1; | |
| 1993 ssl_info.cert = cert2; | |
| 1978 | 1994 |
| 1979 TransportSecurityState state; | 1995 TransportSecurityState state; |
| 1980 TransportSecurityStateTest::EnableStaticExpectCT(&state); | 1996 TransportSecurityStateTest::EnableStaticExpectCT(&state); |
| 1981 MockExpectCTReporter reporter; | 1997 MockExpectCTReporter reporter; |
| 1982 state.SetExpectCTReporter(&reporter); | 1998 state.SetExpectCTReporter(&reporter); |
| 1983 state.ProcessExpectCTHeader("preload", host_port, ssl_info); | 1999 state.ProcessExpectCTHeader("preload", host_port, ssl_info); |
| 1984 EXPECT_EQ(0u, reporter.num_failures()); | 2000 EXPECT_EQ(0u, reporter.num_failures()); |
| 1985 | 2001 |
| 1986 ssl_info.is_issued_by_known_root = true; | 2002 ssl_info.is_issued_by_known_root = true; |
| 1987 state.ProcessExpectCTHeader("preload", host_port, ssl_info); | 2003 state.ProcessExpectCTHeader("preload", host_port, ssl_info); |
| 1988 EXPECT_EQ(1u, reporter.num_failures()); | 2004 EXPECT_EQ(1u, reporter.num_failures()); |
| 1989 } | 2005 } |
| 1990 | 2006 |
| 1991 // Tests that the Expect CT reporter is not notified when compliance | 2007 // Tests that the Expect CT reporter is not notified when compliance |
| 1992 // details aren't available. | 2008 // details aren't available. |
| 1993 TEST_F(TransportSecurityStateTest, ExpectCTComplianceNotAvailable) { | 2009 TEST_F(TransportSecurityStateTest, ExpectCTComplianceNotAvailable) { |
| 1994 HostPortPair host_port(kExpectCTStaticHostname, 443); | 2010 HostPortPair host_port(kExpectCTStaticHostname, 443); |
| 1995 SSLInfo ssl_info; | 2011 SSLInfo ssl_info; |
| 1996 ssl_info.ct_compliance_details_available = false; | 2012 ssl_info.ct_compliance_details_available = false; |
| 1997 ssl_info.ct_cert_policy_compliance = | 2013 ssl_info.ct_cert_policy_compliance = |
| 1998 ct::CertPolicyCompliance::CERT_POLICY_NOT_ENOUGH_SCTS; | 2014 ct::CertPolicyCompliance::CERT_POLICY_NOT_ENOUGH_SCTS; |
| 1999 ssl_info.is_issued_by_known_root = true; | 2015 ssl_info.is_issued_by_known_root = true; |
| 2016 scoped_refptr<X509Certificate> cert1 = | |
| 2017 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); | |
| 2018 ASSERT_TRUE(cert1); | |
| 2019 scoped_refptr<X509Certificate> cert2 = | |
| 2020 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | |
| 2021 ASSERT_TRUE(cert2); | |
| 2022 ssl_info.unverified_cert = cert1; | |
| 2023 ssl_info.cert = cert2; | |
| 2000 | 2024 |
| 2001 TransportSecurityState state; | 2025 TransportSecurityState state; |
| 2002 TransportSecurityStateTest::EnableStaticExpectCT(&state); | 2026 TransportSecurityStateTest::EnableStaticExpectCT(&state); |
| 2003 MockExpectCTReporter reporter; | 2027 MockExpectCTReporter reporter; |
| 2004 state.SetExpectCTReporter(&reporter); | 2028 state.SetExpectCTReporter(&reporter); |
| 2005 state.ProcessExpectCTHeader("preload", host_port, ssl_info); | 2029 state.ProcessExpectCTHeader("preload", host_port, ssl_info); |
| 2006 EXPECT_EQ(0u, reporter.num_failures()); | 2030 EXPECT_EQ(0u, reporter.num_failures()); |
| 2007 | 2031 |
| 2008 ssl_info.ct_compliance_details_available = true; | 2032 ssl_info.ct_compliance_details_available = true; |
| 2009 state.ProcessExpectCTHeader("preload", host_port, ssl_info); | 2033 state.ProcessExpectCTHeader("preload", host_port, ssl_info); |
| 2010 EXPECT_EQ(1u, reporter.num_failures()); | 2034 EXPECT_EQ(1u, reporter.num_failures()); |
| 2011 } | 2035 } |
| 2012 | 2036 |
| 2013 // Tests that the Expect CT reporter is not notified about compliant | 2037 // Tests that the Expect CT reporter is not notified about compliant |
| 2014 // connections. | 2038 // connections. |
| 2015 TEST_F(TransportSecurityStateTest, ExpectCTCompliantCert) { | 2039 TEST_F(TransportSecurityStateTest, ExpectCTCompliantCert) { |
| 2016 HostPortPair host_port(kExpectCTStaticHostname, 443); | 2040 HostPortPair host_port(kExpectCTStaticHostname, 443); |
| 2017 SSLInfo ssl_info; | 2041 SSLInfo ssl_info; |
| 2018 ssl_info.ct_compliance_details_available = true; | 2042 ssl_info.ct_compliance_details_available = true; |
| 2019 ssl_info.ct_cert_policy_compliance = | 2043 ssl_info.ct_cert_policy_compliance = |
| 2020 ct::CertPolicyCompliance::CERT_POLICY_COMPLIES_VIA_SCTS; | 2044 ct::CertPolicyCompliance::CERT_POLICY_COMPLIES_VIA_SCTS; |
| 2021 ssl_info.is_issued_by_known_root = true; | 2045 ssl_info.is_issued_by_known_root = true; |
| 2046 scoped_refptr<X509Certificate> cert1 = | |
| 2047 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); | |
| 2048 ASSERT_TRUE(cert1); | |
| 2049 scoped_refptr<X509Certificate> cert2 = | |
| 2050 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | |
| 2051 ASSERT_TRUE(cert2); | |
| 2052 ssl_info.unverified_cert = cert1; | |
| 2053 ssl_info.cert = cert2; | |
| 2022 | 2054 |
| 2023 TransportSecurityState state; | 2055 TransportSecurityState state; |
| 2024 TransportSecurityStateTest::EnableStaticExpectCT(&state); | 2056 TransportSecurityStateTest::EnableStaticExpectCT(&state); |
| 2025 MockExpectCTReporter reporter; | 2057 MockExpectCTReporter reporter; |
| 2026 state.SetExpectCTReporter(&reporter); | 2058 state.SetExpectCTReporter(&reporter); |
| 2027 state.ProcessExpectCTHeader("preload", host_port, ssl_info); | 2059 state.ProcessExpectCTHeader("preload", host_port, ssl_info); |
| 2028 EXPECT_EQ(0u, reporter.num_failures()); | 2060 EXPECT_EQ(0u, reporter.num_failures()); |
| 2029 | 2061 |
| 2030 ssl_info.ct_cert_policy_compliance = | 2062 ssl_info.ct_cert_policy_compliance = |
| 2031 ct::CertPolicyCompliance::CERT_POLICY_NOT_DIVERSE_SCTS; | 2063 ct::CertPolicyCompliance::CERT_POLICY_NOT_DIVERSE_SCTS; |
| 2032 state.ProcessExpectCTHeader("preload", host_port, ssl_info); | 2064 state.ProcessExpectCTHeader("preload", host_port, ssl_info); |
| 2033 EXPECT_EQ(1u, reporter.num_failures()); | 2065 EXPECT_EQ(1u, reporter.num_failures()); |
| 2034 } | 2066 } |
| 2035 | 2067 |
| 2036 // Tests that the Expect CT reporter is not notified for a site that | 2068 // Tests that the Expect CT reporter is not notified for a site that |
| 2037 // isn't preloaded. | 2069 // isn't preloaded. |
| 2038 TEST_F(TransportSecurityStateTest, ExpectCTNotPreloaded) { | 2070 TEST_F(TransportSecurityStateTest, ExpectCTNotPreloaded) { |
| 2039 HostPortPair host_port("not-expect-ct-preloaded.test", 443); | 2071 HostPortPair host_port("not-expect-ct-preloaded.test", 443); |
| 2040 SSLInfo ssl_info; | 2072 SSLInfo ssl_info; |
| 2041 ssl_info.ct_compliance_details_available = true; | 2073 ssl_info.ct_compliance_details_available = true; |
| 2042 ssl_info.ct_cert_policy_compliance = | 2074 ssl_info.ct_cert_policy_compliance = |
| 2043 ct::CertPolicyCompliance::CERT_POLICY_NOT_DIVERSE_SCTS; | 2075 ct::CertPolicyCompliance::CERT_POLICY_NOT_DIVERSE_SCTS; |
| 2044 ssl_info.is_issued_by_known_root = true; | 2076 ssl_info.is_issued_by_known_root = true; |
| 2077 scoped_refptr<X509Certificate> cert1 = | |
| 2078 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); | |
| 2079 ASSERT_TRUE(cert1); | |
| 2080 scoped_refptr<X509Certificate> cert2 = | |
| 2081 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | |
| 2082 ASSERT_TRUE(cert2); | |
| 2083 ssl_info.unverified_cert = cert1; | |
| 2084 ssl_info.cert = cert2; | |
| 2045 | 2085 |
| 2046 TransportSecurityState state; | 2086 TransportSecurityState state; |
| 2047 TransportSecurityStateTest::EnableStaticExpectCT(&state); | 2087 TransportSecurityStateTest::EnableStaticExpectCT(&state); |
| 2048 MockExpectCTReporter reporter; | 2088 MockExpectCTReporter reporter; |
| 2049 state.SetExpectCTReporter(&reporter); | 2089 state.SetExpectCTReporter(&reporter); |
| 2050 state.ProcessExpectCTHeader("preload", host_port, ssl_info); | 2090 state.ProcessExpectCTHeader("preload", host_port, ssl_info); |
| 2051 EXPECT_EQ(0u, reporter.num_failures()); | 2091 EXPECT_EQ(0u, reporter.num_failures()); |
| 2052 | 2092 |
| 2053 host_port.set_host(kExpectCTStaticHostname); | 2093 host_port.set_host(kExpectCTStaticHostname); |
| 2054 state.ProcessExpectCTHeader("preload", host_port, ssl_info); | 2094 state.ProcessExpectCTHeader("preload", host_port, ssl_info); |
| 2055 EXPECT_EQ(1u, reporter.num_failures()); | 2095 EXPECT_EQ(1u, reporter.num_failures()); |
| 2056 } | 2096 } |
| 2057 | 2097 |
| 2058 // Tests that the Expect CT reporter is notified for noncompliant | 2098 // Tests that the Expect CT reporter is notified for noncompliant |
| 2059 // connections. | 2099 // connections. |
| 2060 TEST_F(TransportSecurityStateTest, ExpectCTReporter) { | 2100 TEST_F(TransportSecurityStateTest, ExpectCTReporter) { |
| 2061 HostPortPair host_port(kExpectCTStaticHostname, 443); | 2101 HostPortPair host_port(kExpectCTStaticHostname, 443); |
| 2062 SSLInfo ssl_info; | 2102 SSLInfo ssl_info; |
| 2063 ssl_info.ct_compliance_details_available = true; | 2103 ssl_info.ct_compliance_details_available = true; |
| 2064 ssl_info.ct_cert_policy_compliance = | 2104 ssl_info.ct_cert_policy_compliance = |
| 2065 ct::CertPolicyCompliance::CERT_POLICY_NOT_DIVERSE_SCTS; | 2105 ct::CertPolicyCompliance::CERT_POLICY_NOT_DIVERSE_SCTS; |
| 2066 ssl_info.is_issued_by_known_root = true; | 2106 ssl_info.is_issued_by_known_root = true; |
| 2067 scoped_refptr<X509Certificate> cert1 = | 2107 scoped_refptr<X509Certificate> cert1 = |
| 2068 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 2108 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 2069 scoped_refptr<X509Certificate> cert2 = | 2109 scoped_refptr<X509Certificate> cert2 = |
| 2070 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 2110 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 2071 ASSERT_TRUE(cert1); | 2111 ASSERT_TRUE(cert1); |
| 2072 ASSERT_TRUE(cert2); | 2112 ASSERT_TRUE(cert2); |
| 2073 ssl_info.unverified_cert = cert1; | 2113 ssl_info.unverified_cert = cert1; |
| 2074 ssl_info.cert = cert2; | 2114 ssl_info.cert = cert2; |
| 2075 MakeTestSCTAndStatus(ct::SignedCertificateTimestamp::SCT_EMBEDDED, "test_log", | 2115 MakeTestSCTAndStatus(ct::SignedCertificateTimestamp::SCT_EMBEDDED, "test_log", |
| 2076 std::string(), std::string(), base::Time::Now(), | 2116 std::string(), std::string(), base::Time::Now(), |
| 2077 ct::SCT_STATUS_INVALID_SIGNATURE, | 2117 ct::SCT_STATUS_INVALID_SIGNATURE, |
| 2078 &ssl_info.signed_certificate_timestamps); | 2118 &ssl_info.signed_certificate_timestamps); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 2099 // Tests that the Expect CT reporter is not notified for repeated noncompliant | 2139 // Tests that the Expect CT reporter is not notified for repeated noncompliant |
| 2100 // connections to the same preloaded host. | 2140 // connections to the same preloaded host. |
| 2101 TEST_F(TransportSecurityStateTest, RepeatedExpectCTReportsForStaticExpectCT) { | 2141 TEST_F(TransportSecurityStateTest, RepeatedExpectCTReportsForStaticExpectCT) { |
| 2102 HostPortPair host_port(kExpectCTStaticHostname, 443); | 2142 HostPortPair host_port(kExpectCTStaticHostname, 443); |
| 2103 SSLInfo ssl_info; | 2143 SSLInfo ssl_info; |
| 2104 ssl_info.ct_compliance_details_available = true; | 2144 ssl_info.ct_compliance_details_available = true; |
| 2105 ssl_info.ct_cert_policy_compliance = | 2145 ssl_info.ct_cert_policy_compliance = |
| 2106 ct::CertPolicyCompliance::CERT_POLICY_NOT_DIVERSE_SCTS; | 2146 ct::CertPolicyCompliance::CERT_POLICY_NOT_DIVERSE_SCTS; |
| 2107 ssl_info.is_issued_by_known_root = true; | 2147 ssl_info.is_issued_by_known_root = true; |
| 2108 scoped_refptr<X509Certificate> cert1 = | 2148 scoped_refptr<X509Certificate> cert1 = |
| 2109 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 2149 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 2150 ASSERT_TRUE(cert1); | |
| 2110 scoped_refptr<X509Certificate> cert2 = | 2151 scoped_refptr<X509Certificate> cert2 = |
| 2111 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 2152 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 2112 ASSERT_TRUE(cert1); | |
| 2113 ASSERT_TRUE(cert2); | 2153 ASSERT_TRUE(cert2); |
| 2114 ssl_info.unverified_cert = cert1; | 2154 ssl_info.unverified_cert = cert1; |
| 2115 ssl_info.cert = cert2; | 2155 ssl_info.cert = cert2; |
| 2116 MakeTestSCTAndStatus(ct::SignedCertificateTimestamp::SCT_EMBEDDED, "test_log", | 2156 MakeTestSCTAndStatus(ct::SignedCertificateTimestamp::SCT_EMBEDDED, "test_log", |
| 2117 std::string(), std::string(), base::Time::Now(), | 2157 std::string(), std::string(), base::Time::Now(), |
| 2118 ct::SCT_STATUS_INVALID_SIGNATURE, | 2158 ct::SCT_STATUS_INVALID_SIGNATURE, |
| 2119 &ssl_info.signed_certificate_timestamps); | 2159 &ssl_info.signed_certificate_timestamps); |
| 2120 | 2160 |
| 2121 TransportSecurityState state; | 2161 TransportSecurityState state; |
| 2122 TransportSecurityStateTest::EnableStaticExpectCT(&state); | 2162 TransportSecurityStateTest::EnableStaticExpectCT(&state); |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2421 MockCertificateReportSender reporter; | 2461 MockCertificateReportSender reporter; |
| 2422 ExpectStapleErrorResponseData test = GetParam(); | 2462 ExpectStapleErrorResponseData test = GetParam(); |
| 2423 | 2463 |
| 2424 std::string ocsp_response; | 2464 std::string ocsp_response; |
| 2425 if (test.response_status != OCSPVerifyResult::MISSING) | 2465 if (test.response_status != OCSPVerifyResult::MISSING) |
| 2426 ocsp_response = "dummy_response"; | 2466 ocsp_response = "dummy_response"; |
| 2427 | 2467 |
| 2428 // Two dummy certs to use as the server-sent and validated chains. The | 2468 // Two dummy certs to use as the server-sent and validated chains. The |
| 2429 // contents don't matter. | 2469 // contents don't matter. |
| 2430 scoped_refptr<X509Certificate> cert1 = | 2470 scoped_refptr<X509Certificate> cert1 = |
| 2431 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 2471 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 2472 ASSERT_TRUE(cert1); | |
| 2432 scoped_refptr<X509Certificate> cert2 = | 2473 scoped_refptr<X509Certificate> cert2 = |
| 2433 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 2474 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 2475 ASSERT_TRUE(cert2); | |
| 2434 | 2476 |
| 2435 SSLInfo ssl_info; | 2477 SSLInfo ssl_info; |
| 2436 ssl_info.cert = cert1; | 2478 ssl_info.cert = cert1; |
| 2437 ssl_info.unverified_cert = cert2; | 2479 ssl_info.unverified_cert = cert2; |
| 2438 ssl_info.ocsp_result.response_status = test.response_status; | 2480 ssl_info.ocsp_result.response_status = test.response_status; |
| 2439 | 2481 |
| 2440 // Reports should only be sent when |is_issued_by_known_root| is true. | 2482 // Reports should only be sent when |is_issued_by_known_root| is true. |
| 2441 ssl_info.is_issued_by_known_root = true; | 2483 ssl_info.is_issued_by_known_root = true; |
| 2442 ASSERT_NO_FATAL_FAILURE( | 2484 ASSERT_NO_FATAL_FAILURE( |
| 2443 CheckExpectStapleReport(&state, &reporter, ssl_info, ocsp_response, | 2485 CheckExpectStapleReport(&state, &reporter, ssl_info, ocsp_response, |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 2473 TEST_P(ExpectStapleErrorCertStatusTest, CheckCertStatusSerialization) { | 2515 TEST_P(ExpectStapleErrorCertStatusTest, CheckCertStatusSerialization) { |
| 2474 TransportSecurityState state; | 2516 TransportSecurityState state; |
| 2475 TransportSecurityStateTest::SetEnableStaticExpectStaple(&state, true); | 2517 TransportSecurityStateTest::SetEnableStaticExpectStaple(&state, true); |
| 2476 MockCertificateReportSender reporter; | 2518 MockCertificateReportSender reporter; |
| 2477 ExpectStapleErrorCertStatusData test = GetParam(); | 2519 ExpectStapleErrorCertStatusData test = GetParam(); |
| 2478 std::string ocsp_response = "dummy_response"; | 2520 std::string ocsp_response = "dummy_response"; |
| 2479 | 2521 |
| 2480 // Two dummy certs to use as the server-sent and validated chains. The | 2522 // Two dummy certs to use as the server-sent and validated chains. The |
| 2481 // contents don't matter. | 2523 // contents don't matter. |
| 2482 scoped_refptr<X509Certificate> cert1 = | 2524 scoped_refptr<X509Certificate> cert1 = |
| 2483 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 2525 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 2526 ASSERT_TRUE(cert1); | |
| 2484 scoped_refptr<X509Certificate> cert2 = | 2527 scoped_refptr<X509Certificate> cert2 = |
| 2485 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 2528 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 2529 ASSERT_TRUE(cert2); | |
| 2486 | 2530 |
| 2487 SSLInfo ssl_info; | 2531 SSLInfo ssl_info; |
| 2488 ssl_info.cert = cert1; | 2532 ssl_info.cert = cert1; |
| 2489 ssl_info.unverified_cert = cert2; | 2533 ssl_info.unverified_cert = cert2; |
| 2490 // |response_status| must be set to PROVIDED for |revocation_status| to have | 2534 // |response_status| must be set to PROVIDED for |revocation_status| to have |
| 2491 // meaning. | 2535 // meaning. |
| 2492 ssl_info.ocsp_result.response_status = OCSPVerifyResult::PROVIDED; | 2536 ssl_info.ocsp_result.response_status = OCSPVerifyResult::PROVIDED; |
| 2493 ssl_info.ocsp_result.revocation_status = test.revocation_status; | 2537 ssl_info.ocsp_result.revocation_status = test.revocation_status; |
| 2494 | 2538 |
| 2495 // Reports should only be sent when |is_issued_by_known_root| is true. | 2539 // Reports should only be sent when |is_issued_by_known_root| is true. |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 2514 TransportSecurityStateTest::SetEnableStaticExpectStaple(&state, true); | 2558 TransportSecurityStateTest::SetEnableStaticExpectStaple(&state, true); |
| 2515 MockCertificateReportSender reporter; | 2559 MockCertificateReportSender reporter; |
| 2516 state.SetReportSender(&reporter); | 2560 state.SetReportSender(&reporter); |
| 2517 | 2561 |
| 2518 // Baked-in preloaded Expect-Staple test hosts. | 2562 // Baked-in preloaded Expect-Staple test hosts. |
| 2519 HostPortPair host_port(kExpectStapleStaticHostname, 443); | 2563 HostPortPair host_port(kExpectStapleStaticHostname, 443); |
| 2520 | 2564 |
| 2521 // Two dummy certs to use as the server-sent and validated chains. The | 2565 // Two dummy certs to use as the server-sent and validated chains. The |
| 2522 // contents don't matter. | 2566 // contents don't matter. |
| 2523 scoped_refptr<X509Certificate> cert1 = | 2567 scoped_refptr<X509Certificate> cert1 = |
| 2524 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 2568 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 2569 ASSERT_TRUE(cert1); | |
| 2525 scoped_refptr<X509Certificate> cert2 = | 2570 scoped_refptr<X509Certificate> cert2 = |
| 2526 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 2571 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 2572 ASSERT_TRUE(cert2); | |
| 2527 | 2573 |
| 2528 SSLInfo ssl_info; | 2574 SSLInfo ssl_info; |
| 2529 ssl_info.cert = cert1; | 2575 ssl_info.cert = cert1; |
| 2530 ssl_info.unverified_cert = cert2; | 2576 ssl_info.unverified_cert = cert2; |
| 2531 ssl_info.ocsp_result.response_status = OCSPVerifyResult::PROVIDED; | 2577 ssl_info.ocsp_result.response_status = OCSPVerifyResult::PROVIDED; |
| 2532 ssl_info.ocsp_result.revocation_status = OCSPRevocationStatus::GOOD; | 2578 ssl_info.ocsp_result.revocation_status = OCSPRevocationStatus::GOOD; |
| 2533 | 2579 |
| 2534 std::string ocsp_response = "dummy response"; | 2580 std::string ocsp_response = "dummy response"; |
| 2535 | 2581 |
| 2536 ssl_info.is_issued_by_known_root = true; | 2582 ssl_info.is_issued_by_known_root = true; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 2548 TransportSecurityState state; | 2594 TransportSecurityState state; |
| 2549 TransportSecurityStateTest::SetEnableStaticExpectStaple(&state, true); | 2595 TransportSecurityStateTest::SetEnableStaticExpectStaple(&state, true); |
| 2550 MockCertificateReportSender reporter; | 2596 MockCertificateReportSender reporter; |
| 2551 state.SetReportSender(&reporter); | 2597 state.SetReportSender(&reporter); |
| 2552 | 2598 |
| 2553 HostPortPair host_port("not-preloaded.host.example", 443); | 2599 HostPortPair host_port("not-preloaded.host.example", 443); |
| 2554 | 2600 |
| 2555 // Two dummy certs to use as the server-sent and validated chains. The | 2601 // Two dummy certs to use as the server-sent and validated chains. The |
| 2556 // contents don't matter. | 2602 // contents don't matter. |
| 2557 scoped_refptr<X509Certificate> cert1 = | 2603 scoped_refptr<X509Certificate> cert1 = |
| 2558 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 2604 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 2605 ASSERT_TRUE(cert1); | |
| 2559 scoped_refptr<X509Certificate> cert2 = | 2606 scoped_refptr<X509Certificate> cert2 = |
| 2560 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 2607 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 2608 ASSERT_TRUE(cert2); | |
| 2561 | 2609 |
| 2562 SSLInfo ssl_info; | 2610 SSLInfo ssl_info; |
| 2563 ssl_info.cert = cert1; | 2611 ssl_info.cert = cert1; |
| 2564 ssl_info.unverified_cert = cert2; | 2612 ssl_info.unverified_cert = cert2; |
| 2565 ssl_info.ocsp_result.response_status = OCSPVerifyResult::MISSING; | 2613 ssl_info.ocsp_result.response_status = OCSPVerifyResult::MISSING; |
| 2566 | 2614 |
| 2567 // Empty response | 2615 // Empty response |
| 2568 std::string ocsp_response; | 2616 std::string ocsp_response; |
| 2569 | 2617 |
| 2570 ssl_info.is_issued_by_known_root = true; | 2618 ssl_info.is_issued_by_known_root = true; |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2901 | 2949 |
| 2902 // Tests that the Expect-CT reporter is not notified for repeated dynamic | 2950 // Tests that the Expect-CT reporter is not notified for repeated dynamic |
| 2903 // Expect-CT violations for the same host/port. | 2951 // Expect-CT violations for the same host/port. |
| 2904 TEST_F(TransportSecurityStateTest, DynamicExpectCTDeduping) { | 2952 TEST_F(TransportSecurityStateTest, DynamicExpectCTDeduping) { |
| 2905 const char kHeader[] = "max-age=123,enforce,report-uri=\"http://foo.test\""; | 2953 const char kHeader[] = "max-age=123,enforce,report-uri=\"http://foo.test\""; |
| 2906 SSLInfo ssl; | 2954 SSLInfo ssl; |
| 2907 ssl.is_issued_by_known_root = true; | 2955 ssl.is_issued_by_known_root = true; |
| 2908 ssl.ct_compliance_details_available = true; | 2956 ssl.ct_compliance_details_available = true; |
| 2909 ssl.ct_cert_policy_compliance = | 2957 ssl.ct_cert_policy_compliance = |
| 2910 ct::CertPolicyCompliance::CERT_POLICY_COMPLIES_VIA_SCTS; | 2958 ct::CertPolicyCompliance::CERT_POLICY_COMPLIES_VIA_SCTS; |
| 2959 | |
| 2911 scoped_refptr<X509Certificate> cert1 = | 2960 scoped_refptr<X509Certificate> cert1 = |
| 2912 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 2961 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 2962 ASSERT_TRUE(cert1); | |
| 2913 scoped_refptr<X509Certificate> cert2 = | 2963 scoped_refptr<X509Certificate> cert2 = |
| 2914 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 2964 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 2915 ASSERT_TRUE(cert1); | |
| 2916 ASSERT_TRUE(cert2); | 2965 ASSERT_TRUE(cert2); |
| 2966 | |
| 2917 SignedCertificateTimestampAndStatusList sct_list; | 2967 SignedCertificateTimestampAndStatusList sct_list; |
| 2918 | 2968 |
| 2919 base::test::ScopedFeatureList feature_list; | 2969 base::test::ScopedFeatureList feature_list; |
| 2920 feature_list.InitAndEnableFeature( | 2970 feature_list.InitAndEnableFeature( |
| 2921 TransportSecurityState::kDynamicExpectCTFeature); | 2971 TransportSecurityState::kDynamicExpectCTFeature); |
| 2922 base::Time now = base::Time::Now(); | 2972 base::Time now = base::Time::Now(); |
| 2923 TransportSecurityState state; | 2973 TransportSecurityState state; |
| 2924 MockExpectCTReporter reporter; | 2974 MockExpectCTReporter reporter; |
| 2925 state.SetExpectCTReporter(&reporter); | 2975 state.SetExpectCTReporter(&reporter); |
| 2926 state.ProcessExpectCTHeader(kHeader, HostPortPair("example.test", 443), ssl); | 2976 state.ProcessExpectCTHeader(kHeader, HostPortPair("example.test", 443), ssl); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3068 // Tests that dynamic Expect-CT is not processed when CT compliance status | 3118 // Tests that dynamic Expect-CT is not processed when CT compliance status |
| 3069 // wasn't computed. | 3119 // wasn't computed. |
| 3070 TEST_F(TransportSecurityStateTest, DynamicExpectCTNoComplianceDetails) { | 3120 TEST_F(TransportSecurityStateTest, DynamicExpectCTNoComplianceDetails) { |
| 3071 const char kHeader[] = "max-age=123,enforce,report-uri=\"http://foo.test\""; | 3121 const char kHeader[] = "max-age=123,enforce,report-uri=\"http://foo.test\""; |
| 3072 SSLInfo ssl; | 3122 SSLInfo ssl; |
| 3073 ssl.is_issued_by_known_root = true; | 3123 ssl.is_issued_by_known_root = true; |
| 3074 ssl.ct_compliance_details_available = false; | 3124 ssl.ct_compliance_details_available = false; |
| 3075 ssl.ct_cert_policy_compliance = | 3125 ssl.ct_cert_policy_compliance = |
| 3076 ct::CertPolicyCompliance::CERT_POLICY_NOT_ENOUGH_SCTS; | 3126 ct::CertPolicyCompliance::CERT_POLICY_NOT_ENOUGH_SCTS; |
| 3077 | 3127 |
| 3128 scoped_refptr<X509Certificate> cert1 = | |
| 3129 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); | |
| 3130 ASSERT_TRUE(cert1); | |
| 3131 scoped_refptr<X509Certificate> cert2 = | |
| 3132 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | |
| 3133 ASSERT_TRUE(cert2); | |
| 3134 ssl.unverified_cert = cert1; | |
| 3135 ssl.cert = cert2; | |
| 3136 | |
| 3078 base::test::ScopedFeatureList feature_list; | 3137 base::test::ScopedFeatureList feature_list; |
| 3079 feature_list.InitAndEnableFeature( | 3138 feature_list.InitAndEnableFeature( |
| 3080 TransportSecurityState::kDynamicExpectCTFeature); | 3139 TransportSecurityState::kDynamicExpectCTFeature); |
| 3081 TransportSecurityState state; | 3140 TransportSecurityState state; |
| 3082 MockExpectCTReporter reporter; | 3141 MockExpectCTReporter reporter; |
| 3083 state.SetExpectCTReporter(&reporter); | 3142 state.SetExpectCTReporter(&reporter); |
| 3084 state.ProcessExpectCTHeader(kHeader, HostPortPair("example.test", 443), ssl); | 3143 state.ProcessExpectCTHeader(kHeader, HostPortPair("example.test", 443), ssl); |
| 3085 TransportSecurityState::ExpectCTState expect_ct_state; | 3144 TransportSecurityState::ExpectCTState expect_ct_state; |
| 3086 EXPECT_FALSE(state.GetDynamicExpectCTState("example.test", &expect_ct_state)); | 3145 EXPECT_FALSE(state.GetDynamicExpectCTState("example.test", &expect_ct_state)); |
| 3087 EXPECT_EQ(0u, reporter.num_failures()); | 3146 EXPECT_EQ(0u, reporter.num_failures()); |
| 3088 } | 3147 } |
| 3089 | 3148 |
| 3090 // Tests that Expect-CT reports are sent when an Expect-CT header is received | 3149 // Tests that Expect-CT reports are sent when an Expect-CT header is received |
| 3091 // over a non-compliant connection. | 3150 // over a non-compliant connection. |
| 3092 TEST_F(TransportSecurityStateTest, | 3151 TEST_F(TransportSecurityStateTest, |
| 3093 DynamicExpectCTHeaderProcessingNonCompliant) { | 3152 DynamicExpectCTHeaderProcessingNonCompliant) { |
| 3094 const char kHeader[] = "max-age=123,enforce,report-uri=\"http://foo.test\""; | 3153 const char kHeader[] = "max-age=123,enforce,report-uri=\"http://foo.test\""; |
| 3095 SSLInfo ssl; | 3154 SSLInfo ssl; |
| 3096 ssl.is_issued_by_known_root = true; | 3155 ssl.is_issued_by_known_root = true; |
| 3097 ssl.ct_compliance_details_available = true; | 3156 ssl.ct_compliance_details_available = true; |
| 3098 ssl.ct_cert_policy_compliance = | 3157 ssl.ct_cert_policy_compliance = |
| 3099 ct::CertPolicyCompliance::CERT_POLICY_NOT_ENOUGH_SCTS; | 3158 ct::CertPolicyCompliance::CERT_POLICY_NOT_ENOUGH_SCTS; |
| 3159 | |
| 3100 scoped_refptr<X509Certificate> cert1 = | 3160 scoped_refptr<X509Certificate> cert1 = |
| 3101 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 3161 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 3162 ASSERT_TRUE(cert1); | |
| 3102 scoped_refptr<X509Certificate> cert2 = | 3163 scoped_refptr<X509Certificate> cert2 = |
| 3103 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 3164 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 3104 ASSERT_TRUE(cert1); | |
| 3105 ASSERT_TRUE(cert2); | 3165 ASSERT_TRUE(cert2); |
| 3106 ssl.unverified_cert = cert1; | 3166 ssl.unverified_cert = cert1; |
| 3107 ssl.cert = cert2; | 3167 ssl.cert = cert2; |
| 3168 | |
| 3108 MakeTestSCTAndStatus(ct::SignedCertificateTimestamp::SCT_EMBEDDED, "test_log", | 3169 MakeTestSCTAndStatus(ct::SignedCertificateTimestamp::SCT_EMBEDDED, "test_log", |
| 3109 std::string(), std::string(), base::Time::Now(), | 3170 std::string(), std::string(), base::Time::Now(), |
| 3110 ct::SCT_STATUS_INVALID_SIGNATURE, | 3171 ct::SCT_STATUS_INVALID_SIGNATURE, |
| 3111 &ssl.signed_certificate_timestamps); | 3172 &ssl.signed_certificate_timestamps); |
| 3112 | 3173 |
| 3113 base::test::ScopedFeatureList feature_list; | 3174 base::test::ScopedFeatureList feature_list; |
| 3114 feature_list.InitAndEnableFeature( | 3175 feature_list.InitAndEnableFeature( |
| 3115 TransportSecurityState::kDynamicExpectCTFeature); | 3176 TransportSecurityState::kDynamicExpectCTFeature); |
| 3116 TransportSecurityState state; | 3177 TransportSecurityState state; |
| 3117 MockExpectCTReporter reporter; | 3178 MockExpectCTReporter reporter; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 3130 EXPECT_EQ(ssl.signed_certificate_timestamps[0].sct, | 3191 EXPECT_EQ(ssl.signed_certificate_timestamps[0].sct, |
| 3131 reporter.signed_certificate_timestamps()[0].sct); | 3192 reporter.signed_certificate_timestamps()[0].sct); |
| 3132 } | 3193 } |
| 3133 | 3194 |
| 3134 // Tests that CheckCTRequirements() returns false if a connection to a host | 3195 // Tests that CheckCTRequirements() returns false if a connection to a host |
| 3135 // violates an Expect-CT header, and that it reports violations. | 3196 // violates an Expect-CT header, and that it reports violations. |
| 3136 TEST_F(TransportSecurityStateTest, CheckCTRequirementsWithExpectCT) { | 3197 TEST_F(TransportSecurityStateTest, CheckCTRequirementsWithExpectCT) { |
| 3137 const base::Time current_time(base::Time::Now()); | 3198 const base::Time current_time(base::Time::Now()); |
| 3138 const base::Time expiry = current_time + base::TimeDelta::FromSeconds(1000); | 3199 const base::Time expiry = current_time + base::TimeDelta::FromSeconds(1000); |
| 3139 scoped_refptr<X509Certificate> cert1 = | 3200 scoped_refptr<X509Certificate> cert1 = |
| 3140 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 3201 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 3202 ASSERT_TRUE(cert1); | |
| 3141 scoped_refptr<X509Certificate> cert2 = | 3203 scoped_refptr<X509Certificate> cert2 = |
| 3142 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 3204 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 3143 ASSERT_TRUE(cert1); | |
| 3144 ASSERT_TRUE(cert2); | 3205 ASSERT_TRUE(cert2); |
| 3145 SignedCertificateTimestampAndStatusList sct_list; | 3206 SignedCertificateTimestampAndStatusList sct_list; |
| 3146 MakeTestSCTAndStatus(ct::SignedCertificateTimestamp::SCT_EMBEDDED, "test_log", | 3207 MakeTestSCTAndStatus(ct::SignedCertificateTimestamp::SCT_EMBEDDED, "test_log", |
| 3147 std::string(), std::string(), base::Time::Now(), | 3208 std::string(), std::string(), base::Time::Now(), |
| 3148 ct::SCT_STATUS_INVALID_SIGNATURE, &sct_list); | 3209 ct::SCT_STATUS_INVALID_SIGNATURE, &sct_list); |
| 3149 | 3210 |
| 3150 base::test::ScopedFeatureList feature_list; | 3211 base::test::ScopedFeatureList feature_list; |
| 3151 feature_list.InitAndEnableFeature( | 3212 feature_list.InitAndEnableFeature( |
| 3152 TransportSecurityState::kDynamicExpectCTFeature); | 3213 TransportSecurityState::kDynamicExpectCTFeature); |
| 3153 | 3214 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3259 // Expect-CT-enabled, CheckCTRequirements() sends reports. | 3320 // Expect-CT-enabled, CheckCTRequirements() sends reports. |
| 3260 TEST_F(TransportSecurityStateTest, CheckCTRequirementsWithExpectCTAndDelegate) { | 3321 TEST_F(TransportSecurityStateTest, CheckCTRequirementsWithExpectCTAndDelegate) { |
| 3261 using ::testing::_; | 3322 using ::testing::_; |
| 3262 using ::testing::Return; | 3323 using ::testing::Return; |
| 3263 using CTRequirementLevel = | 3324 using CTRequirementLevel = |
| 3264 TransportSecurityState::RequireCTDelegate::CTRequirementLevel; | 3325 TransportSecurityState::RequireCTDelegate::CTRequirementLevel; |
| 3265 | 3326 |
| 3266 const base::Time current_time(base::Time::Now()); | 3327 const base::Time current_time(base::Time::Now()); |
| 3267 const base::Time expiry = current_time + base::TimeDelta::FromSeconds(1000); | 3328 const base::Time expiry = current_time + base::TimeDelta::FromSeconds(1000); |
| 3268 scoped_refptr<X509Certificate> cert1 = | 3329 scoped_refptr<X509Certificate> cert1 = |
| 3269 ImportCertFromFile(GetTestCertsDirectory(), "test_mail_google_com.pem"); | 3330 ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); |
| 3331 ASSERT_TRUE(cert1); | |
| 3270 scoped_refptr<X509Certificate> cert2 = | 3332 scoped_refptr<X509Certificate> cert2 = |
| 3271 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); | 3333 ImportCertFromFile(GetTestCertsDirectory(), "expired_cert.pem"); |
| 3272 ASSERT_TRUE(cert1); | |
| 3273 ASSERT_TRUE(cert2); | 3334 ASSERT_TRUE(cert2); |
| 3274 SignedCertificateTimestampAndStatusList sct_list; | 3335 SignedCertificateTimestampAndStatusList sct_list; |
| 3275 MakeTestSCTAndStatus(ct::SignedCertificateTimestamp::SCT_EMBEDDED, "test_log", | 3336 MakeTestSCTAndStatus(ct::SignedCertificateTimestamp::SCT_EMBEDDED, "test_log", |
| 3276 std::string(), std::string(), base::Time::Now(), | 3337 std::string(), std::string(), base::Time::Now(), |
| 3277 ct::SCT_STATUS_INVALID_SIGNATURE, &sct_list); | 3338 ct::SCT_STATUS_INVALID_SIGNATURE, &sct_list); |
| 3278 | 3339 |
| 3279 base::test::ScopedFeatureList feature_list; | 3340 base::test::ScopedFeatureList feature_list; |
| 3280 feature_list.InitAndEnableFeature( | 3341 feature_list.InitAndEnableFeature( |
| 3281 TransportSecurityState::kDynamicExpectCTFeature); | 3342 TransportSecurityState::kDynamicExpectCTFeature); |
| 3282 | 3343 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 3303 EXPECT_EQ(443, reporter.host_port_pair().port()); | 3364 EXPECT_EQ(443, reporter.host_port_pair().port()); |
| 3304 EXPECT_EQ(cert1.get(), reporter.validated_certificate_chain()); | 3365 EXPECT_EQ(cert1.get(), reporter.validated_certificate_chain()); |
| 3305 EXPECT_EQ(cert2.get(), reporter.served_certificate_chain()); | 3366 EXPECT_EQ(cert2.get(), reporter.served_certificate_chain()); |
| 3306 EXPECT_EQ(sct_list.size(), reporter.signed_certificate_timestamps().size()); | 3367 EXPECT_EQ(sct_list.size(), reporter.signed_certificate_timestamps().size()); |
| 3307 EXPECT_EQ(sct_list[0].status, | 3368 EXPECT_EQ(sct_list[0].status, |
| 3308 reporter.signed_certificate_timestamps()[0].status); | 3369 reporter.signed_certificate_timestamps()[0].status); |
| 3309 EXPECT_EQ(sct_list[0].sct, reporter.signed_certificate_timestamps()[0].sct); | 3370 EXPECT_EQ(sct_list[0].sct, reporter.signed_certificate_timestamps()[0].sct); |
| 3310 } | 3371 } |
| 3311 | 3372 |
| 3312 } // namespace net | 3373 } // namespace net |
| OLD | NEW |