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

Side by Side Diff: net/socket/ssl_client_socket.h

Issue 8692012: net: replace DnsRRResoler with TransportSecurityState in plumbing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_ 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_
6 #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "net/base/completion_callback.h" 11 #include "net/base/completion_callback.h"
12 #include "net/base/load_flags.h" 12 #include "net/base/load_flags.h"
13 #include "net/base/net_errors.h" 13 #include "net/base/net_errors.h"
14 #include "net/socket/ssl_socket.h" 14 #include "net/socket/ssl_socket.h"
15 #include "net/socket/stream_socket.h" 15 #include "net/socket/stream_socket.h"
16 16
17 namespace net { 17 namespace net {
18 18
19 class CertVerifier; 19 class CertVerifier;
20 class DnsCertProvenanceChecker; 20 class DnsCertProvenanceChecker;
21 class DnsRRResolver;
22 class OriginBoundCertService; 21 class OriginBoundCertService;
23 class SSLCertRequestInfo; 22 class SSLCertRequestInfo;
24 class SSLHostInfo; 23 class SSLHostInfo;
25 class SSLHostInfoFactory; 24 class SSLHostInfoFactory;
26 class SSLInfo; 25 class SSLInfo;
27 struct RRResponse; 26 class TransportSecurityState;
28
29 // DNSSECProvider is an interface to an object that can return DNSSEC data.
30 class DNSSECProvider {
31 public:
32 // GetDNSSECRecords will either:
33 // 1) set |*out| to NULL and return OK.
34 // 2) set |*out| to a pointer, which is owned by this object, and return OK.
35 // 3) return IO_PENDING and call |callback| on the current MessageLoop at
36 // some point in the future. Once the callback has been made, this
37 // function will return OK if called again.
38 virtual int GetDNSSECRecords(RRResponse** out,
39 OldCompletionCallback* callback) = 0;
40
41 private:
42 ~DNSSECProvider() {}
43 };
44 27
45 // This struct groups together several fields which are used by various 28 // This struct groups together several fields which are used by various
46 // classes related to SSLClientSocket. 29 // classes related to SSLClientSocket.
47 struct SSLClientSocketContext { 30 struct SSLClientSocketContext {
48 SSLClientSocketContext() 31 SSLClientSocketContext()
49 : cert_verifier(NULL), 32 : cert_verifier(NULL),
50 origin_bound_cert_service(NULL), 33 origin_bound_cert_service(NULL),
51 dnsrr_resolver(NULL),
52 dns_cert_checker(NULL), 34 dns_cert_checker(NULL),
53 ssl_host_info_factory(NULL) {} 35 ssl_host_info_factory(NULL) {}
54 36
55 SSLClientSocketContext(CertVerifier* cert_verifier_arg, 37 SSLClientSocketContext(CertVerifier* cert_verifier_arg,
56 OriginBoundCertService* origin_bound_cert_service_arg, 38 OriginBoundCertService* origin_bound_cert_service_arg,
57 DnsRRResolver* dnsrr_resolver_arg, 39 TransportSecurityState* transport_security_state_arg,
58 DnsCertProvenanceChecker* dns_cert_checker_arg, 40 DnsCertProvenanceChecker* dns_cert_checker_arg,
59 SSLHostInfoFactory* ssl_host_info_factory_arg) 41 SSLHostInfoFactory* ssl_host_info_factory_arg)
60 : cert_verifier(cert_verifier_arg), 42 : cert_verifier(cert_verifier_arg),
61 origin_bound_cert_service(origin_bound_cert_service_arg), 43 origin_bound_cert_service(origin_bound_cert_service_arg),
62 dnsrr_resolver(dnsrr_resolver_arg), 44 transport_security_state(transport_security_state_arg),
63 dns_cert_checker(dns_cert_checker_arg), 45 dns_cert_checker(dns_cert_checker_arg),
64 ssl_host_info_factory(ssl_host_info_factory_arg) {} 46 ssl_host_info_factory(ssl_host_info_factory_arg) {}
65 47
66 CertVerifier* cert_verifier; 48 CertVerifier* cert_verifier;
67 OriginBoundCertService* origin_bound_cert_service; 49 OriginBoundCertService* origin_bound_cert_service;
68 DnsRRResolver* dnsrr_resolver; 50 TransportSecurityState* transport_security_state;
69 DnsCertProvenanceChecker* dns_cert_checker; 51 DnsCertProvenanceChecker* dns_cert_checker;
70 SSLHostInfoFactory* ssl_host_info_factory; 52 SSLHostInfoFactory* ssl_host_info_factory;
71 }; 53 };
72 54
73 // A client socket that uses SSL as the transport layer. 55 // A client socket that uses SSL as the transport layer.
74 // 56 //
75 // NOTE: The SSL handshake occurs within the Connect method after a TCP 57 // NOTE: The SSL handshake occurs within the Connect method after a TCP
76 // connection is established. If a SSL error occurs during the handshake, 58 // connection is established. If a SSL error occurs during the handshake,
77 // Connect will fail. 59 // Connect will fail.
78 // 60 //
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 virtual NextProtoStatus GetNextProto(std::string* proto) = 0; 106 virtual NextProtoStatus GetNextProto(std::string* proto) = 0;
125 107
126 static NextProto NextProtoFromString(const std::string& proto_string); 108 static NextProto NextProtoFromString(const std::string& proto_string);
127 109
128 static bool IgnoreCertError(int error, int load_flags); 110 static bool IgnoreCertError(int error, int load_flags);
129 111
130 virtual bool was_npn_negotiated() const; 112 virtual bool was_npn_negotiated() const;
131 113
132 virtual bool set_was_npn_negotiated(bool negotiated); 114 virtual bool set_was_npn_negotiated(bool negotiated);
133 115
134 virtual void UseDNSSEC(DNSSECProvider*) { }
135
136 virtual bool was_spdy_negotiated() const; 116 virtual bool was_spdy_negotiated() const;
137 117
138 virtual bool set_was_spdy_negotiated(bool negotiated); 118 virtual bool set_was_spdy_negotiated(bool negotiated);
139 119
140 private: 120 private:
141 // True if NPN was responded to, independent of selecting SPDY or HTTP. 121 // True if NPN was responded to, independent of selecting SPDY or HTTP.
142 bool was_npn_negotiated_; 122 bool was_npn_negotiated_;
143 // True if NPN successfully negotiated SPDY. 123 // True if NPN successfully negotiated SPDY.
144 bool was_spdy_negotiated_; 124 bool was_spdy_negotiated_;
145 }; 125 };
146 126
147 } // namespace net 127 } // namespace net
148 128
149 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ 129 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698