summaryrefslogtreecommitdiff
path: root/tools/submitcert.py
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2015-03-16 10:06:42 +0100
committerMagnus Ahltorp <map@kth.se>2015-03-23 16:14:47 +0100
commit1075b68f287e957cd73c8cdb9517293b4c920eec (patch)
treea0c61414da5341522d98200eb7012120af748835 /tools/submitcert.py
parent0fd4141586310d7735a376bdbf4541b0d8e88169 (diff)
Add submission of precerts
Diffstat (limited to 'tools/submitcert.py')
-rwxr-xr-xtools/submitcert.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/submitcert.py b/tools/submitcert.py
index 9f0be67..1c79544 100755
--- a/tools/submitcert.py
+++ b/tools/submitcert.py
@@ -44,10 +44,16 @@ sth = get_sth(baseurl)
def submitcert((certfile, cert)):
timing = timing_point()
certchain = get_certs_from_string(cert)
+ precerts = get_precerts_from_string(cert)
+ assert len(precerts) == 0 or len(precerts) == 1
+ precert = precerts[0] if precerts else None
timing_point(timing, "readcerts")
try:
- result = add_chain(baseurl, {"chain":map(base64.b64encode, certchain)})
+ if precert:
+ result = add_prechain(baseurl, {"chain":map(base64.b64encode, [precert] + certchain)})
+ else:
+ result = add_chain(baseurl, {"chain":map(base64.b64encode, certchain)})
except SystemExit:
print "EXIT:", certfile
select.select([], [], [], 1.0)