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_HTTP_TRANSPORT_SECURITY_STATE_H_ | 5 #ifndef NET_HTTP_TRANSPORT_SECURITY_STATE_H_ |
6 #define NET_HTTP_TRANSPORT_SECURITY_STATE_H_ | 6 #define NET_HTTP_TRANSPORT_SECURITY_STATE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // If an entry is deleted, the new state will be persisted through | 194 // If an entry is deleted, the new state will be persisted through |
195 // the Delegate (if any). | 195 // the Delegate (if any). |
196 bool DeleteDynamicDataForHost(const std::string& host); | 196 bool DeleteDynamicDataForHost(const std::string& host); |
197 | 197 |
198 // Returns true and updates |*result| iff there is a DomainState for | 198 // Returns true and updates |*result| iff there is a DomainState for |
199 // |host|. | 199 // |host|. |
200 // | 200 // |
201 // If |sni_enabled| is true, searches the static pins defined for | 201 // If |sni_enabled| is true, searches the static pins defined for |
202 // SNI-using hosts as well as the rest of the pins. | 202 // SNI-using hosts as well as the rest of the pins. |
203 // | 203 // |
204 // If |allow_dynamic| is true, then dynamic state is returned if present, | |
205 // otherwise only static state is used.. | |
206 // | |
207 // If |host| matches both an exact entry and is a subdomain of another | 204 // If |host| matches both an exact entry and is a subdomain of another |
208 // entry, the exact match determines the return value. | 205 // entry, the exact match determines the return value. |
209 // | 206 // |
210 // Note that this method is not const because it opportunistically removes | 207 // Note that this method is not const because it opportunistically removes |
211 // entries that have expired. | 208 // entries that have expired. |
212 bool GetDomainState(const std::string& host, | 209 bool GetDomainState(const std::string& host, |
213 bool sni_enabled, | 210 bool sni_enabled, |
214 bool allow_dynamic, | |
215 DomainState* result); | 211 DomainState* result); |
216 | 212 |
217 // Processes an HSTS header value from the host, adding entries to | 213 // Processes an HSTS header value from the host, adding entries to |
218 // dynamic state if necessary. | 214 // dynamic state if necessary. |
219 bool AddHSTSHeader(const std::string& host, const std::string& value); | 215 bool AddHSTSHeader(const std::string& host, const std::string& value); |
220 | 216 |
221 // Processes an HPKP header value from the host, adding entries to | 217 // Processes an HPKP header value from the host, adding entries to |
222 // dynamic state if necessary. ssl_info is used to check that | 218 // dynamic state if necessary. ssl_info is used to check that |
223 // the specified pins overlap with the certificate chain. | 219 // the specified pins overlap with the certificate chain. |
224 bool AddHPKPHeader(const std::string& host, const std::string& value, | 220 bool AddHPKPHeader(const std::string& host, const std::string& value, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 DomainStateMap enabled_hosts_; | 319 DomainStateMap enabled_hosts_; |
324 | 320 |
325 Delegate* delegate_; | 321 Delegate* delegate_; |
326 | 322 |
327 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); | 323 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); |
328 }; | 324 }; |
329 | 325 |
330 } // namespace net | 326 } // namespace net |
331 | 327 |
332 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_ | 328 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_ |
OLD | NEW |