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

Unified Diff: net/http/transport_security_state.h

Issue 2040513003: Implement Expect-Staple (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use new der::GeneralizedTime operators Created 4 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
Index: net/http/transport_security_state.h
diff --git a/net/http/transport_security_state.h b/net/http/transport_security_state.h
index 2988f3ad8a49e9fe072795af4c4b2b9654cb20e0..3f194214ab510480de4468d2c615f21c46604baa 100644
--- a/net/http/transport_security_state.h
+++ b/net/http/transport_security_state.h
@@ -27,6 +27,7 @@ class GURL;
namespace net {
+class ExpectStapleReport;
class HostPortPair;
class SSLInfo;
@@ -385,8 +386,24 @@ class NET_EXPORT TransportSecurityState
const HostPortPair& host_port_pair,
const SSLInfo& ssl_info);
+ // Checks to see if the given |host_port_pair| is in the Expect-Staple preload
+ // list. If the host is preloaded, this parses |ocsp_response|, validates
+ // it against |verified_certificate|, and ensures the OCSP response is valid
+ // at |verify_time| and is no older than |max_age|. If the OCSP response fails
+ // validation, this sends an Expect-Staple report to the preloaded report URI.
+ // The report will contain |unverified_certificate| iff
+ // |is_issued_by_known_root| is true.
Ryan Sleevi 2016/06/16 21:49:29 This also seems a big "SRP" concern. This doesn't
+ void CheckExpectStaple(const HostPortPair& host_port_pair,
+ const X509Certificate& verified_certificate,
+ const X509Certificate& unverified_certificate,
+ bool is_issued_by_known_root,
+ const base::Time& verify_time,
+ const base::TimeDelta& max_age,
+ const std::string& ocsp_response);
+
private:
friend class TransportSecurityStateTest;
+ friend class ExpectStapleTest;
Ryan Sleevi 2016/06/16 21:49:29 I block the addition of friends because I'm a terr
dadrian 2016/06/17 17:26:55 This is a derived class of this files tester. The
FRIEND_TEST_ALL_PREFIXES(HttpSecurityHeadersTest, UpdateDynamicPKPOnly);
FRIEND_TEST_ALL_PREFIXES(HttpSecurityHeadersTest, UpdateDynamicPKPMaxAge0);
FRIEND_TEST_ALL_PREFIXES(HttpSecurityHeadersTest, NoClobberPins);
@@ -410,6 +427,14 @@ class NET_EXPORT TransportSecurityState
// information) is timely.
static bool IsBuildTimely();
+ // Helper method for serializing an ExpectStaple report.
+ static bool SerializeExpectStapleReport(
Ryan Sleevi 2016/06/17 16:19:56 DESIGN: Static privates are a design anti-pattern,
dadrian 2016/06/17 17:26:55 It's currently structured like this to be able to
+ const HostPortPair& host_port_pair,
+ const X509Certificate& unverified_certificate,
+ bool is_issued_by_known_root,
+ const ExpectStapleReport& report,
+ std::string* serialized_report);
+
// Helper method for actually checking pins.
bool CheckPublicKeyPinsImpl(
const HostPortPair& host_port_pair,

Powered by Google App Engine
This is Rietveld 408576698