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

Unified Diff: net/http/transport_security_state.cc

Issue 2587243002: Do not do Expect-Staple when OCSPVerifyResult has not been populated (Closed)
Patch Set: 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..5df88a944a83bc874cca46121c2a20f4d88652bd 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::UNKNOWN:
+ // Reports shouldn't be sent for this response status.
+ NOTREACHED();
+ return "UNKNOWN";
case OCSPVerifyResult::MISSING:
return "MISSING";
case OCSPVerifyResult::PROVIDED:
@@ -803,9 +807,11 @@ void TransportSecurityState::CheckExpectStaple(
if (!GetStaticExpectStapleState(host_port_pair.host(), &expect_staple_state))
return;
- // No report needed if a stapled OCSP response was provided.
- if (ssl_info.ocsp_result.response_status == OCSPVerifyResult::PROVIDED &&
- ssl_info.ocsp_result.revocation_status == OCSPRevocationStatus::GOOD) {
+ // No report needed if OCSP details were not checked on this
+ // connection, or if a stapled OCSP response was provided.
+ if (ssl_info.ocsp_result.response_status == OCSPVerifyResult::UNKNOWN ||
+ (ssl_info.ocsp_result.response_status == OCSPVerifyResult::PROVIDED &&
+ ssl_info.ocsp_result.revocation_status == OCSPRevocationStatus::GOOD)) {
Ryan Sleevi 2016/12/21 01:35:29 suggestion: I would actually break these into two
estark 2016/12/21 17:53:12 Done.
return;
}

Powered by Google App Engine
This is Rietveld 408576698