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

Unified Diff: net/http/transport_security_reporter.h

Issue 1211933005: Initial (partial) implementation of HPKP violation reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: style fixes, comments Created 5 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/transport_security_persister_unittest.cc ('k') | net/http/transport_security_reporter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/transport_security_reporter.h
diff --git a/net/http/transport_security_reporter.h b/net/http/transport_security_reporter.h
new file mode 100644
index 0000000000000000000000000000000000000000..1fa8557d8a916dad437d7a324174268f2c65bb68
--- /dev/null
+++ b/net/http/transport_security_reporter.h
@@ -0,0 +1,53 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_HTTP_TRANSPORT_SECURITY_REPORTER_H_
+#define NET_HTTP_TRANSPORT_SECURITY_REPORTER_H_
+
+#include <string>
+
+#include "net/http/certificate_report_sender_impl.h"
+#include "net/http/transport_security_state.h"
+
+class GURL;
+
+namespace net {
+
+class SSLInfo;
+class URLRequestContext;
+
+// Builds, serializes, and sends violation reports detected by
+// TransportSecurityState.
+class NET_EXPORT TransportSecurityReporter
+ : public TransportSecurityState::Reporter {
+ public:
+ TransportSecurityReporter(TransportSecurityState* state,
+ scoped_ptr<CertificateReportSender> report_sender);
+ ~TransportSecurityReporter() override;
+
+ // TransportSecurityState::Reporter overrides
+ bool GetHPKPReportUri(
+ const TransportSecurityState::DomainState::PKPState& pkp_state,
+ GURL* report_uri) override;
+ bool BuildHPKPReport(
+ const std::string& hostname,
+ uint16_t port,
+ const base::Time& expiry,
+ bool include_subdomains,
+ const std::string& effective_hostname,
+ const scoped_refptr<X509Certificate>& served_certificate_chain,
+ const scoped_refptr<X509Certificate>& validated_certificate_chain,
+ const HashValueVector& spki_hashes,
+ std::string* serialized_report) override;
+ void SendHPKPReport(const GURL& report_uri,
+ const std::string& report) override;
+
+ private:
+ TransportSecurityState* transport_security_state_;
+ scoped_ptr<CertificateReportSender> report_sender_;
+};
+
+} // namespace net
+
+#endif // NET_HTTP_TRANSPORT_SECURITY_REPORTER_H_
« no previous file with comments | « net/http/transport_security_persister_unittest.cc ('k') | net/http/transport_security_reporter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698