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

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

Issue 2100303002: Add OCSPVerifyResult for tracking stapled OCSP responses cross-platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ocsp-date-check
Patch Set: Optional was optional. Created 4 years, 5 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.h
diff --git a/net/test/spawned_test_server/base_test_server.h b/net/test/spawned_test_server/base_test_server.h
index 48568010f65577a07c24b369a5bfda14618e300a..c50087b9b1881a29cf9c4efa57117c996a47802a 100644
--- a/net/test/spawned_test_server/base_test_server.h
+++ b/net/test/spawned_test_server/base_test_server.h
@@ -81,9 +81,36 @@ class BaseTestServer {
enum OCSPStatus {
OCSP_OK,
OCSP_REVOKED,
- OCSP_INVALID,
+ OCSP_INVALID_RESPONSE,
OCSP_UNAUTHORIZED,
OCSP_UNKNOWN,
+ OCSP_INVALID_RESPONSE_DATA,
+ OCSP_TRY_LATER,
+ OCSP_MISMATCHED_SERIAL,
+ };
+
+ // OCSPDate enumerates the date ranges for OCSP responses that the
+ // testserver can produce.
+ enum OCSPDate {
+ OCSP_DATE_VALID,
+ OCSP_DATE_OLD,
+ OCSP_DATE_EARLY,
+ OCSP_DATE_LONG,
+ };
+
+ // SingleResponse is used when specifying multiple stapled responses, each
Ryan Sleevi 2016/07/18 22:56:37 s/SingleResponse/OCSPSingleResponse/
dadrian 2016/07/18 23:20:26 Done.
+ // with their own CertStatus and date validity.
+ struct OCSPSingleResponse {
+ OCSPStatus status;
+ OCSPDate date;
+ };
+
+ // OCSPProduced enumerates the validity of the producedAt field in OCSP
+ // responses produced by the testserver.
+ enum OCSPProduced {
+ OCSP_PRODUCED_VALID,
+ OCSP_PRODUCED_BEFORE_CERT,
+ OCSP_PRODUCED_AFTER_CERT,
};
// Bitmask of key exchange algorithms that the test server supports and that
@@ -151,13 +178,35 @@ class BaseTestServer {
// the empty string if there is none.
std::string GetOCSPArgument() const;
+ // GetOCSPDateArgument returns the value of the OCSP date argument to
+ // testserver or the empty string if there is none.
+ std::string GetOCSPDateArgument() const;
+
+ // GetOCSPProducedArgument returns the value of the OCSP produced argument
+ // to testserver or the empty string if there is none.
+ std::string GetOCSPProducedArgument() const;
+
// The certificate to use when serving requests.
ServerCertificate server_certificate;
// If |server_certificate==CERT_AUTO| then this determines the type of OCSP
- // response returned.
+ // response returned. Ignored if |ocsp_responses| is non-empty.
OCSPStatus ocsp_status;
+ // If |server_certificate==CERT_AUTO| then this determines the date range
+ // set on the OCSP response returned. Ignore if |ocsp_responses| is
+ // non-empty.
+ OCSPDate ocsp_date;
+
+ // If |server_certificate==CERT_AUTO|, contains the status and validity for
+ // multiple stapled responeses. Overrides |ocsp_status| and |ocsp_date| when
+ // non-empty.
+ std::vector<OCSPSingleResponse> ocsp_responses;
+
+ // If |server_certificate==CERT_AUTO| then this determines the validity of
+ // the producedAt field on the returned OCSP response.
+ OCSPProduced ocsp_produced;
+
// If not zero, |cert_serial| will be the serial number of the
// auto-generated leaf certificate when |server_certificate==CERT_AUTO|.
uint64_t cert_serial;

Powered by Google App Engine
This is Rietveld 408576698