summaryrefslogtreecommitdiff
path: root/monitor/josef_monitor.py
diff options
context:
space:
mode:
authorjosef <josef.gson@gmail.com>2015-10-19 12:08:03 +0200
committerjosef <josef.gson@gmail.com>2015-10-19 12:08:03 +0200
commitcc06b25e43deeee70418a1ee9f6271ed9fed0c83 (patch)
treec60aa3cf27c70a2fd5f9ff1301ff35b210e769ab /monitor/josef_monitor.py
parentdb5fd75ac73f81721904b94408b7984482791179 (diff)
adding script for inclusion checking by submitting to all logs and checking timestamp age
Diffstat (limited to 'monitor/josef_monitor.py')
-rwxr-xr-xmonitor/josef_monitor.py46
1 files changed, 1 insertions, 45 deletions
diff --git a/monitor/josef_monitor.py b/monitor/josef_monitor.py
index 3896493..b8ebd52 100755
--- a/monitor/josef_monitor.py
+++ b/monitor/josef_monitor.py
@@ -309,53 +309,9 @@ class ctlog:
self.rollback()
-# def verify_inclusion_all(old, new):
-# for url in old:
-# try:
-# if old[url] and new[url]:
-# if old[url]["tree_size"]!= new[url]["tree_size"]:
-# entries = []
-
-# while len(entries) + old[url]["tree_size"]!= new[url]["tree_size"]:
-# entries += get_entries(url, str(int(old[url]["tree_size"]) + len(entries)), new[url]["tree_size"] -1)["entries"]
-# print "Got " + str(len(entries)) + " entries..."
-
-# success = True
-# for i in entries:
-# h = get_leaf_hash(base64.b64decode(i["leaf_input"]))
-# if not verify_inclusion_by_hash(url, h):
-# success = False
-
-# if success:
-# print time.strftime("%H:%M:%S") + " Verifying inclusion for " + str(len(entries)) + " new entries in " + url + " ...OK"
-# else:
-# print time.strftime('%H:%M:%S') + " ERROR: Failed to prove inclusion of all new entries in " + url
-# errors.append(time.strftime('%H:%M:%S') + " ERROR: Failed to prove inclusion of all new entries in " + url)
-# except:
-# print time.strftime('%H:%M:%S') + " ERROR: Failed to prove inclusion of all new entries in " + url
-# errors.append(time.strftime('%H:%M:%S') + " ERROR: Failed to prove inclusion of all new entries in " + url)
-
-
-
-# def verify_inclusion_by_hash(base_url, leaf_hash):
-# try:
-# tmp_sth = get_sth(base_url)
-# proof = get_proof_by_hash(base_url, leaf_hash, tmp_sth["tree_size"])
-# decoded_inclusion_proof = []
-# for item in proof["audit_path"]:
-# decoded_inclusion_proof.append(base64.b64decode(item))
-
-# root = base64.b64encode(verify_inclusion_proof(decoded_inclusion_proof, proof["leaf_index"], tmp_sth["tree_size"], leaf_hash))
-# if tmp_sth["sha256_root_hash"] == root:
-# return True
-# else:
-# print time.strftime('%H:%M:%S') + " ERROR: Could not prove inclusion for entry " + str(proof["leaf_index"]) + " in " + base_url
-# return False
-# except:
-# print time.strftime('%H:%M:%S') + " ERROR: Could not prove inclusion for hashed entry in " + base_url
-# return False
+
# def verify_inclusion_by_index(base_url, index):
# try: