diff options
Diffstat (limited to 'monitor/josef_mover.py')
-rwxr-xr-x | monitor/josef_mover.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/monitor/josef_mover.py b/monitor/josef_mover.py index 52b9dd6..1600217 100755 --- a/monitor/josef_mover.py +++ b/monitor/josef_mover.py @@ -11,7 +11,7 @@ from precerttools import cleanprecert from monitor_conf import * from josef_lib import * -def print_reply(rep, entry, precert): +def print_reply(rep, entry): t = datetime.datetime.fromtimestamp(rep['timestamp'] / 1000, UTC()).strftime("%Y-%m-%d %H:%M:%S") log_id = rep["id"] @@ -26,7 +26,7 @@ def print_reply(rep, entry, precert): # print "Log:", l["name"] print "Time:", t - if precert: + if entry[2]: print "Type: Precert" signed_entry = pack_precert(cleanprecert(entry[0][0]), entry[2]) else: @@ -36,7 +36,7 @@ def print_reply(rep, entry, precert): key = base64.b64decode(log["key"]) try: - check_sct_signature(log["url"], signed_entry, rep, precert, key) + check_sct_signature(log["url"], signed_entry, rep, entry[2], key) print "Signature: OK" except: print "Could not verify signature!" @@ -44,13 +44,13 @@ def print_reply(rep, entry, precert): print "" -# source = [ctlogs[0]] -source = ctlogs -# dests = [ctlogs[0]] -dests = ctlogs +source = [ctlogs[0]] +dests = [ctlogs[0]] +# source = ctlogs +# dests = ctlogs first = 0 -last = 0 +last = 1 # print entries for s_log in source: @@ -70,11 +70,11 @@ for s_log in source: for e in entry[0]: submission.append(base64.b64encode(e)) - if precert: + if entry[2]: res = add_prechain(d_log["url"], {"chain" : submission}) else: res = add_chain(d_log["url"], {"chain" : submission}) - print_reply(res, entry, precert) + print_reply(res, entry) # time.sleep(5) except KeyboardInterrupt: sys.exit() |