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

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

Issue 2400183002: Cleanup: More accurate output parameter type for CTVerifier (Closed)
Patch Set: IWYU, review comments Created 4 years, 2 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/socket/ssl_client_socket_unittest.cc ('k') | net/spdy/spdy_test_util_common.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 // This test suite uses SSLClientSocket to test the implementation of 5 // This test suite uses SSLClientSocket to test the implementation of
6 // SSLServerSocket. In order to establish connections between the sockets 6 // SSLServerSocket. In order to establish connections between the sockets
7 // we need two additional classes: 7 // we need two additional classes:
8 // 1. FakeSocket 8 // 1. FakeSocket
9 // Connects SSL socket to FakeDataChannel. This class is just a stub. 9 // Connects SSL socket to FakeDataChannel. This class is just a stub.
10 // 10 //
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "net/base/io_buffer.h" 46 #include "net/base/io_buffer.h"
47 #include "net/base/ip_address.h" 47 #include "net/base/ip_address.h"
48 #include "net/base/ip_endpoint.h" 48 #include "net/base/ip_endpoint.h"
49 #include "net/base/net_errors.h" 49 #include "net/base/net_errors.h"
50 #include "net/cert/cert_status_flags.h" 50 #include "net/cert/cert_status_flags.h"
51 #include "net/cert/ct_policy_enforcer.h" 51 #include "net/cert/ct_policy_enforcer.h"
52 #include "net/cert/ct_policy_status.h" 52 #include "net/cert/ct_policy_status.h"
53 #include "net/cert/ct_verifier.h" 53 #include "net/cert/ct_verifier.h"
54 #include "net/cert/mock_cert_verifier.h" 54 #include "net/cert/mock_cert_verifier.h"
55 #include "net/cert/mock_client_cert_verifier.h" 55 #include "net/cert/mock_client_cert_verifier.h"
56 #include "net/cert/signed_certificate_timestamp_and_status.h"
56 #include "net/cert/x509_certificate.h" 57 #include "net/cert/x509_certificate.h"
57 #include "net/http/transport_security_state.h" 58 #include "net/http/transport_security_state.h"
58 #include "net/log/net_log_with_source.h" 59 #include "net/log/net_log_with_source.h"
59 #include "net/socket/client_socket_factory.h" 60 #include "net/socket/client_socket_factory.h"
60 #include "net/socket/socket_test_util.h" 61 #include "net/socket/socket_test_util.h"
61 #include "net/socket/ssl_client_socket.h" 62 #include "net/socket/ssl_client_socket.h"
62 #include "net/socket/stream_socket.h" 63 #include "net/socket/stream_socket.h"
63 #include "net/ssl/scoped_openssl_types.h" 64 #include "net/ssl/scoped_openssl_types.h"
64 #include "net/ssl/ssl_cert_request_info.h" 65 #include "net/ssl/ssl_cert_request_info.h"
65 #include "net/ssl/ssl_cipher_suite_names.h" 66 #include "net/ssl/ssl_cipher_suite_names.h"
(...skipping 23 matching lines...) Expand all
89 const char kClientCertCAFileName[] = "client_1_ca.pem"; 90 const char kClientCertCAFileName[] = "client_1_ca.pem";
90 91
91 class MockCTVerifier : public CTVerifier { 92 class MockCTVerifier : public CTVerifier {
92 public: 93 public:
93 MockCTVerifier() = default; 94 MockCTVerifier() = default;
94 ~MockCTVerifier() override = default; 95 ~MockCTVerifier() override = default;
95 96
96 int Verify(X509Certificate* cert, 97 int Verify(X509Certificate* cert,
97 const std::string& stapled_ocsp_response, 98 const std::string& stapled_ocsp_response,
98 const std::string& sct_list_from_tls_extension, 99 const std::string& sct_list_from_tls_extension,
99 ct::CTVerifyResult* result, 100 SignedCertificateTimestampAndStatusList* output_scts,
100 const NetLogWithSource& net_log) override { 101 const NetLogWithSource& net_log) override {
101 return net::OK; 102 return net::OK;
102 } 103 }
103 104
104 void SetObserver(Observer* observer) override {} 105 void SetObserver(Observer* observer) override {}
105 }; 106 };
106 107
107 class MockCTPolicyEnforcer : public CTPolicyEnforcer { 108 class MockCTPolicyEnforcer : public CTPolicyEnforcer {
108 public: 109 public:
109 MockCTPolicyEnforcer() = default; 110 MockCTPolicyEnforcer() = default;
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 int server_ret = server_socket_->Handshake(handshake_callback.callback()); 1114 int server_ret = server_socket_->Handshake(handshake_callback.callback());
1114 1115
1115 client_ret = connect_callback.GetResult(client_ret); 1116 client_ret = connect_callback.GetResult(client_ret);
1116 server_ret = handshake_callback.GetResult(server_ret); 1117 server_ret = handshake_callback.GetResult(server_ret);
1117 1118
1118 ASSERT_THAT(client_ret, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH)); 1119 ASSERT_THAT(client_ret, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH));
1119 ASSERT_THAT(server_ret, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH)); 1120 ASSERT_THAT(server_ret, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH));
1120 } 1121 }
1121 1122
1122 } // namespace net 1123 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_unittest.cc ('k') | net/spdy/spdy_test_util_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698