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

Unified Diff: net/socket/ssl_client_socket_unittest.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: rebase Created 4 years, 10 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
« no previous file with comments | « net/socket/ssl_client_socket_openssl.cc ('k') | net/ssl/ssl_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_unittest.cc
diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc
index d54f0035cfbdd0dc592e45aae9abe756bba6ba6f..ba92459763e5bd7483d319e36d3aca76b708bc13 100644
--- a/net/socket/ssl_client_socket_unittest.cc
+++ b/net/socket/ssl_client_socket_unittest.cc
@@ -699,6 +699,10 @@ class MockCTVerifier : public CTVerifier {
// A mock CTPolicyEnforcer that returns a custom verification result.
class MockCTPolicyEnforcer : public CTPolicyEnforcer {
public:
+ MOCK_METHOD3(DoesConformToCertPolicy,
+ ct::CertPolicyCompliance(X509Certificate* cert,
+ const ct::SCTList&,
+ const BoundNetLog&));
MOCK_METHOD4(DoesConformToCTEVPolicy,
ct::EVPolicyCompliance(X509Certificate* cert,
const ct::EVCertsWhitelist*,
@@ -2349,6 +2353,9 @@ TEST_F(SSLClientSocketTest, EVCertStatusMaintainedForCompliantCert) {
// Emulate compliance of the certificate to the policy.
MockCTPolicyEnforcer policy_enforcer;
SetCTPolicyEnforcer(&policy_enforcer);
+ EXPECT_CALL(policy_enforcer, DoesConformToCertPolicy(_, _, _))
+ .WillRepeatedly(
+ Return(ct::CertPolicyCompliance::CERT_POLICY_COMPLIES_VIA_SCTS));
EXPECT_CALL(policy_enforcer, DoesConformToCTEVPolicy(_, _, _, _))
.WillRepeatedly(
Return(ct::EVPolicyCompliance::EV_POLICY_COMPLIES_VIA_SCTS));
@@ -2382,6 +2389,9 @@ TEST_F(SSLClientSocketTest, EVCertStatusRemovedForNonCompliantCert) {
// Emulate non-compliance of the certificate to the policy.
MockCTPolicyEnforcer policy_enforcer;
SetCTPolicyEnforcer(&policy_enforcer);
+ EXPECT_CALL(policy_enforcer, DoesConformToCertPolicy(_, _, _))
+ .WillRepeatedly(
+ Return(ct::CertPolicyCompliance::CERT_POLICY_NOT_ENOUGH_SCTS));
EXPECT_CALL(policy_enforcer, DoesConformToCTEVPolicy(_, _, _, _))
.WillRepeatedly(
Return(ct::EVPolicyCompliance::EV_POLICY_NOT_ENOUGH_SCTS));
« no previous file with comments | « net/socket/ssl_client_socket_openssl.cc ('k') | net/ssl/ssl_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698