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

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

Issue 2944953002: Add effective-expiration-date to Expect-CT reports (Closed)
Patch Set: meacer comments Created 3 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 | « net/http/transport_security_state_unittest.cc ('k') | net/url_request/url_request_unittest.cc » ('j') | 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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 807
808 // A mock ExpectCTReporter that remembers the latest violation that was 808 // A mock ExpectCTReporter that remembers the latest violation that was
809 // reported and the number of violations reported. 809 // reported and the number of violations reported.
810 class MockExpectCTReporter : public TransportSecurityState::ExpectCTReporter { 810 class MockExpectCTReporter : public TransportSecurityState::ExpectCTReporter {
811 public: 811 public:
812 MockExpectCTReporter() : num_failures_(0) {} 812 MockExpectCTReporter() : num_failures_(0) {}
813 ~MockExpectCTReporter() override {} 813 ~MockExpectCTReporter() override {}
814 814
815 void OnExpectCTFailed(const HostPortPair& host_port_pair, 815 void OnExpectCTFailed(const HostPortPair& host_port_pair,
816 const GURL& report_uri, 816 const GURL& report_uri,
817 base::Time expiration,
817 const X509Certificate* validated_certificate_chain, 818 const X509Certificate* validated_certificate_chain,
818 const X509Certificate* served_certificate_chain, 819 const X509Certificate* served_certificate_chain,
819 const SignedCertificateTimestampAndStatusList& 820 const SignedCertificateTimestampAndStatusList&
820 signed_certificate_timestamps) override { 821 signed_certificate_timestamps) override {
821 num_failures_++; 822 num_failures_++;
822 host_port_pair_ = host_port_pair; 823 host_port_pair_ = host_port_pair;
823 report_uri_ = report_uri; 824 report_uri_ = report_uri;
824 served_certificate_chain_ = served_certificate_chain; 825 served_certificate_chain_ = served_certificate_chain;
825 validated_certificate_chain_ = validated_certificate_chain; 826 validated_certificate_chain_ = validated_certificate_chain;
826 signed_certificate_timestamps_ = signed_certificate_timestamps; 827 signed_certificate_timestamps_ = signed_certificate_timestamps;
(...skipping 3160 matching lines...) Expand 10 before | Expand all | Expand 10 after
3987 // The read buffer should be released. 3988 // The read buffer should be released.
3988 StreamSocket::SocketMemoryStats stats; 3989 StreamSocket::SocketMemoryStats stats;
3989 client->DumpMemoryStats(&stats); 3990 client->DumpMemoryStats(&stats);
3990 EXPECT_EQ(0u, stats.buffer_size); 3991 EXPECT_EQ(0u, stats.buffer_size);
3991 EXPECT_EQ(1u, stats.cert_count); 3992 EXPECT_EQ(1u, stats.cert_count);
3992 EXPECT_LT(0u, stats.cert_size); 3993 EXPECT_LT(0u, stats.cert_size);
3993 EXPECT_EQ(stats.cert_size, stats.total_size); 3994 EXPECT_EQ(stats.cert_size, stats.total_size);
3994 } 3995 }
3995 3996
3996 } // namespace net 3997 } // namespace net
OLDNEW
« no previous file with comments | « net/http/transport_security_state_unittest.cc ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698