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

Unified Diff: net/test/spawned_test_server/base_test_server.cc

Issue 2040513003: Implement Expect-Staple (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move OCSP into cert_verify_proc 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/test/spawned_test_server/base_test_server.cc
diff --git a/net/test/spawned_test_server/base_test_server.cc b/net/test/spawned_test_server/base_test_server.cc
index bb4427ac451ff332763ce17821c0ebcd4c6596d9..4dfb525f146b4b8b7ee56987882f91782d90c2f5 100644
--- a/net/test/spawned_test_server/base_test_server.cc
+++ b/net/test/spawned_test_server/base_test_server.cc
@@ -208,6 +208,25 @@ std::string BaseTestServer::SSLOptions::GetOCSPArgument() const {
}
}
+std::string BaseTestServer::SSLOptions::GetOCSPDateArgument() const {
+ if (server_certificate != CERT_AUTO)
+ return std::string();
+
+ switch (ocsp_date) {
+ case OCSP_VALID:
+ return "valid";
+ case OCSP_OLD:
+ return "old";
+ case OCSP_YOUNG:
+ return "young";
+ case OCSP_LONG:
+ return "long";
+ default:
+ NOTREACHED();
+ return std::string();
+ }
+}
+
const char BaseTestServer::kLocalhost[] = "127.0.0.1";
BaseTestServer::BaseTestServer(Type type, const std::string& host)
@@ -524,6 +543,10 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const {
if (!ocsp_arg.empty())
arguments->SetString("ocsp", ocsp_arg);
+ std::string ocsp_date_arg = ssl_options_.GetOCSPDateArgument();
+ if (!ocsp_date_arg.empty())
+ arguments->SetString("ocsp-date", ocsp_date_arg);
+
if (ssl_options_.cert_serial != 0) {
arguments->SetInteger("cert-serial", ssl_options_.cert_serial);
}

Powered by Google App Engine
This is Rietveld 408576698