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

Unified Diff: net/tools/testserver/testserver.py

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/tools/testserver/testserver.py
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py
index ba130af9943364d9941f55cba3746f2175a799dc..3aee17a6b28d40190aec47ae184804f1bb2acb97 100755
--- a/net/tools/testserver/testserver.py
+++ b/net/tools/testserver/testserver.py
@@ -1912,11 +1912,25 @@ class ServerRunner(testserver_base.TestServerRunner):
raise testserver_base.OptionError('unknown OCSP status: ' +
self.options.ocsp_status)
+ ocsp_date = None
+ if self.options.ocsp_date == 'valid':
+ ocsp_date = minica.OCSP_DATE_VALID
+ elif self.options.ocsp_date == 'old':
+ ocsp_date = minica.OCSP_DATE_OLD
+ elif self.options.ocsp_date == 'young':
+ ocsp_date = minica.OCSP_DATE_YOUNG
+ elif self.options.ocsp_date == 'long':
+ ocsp_date = minica.OCSP_DATE_LONG
+ else:
+ raise testserver_base.OptionError('unknown OCSP date: ' +
+ self.options.ocsp_date)
+
(pem_cert_and_key, ocsp_der) = minica.GenerateCertKeyAndOCSP(
subject = "127.0.0.1",
ocsp_url = ("http://%s:%d/ocsp" %
(host, self.__ocsp_server.server_port)),
ocsp_state = ocsp_state,
+ ocsp_date = ocsp_date,
serial = self.options.cert_serial)
if self.options.ocsp_server_unavailable:
@@ -2088,6 +2102,9 @@ class ServerRunner(testserver_base.TestServerRunner):
help='The type of OCSP response generated '
'for the automatically generated '
'certificate. One of [ok,revoked,invalid]')
+ self.option_parser.add_option('--ocsp-date', dest='ocsp_date',
+ default='valid', help= 'The validity of the '
+ 'range between thisUpdate and nextUpdate')
self.option_parser.add_option('--cert-serial', dest='cert_serial',
default=0, type=int,
help='If non-zero then the generated '

Powered by Google App Engine
This is Rietveld 408576698