 Chromium Code Reviews
 Chromium Code Reviews Issue 173853014:
  Make OpenSSL UpdateServerCert() OS independent.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 173853014:
  Make OpenSSL UpdateServerCert() OS independent.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| OLD | NEW | 
|---|---|
| 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 #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 | 7 | 
| 8 #include <string> | 8 #include <string> | 
| 9 | 9 | 
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" | 
| 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 CTVerifier; | 20 class CTVerifier; | 
| 21 class ServerBoundCertService; | 21 class ServerBoundCertService; | 
| 22 class SSLCertRequestInfo; | 22 class SSLCertRequestInfo; | 
| 23 struct SSLConfig; | 23 struct SSLConfig; | 
| 24 class SSLInfo; | 24 class SSLInfo; | 
| 25 class TransportSecurityState; | 25 class TransportSecurityState; | 
| 26 class X509Certificate; | |
| 26 | 27 | 
| 27 // This struct groups together several fields which are used by various | 28 // This struct groups together several fields which are used by various | 
| 28 // classes related to SSLClientSocket. | 29 // classes related to SSLClientSocket. | 
| 29 struct SSLClientSocketContext { | 30 struct SSLClientSocketContext { | 
| 30 SSLClientSocketContext() | 31 SSLClientSocketContext() | 
| 31 : cert_verifier(NULL), | 32 : cert_verifier(NULL), | 
| 32 server_bound_cert_service(NULL), | 33 server_bound_cert_service(NULL), | 
| 33 transport_security_state(NULL), | 34 transport_security_state(NULL), | 
| 34 cert_transparency_verifier(NULL) {} | 35 cert_transparency_verifier(NULL) {} | 
| 35 | 36 | 
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 ServerBoundCertService* server_bound_cert_service, | 148 ServerBoundCertService* server_bound_cert_service, | 
| 148 bool negotiated_channel_id, | 149 bool negotiated_channel_id, | 
| 149 bool channel_id_enabled, | 150 bool channel_id_enabled, | 
| 150 bool supports_ecc); | 151 bool supports_ecc); | 
| 151 | 152 | 
| 152 // Returns whether TLS channel ID is enabled. | 153 // Returns whether TLS channel ID is enabled. | 
| 153 static bool IsChannelIDEnabled( | 154 static bool IsChannelIDEnabled( | 
| 154 const SSLConfig& ssl_config, | 155 const SSLConfig& ssl_config, | 
| 155 ServerBoundCertService* server_bound_cert_service); | 156 ServerBoundCertService* server_bound_cert_service); | 
| 156 | 157 | 
| 158 protected: | |
| 
Ryan Sleevi
2014/03/12 23:12:03
Do not repeat 'protected' here (it's already set o
 
haavardm
2014/03/13 10:32:02
Done.
 | |
| 159 // For unit testing only. | |
| 160 // Returns the unverified certificate chain as presented by server. | |
| 161 // Note that chain may be different than the verified chain returned by | |
| 162 // StreamSocket::GetSSLInfo(). | |
| 163 virtual const X509Certificate* GetUnverifiedServerCertificateChain() | |
| 164 const = 0; | |
| 165 | |
| 157 private: | 166 private: | 
| 158 // For signed_cert_timestamps_received_ and stapled_ocsp_response_received_. | 167 // For signed_cert_timestamps_received_ and stapled_ocsp_response_received_. | 
| 159 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 168 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 
| 160 ConnectSignedCertTimestampsEnabledTLSExtension); | 169 ConnectSignedCertTimestampsEnabledTLSExtension); | 
| 161 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 170 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 
| 162 ConnectSignedCertTimestampsEnabledOCSP); | 171 ConnectSignedCertTimestampsEnabledOCSP); | 
| 163 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 172 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 
| 164 ConnectSignedCertTimestampsDisabled); | 173 ConnectSignedCertTimestampsDisabled); | 
| 174 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | |
| 175 VerifyServerChainProperlyOrdered); | |
| 165 | 176 | 
| 166 // True if NPN was responded to, independent of selecting SPDY or HTTP. | 177 // True if NPN was responded to, independent of selecting SPDY or HTTP. | 
| 167 bool was_npn_negotiated_; | 178 bool was_npn_negotiated_; | 
| 168 // True if NPN successfully negotiated SPDY. | 179 // True if NPN successfully negotiated SPDY. | 
| 169 bool was_spdy_negotiated_; | 180 bool was_spdy_negotiated_; | 
| 170 // Protocol that we negotiated with the server. | 181 // Protocol that we negotiated with the server. | 
| 171 NextProto protocol_negotiated_; | 182 NextProto protocol_negotiated_; | 
| 172 // True if a channel ID was sent. | 183 // True if a channel ID was sent. | 
| 173 bool channel_id_sent_; | 184 bool channel_id_sent_; | 
| 174 // True if SCTs were received via a TLS extension. | 185 // True if SCTs were received via a TLS extension. | 
| 175 bool signed_cert_timestamps_received_; | 186 bool signed_cert_timestamps_received_; | 
| 176 // True if a stapled OCSP response was received. | 187 // True if a stapled OCSP response was received. | 
| 177 bool stapled_ocsp_response_received_; | 188 bool stapled_ocsp_response_received_; | 
| 178 }; | 189 }; | 
| 179 | 190 | 
| 180 } // namespace net | 191 } // namespace net | 
| 181 | 192 | 
| 182 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 193 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 
| OLD | NEW |