diff options
author | Magnus Ahltorp <map@kth.se> | 2015-03-16 10:06:42 +0100 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2015-03-16 10:06:42 +0100 |
commit | 4c72a1d2cecbb427a240e868277b7e039008c43e (patch) | |
tree | b33f83b8373196970cd95b5b9c764ec57d031d3c /tools/submitcert.py | |
parent | e2404caabb5ce3f7dca21cdedddbf744f47e6c3e (diff) |
Add submission of precerts
Diffstat (limited to 'tools/submitcert.py')
-rwxr-xr-x | tools/submitcert.py | 8 |
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) |