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_SSL_SSL_CONFIG_SERVICE_H_ | 5 #ifndef NET_SSL_SSL_CONFIG_SERVICE_H_ |
6 #define NET_SSL_SSL_CONFIG_SERVICE_H_ | 6 #define NET_SSL_SSL_CONFIG_SERVICE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 // Returns true if |cert| is one of the certs in |allowed_bad_certs|. | 42 // Returns true if |cert| is one of the certs in |allowed_bad_certs|. |
43 // The expected cert status is written to |cert_status|. |*cert_status| can | 43 // The expected cert status is written to |cert_status|. |*cert_status| can |
44 // be NULL if user doesn't care about the cert status. | 44 // be NULL if user doesn't care about the cert status. |
45 bool IsAllowedBadCert(X509Certificate* cert, CertStatus* cert_status) const; | 45 bool IsAllowedBadCert(X509Certificate* cert, CertStatus* cert_status) const; |
46 | 46 |
47 // Same as above except works with DER encoded certificates instead | 47 // Same as above except works with DER encoded certificates instead |
48 // of X509Certificate. | 48 // of X509Certificate. |
49 bool IsAllowedBadCert(const base::StringPiece& der_cert, | 49 bool IsAllowedBadCert(const base::StringPiece& der_cert, |
50 CertStatus* cert_status) const; | 50 CertStatus* cert_status) const; |
51 | 51 |
52 // Returns the string representation of an SSL protocol version. Returns an | |
53 // empty string on error. | |
54 static std::string SSLProtocolVersionToString(uint16 version); | |
55 | |
56 // Returns the SSL protocol version (as a uint16) represented by a string. | |
57 // Returns 0 if the string is invalid. | |
58 static uint16 SSLProtocolVersionFromString(const std::string& version_str); | |
59 | |
52 // rev_checking_enabled is true if online certificate revocation checking is | 60 // rev_checking_enabled is true if online certificate revocation checking is |
53 // enabled (i.e. OCSP and CRL fetching). | 61 // enabled (i.e. OCSP and CRL fetching). |
54 // | 62 // |
55 // Regardless of this flag, CRLSet checking is always enabled and locally | 63 // Regardless of this flag, CRLSet checking is always enabled and locally |
56 // cached revocation information will be considered. | 64 // cached revocation information will be considered. |
57 bool rev_checking_enabled; | 65 bool rev_checking_enabled; |
58 | 66 |
59 // The minimum and maximum protocol versions that are enabled. | 67 // The minimum and maximum protocol versions that are enabled. |
60 // SSL 3.0 is 0x0300, TLS 1.0 is 0x0301, TLS 1.1 is 0x0302, and so on. | 68 // SSL 3.0 is 0x0300, TLS 1.0 is 0x0301, TLS 1.1 is 0x0302, and so on. |
61 // (Use the SSL_PROTOCOL_VERSION_xxx enumerators defined above.) | 69 // (Use the SSL_PROTOCOL_VERSION_xxx enumerators defined above.) |
(...skipping 22 matching lines...) Expand all Loading... | |
84 // big-endian form, they should be declared in host byte order, with the | 92 // big-endian form, they should be declared in host byte order, with the |
85 // first uint8 occupying the most significant byte. | 93 // first uint8 occupying the most significant byte. |
86 // Ex: To disable TLS_RSA_WITH_RC4_128_MD5, specify 0x0004, while to | 94 // Ex: To disable TLS_RSA_WITH_RC4_128_MD5, specify 0x0004, while to |
87 // disable TLS_ECDH_ECDSA_WITH_RC4_128_SHA, specify 0xC002. | 95 // disable TLS_ECDH_ECDSA_WITH_RC4_128_SHA, specify 0xC002. |
88 std::vector<uint16> disabled_cipher_suites; | 96 std::vector<uint16> disabled_cipher_suites; |
89 | 97 |
90 bool cached_info_enabled; // True if TLS cached info extension is enabled. | 98 bool cached_info_enabled; // True if TLS cached info extension is enabled. |
91 bool channel_id_enabled; // True if TLS channel ID extension is enabled. | 99 bool channel_id_enabled; // True if TLS channel ID extension is enabled. |
92 bool false_start_enabled; // True if we'll use TLS False Start. | 100 bool false_start_enabled; // True if we'll use TLS False Start. |
93 | 101 |
102 // True if we want to disable enforcement of minimum SSL version for | |
103 // preloaded HSTS entries. | |
Ryan Sleevi
2013/04/15 18:03:28
Comment nit: Chromium comments discourage the use
| |
104 bool ssl_version_min_preloaded_disabled; | |
105 | |
94 // TODO(wtc): move the following members to a new SSLParams structure. They | 106 // TODO(wtc): move the following members to a new SSLParams structure. They |
95 // are not SSL configuration settings. | 107 // are not SSL configuration settings. |
96 | 108 |
97 struct NET_EXPORT CertAndStatus { | 109 struct NET_EXPORT CertAndStatus { |
98 CertAndStatus(); | 110 CertAndStatus(); |
99 ~CertAndStatus(); | 111 ~CertAndStatus(); |
100 | 112 |
101 std::string der_cert; | 113 std::string der_cert; |
102 CertStatus cert_status; | 114 CertStatus cert_status; |
103 }; | 115 }; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 void ProcessConfigUpdate(const SSLConfig& orig_config, | 217 void ProcessConfigUpdate(const SSLConfig& orig_config, |
206 const SSLConfig& new_config); | 218 const SSLConfig& new_config); |
207 | 219 |
208 private: | 220 private: |
209 ObserverList<Observer> observer_list_; | 221 ObserverList<Observer> observer_list_; |
210 }; | 222 }; |
211 | 223 |
212 } // namespace net | 224 } // namespace net |
213 | 225 |
214 #endif // NET_SSL_SSL_CONFIG_SERVICE_H_ | 226 #endif // NET_SSL_SSL_CONFIG_SERVICE_H_ |
OLD | NEW |