Chromium Code Reviews| Index: net/http/transport_security_state.h |
| diff --git a/net/http/transport_security_state.h b/net/http/transport_security_state.h |
| index 17885ba80f14dcfc625bc554e92c5174638041ae..876f9881dff2d170cbbc3296dd8f2408bd5708b5 100644 |
| --- a/net/http/transport_security_state.h |
| +++ b/net/http/transport_security_state.h |
| @@ -45,9 +45,6 @@ class NET_EXPORT TransportSecurityState |
| virtual ~Delegate() {} |
| }; |
| - TransportSecurityState(); |
| - ~TransportSecurityState(); |
| - |
| // A DomainState describes the transport security state (required upgrade |
| // to HTTPS, and/or any public key pins). |
| // |
| @@ -170,6 +167,38 @@ class NET_EXPORT TransportSecurityState |
| std::map<std::string, DomainState>::const_iterator end_; |
| }; |
| + class NET_EXPORT Reporter { |
| + public: |
| + virtual ~Reporter() {} |
|
Ryan Sleevi
2015/06/26 20:08:58
Is ownership of the reporter transferred?
If not,
estark
2015/07/09 21:45:26
Done.
|
| + |
| + // Returns true if a violation report should be sent for the host in |
| + // the given |pkp_state|, and returns the report destination URI in |
| + // |report_uri|. Returns false if a report should not be sent. |
| + virtual bool GetHPKPReportUri(const DomainState::PKPState& pkp_state, |
| + GURL* report_uri) = 0; |
|
Ryan Sleevi
2015/06/26 20:08:58
It's unclear why this is a property of the Reporte
Ryan Sleevi
2015/06/26 20:17:15
Bah, bad spec language. I can't tell if I'm lying
estark
2015/07/09 21:45:26
I read Section 2.1 #2 as meaning that there should
estark
2015/07/09 21:45:26
Yes, that's the reason. Done.
|
| + |
| + // Builds a serialized HPKP violation report in |
| + // |serialized_report|. Returns true on success and false on |
| + // failure. |
| + virtual bool BuildHPKPReport( |
| + const std::string& hostname, |
| + uint16_t port, |
| + const base::Time& expiry, |
| + bool include_subdomains, |
| + const std::string& effective_hostname, |
|
Ryan Sleevi
2015/06/26 20:08:58
Should provide a bit of documentation about these
estark
2015/07/09 21:45:26
Done.
|
| + const scoped_refptr<X509Certificate>& served_certificate_chain, |
| + const scoped_refptr<X509Certificate>& validated_certificate_chain, |
|
Ryan Sleevi
2015/06/26 20:08:58
You should be able to pass these just as naked X50
estark
2015/07/09 21:45:26
Done.
|
| + const HashValueVector& spki_hashes, |
| + std::string* serialized_report) = 0; |
| + |
| + // Sends the given serialized |report| to |report_uri|. |
| + virtual void SendHPKPReport(const GURL& report_uri, |
| + const std::string& report) = 0; |
| + }; |
| + |
| + TransportSecurityState(); |
| + ~TransportSecurityState(); |
| + |
| // These functions search for static and dynamic DomainStates, and invoke the |
| // functions of the same name on them. These functions are the primary public |
| // interface; direct access to DomainStates is best left to tests. |
| @@ -188,6 +217,8 @@ class NET_EXPORT TransportSecurityState |
| // TransportSecurityState. |
| void SetDelegate(Delegate* delegate); |
| + void SetReporter(Reporter* reporter); |
| + |
| // Clears all dynamic data (e.g. HSTS and HPKP data). |
| // |
| // Does NOT persist changes using the Delegate, as this function is only |
| @@ -331,6 +362,8 @@ class NET_EXPORT TransportSecurityState |
| Delegate* delegate_; |
| + Reporter* reporter_; |
| + |
| // True if static pins should be used. |
| bool enable_static_pins_; |