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

Side by Side Diff: net/socket/ssl_client_socket_unittest.cc

Issue 2901183002: Do not send repeated Expect-CT reports to the same host+port (Closed)
Patch Set: fix comment typo Created 3 years, 7 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 | « net/http/transport_security_state_unittest.cc ('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 (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/socket/ssl_client_socket.h" 5 #include "net/socket/ssl_client_socket.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 3502 matching lines...) Expand 10 before | Expand all | Expand 10 after
3513 CERT_STATUS_CERTIFICATE_TRANSPARENCY_REQUIRED); 3513 CERT_STATUS_CERTIFICATE_TRANSPARENCY_REQUIRED);
3514 EXPECT_TRUE(sock_->IsConnected()); 3514 EXPECT_TRUE(sock_->IsConnected());
3515 3515
3516 EXPECT_EQ(1u, reporter.num_failures()); 3516 EXPECT_EQ(1u, reporter.num_failures());
3517 EXPECT_EQ(GURL("https://example-report.test"), reporter.report_uri()); 3517 EXPECT_EQ(GURL("https://example-report.test"), reporter.report_uri());
3518 EXPECT_EQ(ssl_info.unverified_cert.get(), 3518 EXPECT_EQ(ssl_info.unverified_cert.get(),
3519 reporter.served_certificate_chain()); 3519 reporter.served_certificate_chain());
3520 EXPECT_EQ(ssl_info.cert.get(), reporter.validated_certificate_chain()); 3520 EXPECT_EQ(ssl_info.cert.get(), reporter.validated_certificate_chain());
3521 EXPECT_EQ(0u, reporter.signed_certificate_timestamps().size()); 3521 EXPECT_EQ(0u, reporter.signed_certificate_timestamps().size());
3522 3522
3523 transport_security_state_->ClearReportCachesForTesting();
3523 EXPECT_CALL(*ct_policy_enforcer_, 3524 EXPECT_CALL(*ct_policy_enforcer_,
3524 DoesConformToCertPolicy(server_cert.get(), _, _)) 3525 DoesConformToCertPolicy(server_cert.get(), _, _))
3525 .WillRepeatedly( 3526 .WillRepeatedly(
3526 Return(ct::CertPolicyCompliance::CERT_POLICY_NOT_DIVERSE_SCTS)); 3527 Return(ct::CertPolicyCompliance::CERT_POLICY_NOT_DIVERSE_SCTS));
3527 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); 3528 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv));
3528 ASSERT_TRUE(sock_->GetSSLInfo(&ssl_info)); 3529 ASSERT_TRUE(sock_->GetSSLInfo(&ssl_info));
3529 3530
3530 EXPECT_THAT(rv, IsError(ERR_CERTIFICATE_TRANSPARENCY_REQUIRED)); 3531 EXPECT_THAT(rv, IsError(ERR_CERTIFICATE_TRANSPARENCY_REQUIRED));
3531 EXPECT_TRUE(ssl_info.cert_status & 3532 EXPECT_TRUE(ssl_info.cert_status &
3532 CERT_STATUS_CERTIFICATE_TRANSPARENCY_REQUIRED); 3533 CERT_STATUS_CERTIFICATE_TRANSPARENCY_REQUIRED);
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
4000 // The read buffer should be released. 4001 // The read buffer should be released.
4001 StreamSocket::SocketMemoryStats stats; 4002 StreamSocket::SocketMemoryStats stats;
4002 client->DumpMemoryStats(&stats); 4003 client->DumpMemoryStats(&stats);
4003 EXPECT_EQ(0u, stats.buffer_size); 4004 EXPECT_EQ(0u, stats.buffer_size);
4004 EXPECT_EQ(1u, stats.cert_count); 4005 EXPECT_EQ(1u, stats.cert_count);
4005 EXPECT_LT(0u, stats.cert_size); 4006 EXPECT_LT(0u, stats.cert_size);
4006 EXPECT_EQ(stats.cert_size, stats.total_size); 4007 EXPECT_EQ(stats.cert_size, stats.total_size);
4007 } 4008 }
4008 4009
4009 } // namespace net 4010 } // namespace net
OLDNEW
« no previous file with comments | « net/http/transport_security_state_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698