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

Side by Side Diff: remoting/signaling/xmpp_signal_strategy.cc

Issue 2067843003: Require a CTVerifier and CTPolicyEnforcer for TLS/QUIC sockets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixup Created 4 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 | « remoting/protocol/ssl_hmac_channel_authenticator.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "remoting/signaling/xmpp_signal_strategy.h" 5 #include "remoting/signaling/xmpp_signal_strategy.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/observer_list.h" 14 #include "base/observer_list.h"
15 #include "base/rand_util.h" 15 #include "base/rand_util.h"
16 #include "base/single_thread_task_runner.h" 16 #include "base/single_thread_task_runner.h"
17 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
18 #include "base/threading/thread_checker.h" 18 #include "base/threading/thread_checker.h"
19 #include "base/threading/thread_task_runner_handle.h" 19 #include "base/threading/thread_task_runner_handle.h"
20 #include "base/time/time.h" 20 #include "base/time/time.h"
21 #include "base/timer/timer.h" 21 #include "base/timer/timer.h"
22 #include "jingle/glue/proxy_resolving_client_socket.h" 22 #include "jingle/glue/proxy_resolving_client_socket.h"
23 #include "net/cert/cert_verifier.h" 23 #include "net/cert/cert_verifier.h"
24 #include "net/cert/ct_policy_enforcer.h"
25 #include "net/cert/multi_log_ct_verifier.h"
24 #include "net/http/transport_security_state.h" 26 #include "net/http/transport_security_state.h"
25 #include "net/socket/client_socket_factory.h" 27 #include "net/socket/client_socket_factory.h"
26 #include "net/socket/client_socket_handle.h" 28 #include "net/socket/client_socket_handle.h"
27 #include "net/socket/ssl_client_socket.h" 29 #include "net/socket/ssl_client_socket.h"
28 #include "net/url_request/url_request_context_getter.h" 30 #include "net/url_request/url_request_context_getter.h"
29 #include "remoting/base/buffered_socket_writer.h" 31 #include "remoting/base/buffered_socket_writer.h"
30 #include "remoting/signaling/xmpp_login_handler.h" 32 #include "remoting/signaling/xmpp_login_handler.h"
31 #include "remoting/signaling/xmpp_stream_parser.h" 33 #include "remoting/signaling/xmpp_stream_parser.h"
32 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" 34 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h"
33 35
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 115
114 void SendKeepAlive(); 116 void SendKeepAlive();
115 117
116 net::ClientSocketFactory* socket_factory_; 118 net::ClientSocketFactory* socket_factory_;
117 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; 119 scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
118 XmppServerConfig xmpp_server_config_; 120 XmppServerConfig xmpp_server_config_;
119 121
120 // Used by the |socket_|. 122 // Used by the |socket_|.
121 std::unique_ptr<net::CertVerifier> cert_verifier_; 123 std::unique_ptr<net::CertVerifier> cert_verifier_;
122 std::unique_ptr<net::TransportSecurityState> transport_security_state_; 124 std::unique_ptr<net::TransportSecurityState> transport_security_state_;
125 std::unique_ptr<net::CTVerifier> cert_transparency_verifier_;
126 std::unique_ptr<net::CTPolicyEnforcer> ct_policy_enforcer_;
123 127
124 std::unique_ptr<net::StreamSocket> socket_; 128 std::unique_ptr<net::StreamSocket> socket_;
125 std::unique_ptr<BufferedSocketWriter> writer_; 129 std::unique_ptr<BufferedSocketWriter> writer_;
126 scoped_refptr<net::IOBuffer> read_buffer_; 130 scoped_refptr<net::IOBuffer> read_buffer_;
127 bool read_pending_ = false; 131 bool read_pending_ = false;
128 132
129 TlsState tls_state_ = TlsState::NOT_REQUESTED; 133 TlsState tls_state_ = TlsState::NOT_REQUESTED;
130 134
131 std::unique_ptr<XmppLoginHandler> login_handler_; 135 std::unique_ptr<XmppLoginHandler> login_handler_;
132 std::unique_ptr<XmppStreamParser> stream_parser_; 136 std::unique_ptr<XmppStreamParser> stream_parser_;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 writer_.reset(); 291 writer_.reset();
288 292
289 DCHECK(!read_pending_); 293 DCHECK(!read_pending_);
290 294
291 std::unique_ptr<net::ClientSocketHandle> socket_handle( 295 std::unique_ptr<net::ClientSocketHandle> socket_handle(
292 new net::ClientSocketHandle()); 296 new net::ClientSocketHandle());
293 socket_handle->SetSocket(std::move(socket_)); 297 socket_handle->SetSocket(std::move(socket_));
294 298
295 cert_verifier_ = net::CertVerifier::CreateDefault(); 299 cert_verifier_ = net::CertVerifier::CreateDefault();
296 transport_security_state_.reset(new net::TransportSecurityState()); 300 transport_security_state_.reset(new net::TransportSecurityState());
301 cert_transparency_verifier_.reset(new net::MultiLogCTVerifier());
302 ct_policy_enforcer_.reset(new net::CTPolicyEnforcer());
297 net::SSLClientSocketContext context; 303 net::SSLClientSocketContext context;
298 context.cert_verifier = cert_verifier_.get(); 304 context.cert_verifier = cert_verifier_.get();
299 context.transport_security_state = transport_security_state_.get(); 305 context.transport_security_state = transport_security_state_.get();
306 context.cert_transparency_verifier = cert_transparency_verifier_.get();
307 context.ct_policy_enforcer = ct_policy_enforcer_.get();
300 308
301 socket_ = socket_factory_->CreateSSLClientSocket( 309 socket_ = socket_factory_->CreateSSLClientSocket(
302 std::move(socket_handle), 310 std::move(socket_handle),
303 net::HostPortPair(xmpp_server_config_.host, kDefaultHttpsPort), 311 net::HostPortPair(xmpp_server_config_.host, kDefaultHttpsPort),
304 net::SSLConfig(), context); 312 net::SSLConfig(), context);
305 313
306 int result = socket_->Connect( 314 int result = socket_->Connect(
307 base::Bind(&Core::OnTlsConnected, base::Unretained(this))); 315 base::Bind(&Core::OnTlsConnected, base::Unretained(this)));
308 if (result != net::ERR_IO_PENDING) 316 if (result != net::ERR_IO_PENDING)
309 OnTlsConnected(result); 317 OnTlsConnected(result);
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 std::string XmppSignalStrategy::GetNextId() { 541 std::string XmppSignalStrategy::GetNextId() {
534 return base::Uint64ToString(base::RandUint64()); 542 return base::Uint64ToString(base::RandUint64());
535 } 543 }
536 544
537 void XmppSignalStrategy::SetAuthInfo(const std::string& username, 545 void XmppSignalStrategy::SetAuthInfo(const std::string& username,
538 const std::string& auth_token) { 546 const std::string& auth_token) {
539 core_->SetAuthInfo(username, auth_token); 547 core_->SetAuthInfo(username, auth_token);
540 } 548 }
541 549
542 } // namespace remoting 550 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/ssl_hmac_channel_authenticator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698