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

Unified Diff: net/http/transport_security_state.cc

Issue 2587243002: Do not do Expect-Staple when OCSPVerifyResult has not been populated (Closed)
Patch Set: sleevi comments; revert to not sending reports on cert errors Created 4 years 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.cc
diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc
index 9b42febf5f177481b33b5406d88215da1e24b325..ce16cca9a1517baf1e3dab049ba4f3a8a924acd6 100644
--- a/net/http/transport_security_state.cc
+++ b/net/http/transport_security_state.cc
@@ -645,6 +645,10 @@ bool DecodeHSTSPreload(const std::string& hostname, PreloadResult* out) {
std::string SerializeExpectStapleResponseStatus(
OCSPVerifyResult::ResponseStatus status) {
switch (status) {
+ case OCSPVerifyResult::NOT_CHECKED:
+ // Reports shouldn't be sent for this response status.
+ NOTREACHED();
+ return "NOT_CHECKED";
case OCSPVerifyResult::MISSING:
return "MISSING";
case OCSPVerifyResult::PROVIDED:
@@ -662,6 +666,7 @@ std::string SerializeExpectStapleResponseStatus(
case OCSPVerifyResult::PARSE_RESPONSE_DATA_ERROR:
return "PARSE_RESPONSE_DATA_ERROR";
}
+ NOTREACHED();
return std::string();
}
@@ -803,7 +808,11 @@ void TransportSecurityState::CheckExpectStaple(
if (!GetStaticExpectStapleState(host_port_pair.host(), &expect_staple_state))
return;
- // No report needed if a stapled OCSP response was provided.
+ // No report needed if OCSP details were not checked on this connection.
+ if (ssl_info.ocsp_result.response_status == OCSPVerifyResult::NOT_CHECKED)
+ return;
+
+ // No report needed if a stapled OCSP response was provided and it was valid.
if (ssl_info.ocsp_result.response_status == OCSPVerifyResult::PROVIDED &&
ssl_info.ocsp_result.revocation_status == OCSPRevocationStatus::GOOD) {
return;

Powered by Google App Engine
This is Rietveld 408576698