diff options
-rw-r--r-- | tools/certtools.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/tools/certtools.py b/tools/certtools.py index a054bbb..09d8c10 100644 --- a/tools/certtools.py +++ b/tools/certtools.py @@ -4,8 +4,6 @@ import subprocess import json import base64 -import urllib2 -import ssl import urlparse import struct import sys @@ -407,8 +405,6 @@ def pack_cert(cert): return tls_array(cert, 3) def unpack_mtl(merkle_tree_leaf): - version = merkle_tree_leaf[0:1] - leaf_type = merkle_tree_leaf[1:2] timestamped_entry = merkle_tree_leaf[2:] (timestamp, entry_type) = struct.unpack(">QH", timestamped_entry[0:10]) if entry_type == 0: @@ -478,7 +474,6 @@ def print_inclusion_proof(proof): level += 1 def get_one_cert(store, i): - filename = i / 10000 zf = zipfile.ZipFile("%s/%04d.zip" % (store, i / 10000)) cert = zf.read("%08d" % i) zf.close() @@ -500,9 +495,9 @@ def get_timestamp_from_certfile(cert): return int(line[len("Timestamp: "):]) return None -def get_proof(store, tree_size, n): +def get_proof(baseurl, store, tree_size, n): hash = get_hash_from_certfile(get_one_cert(store, n)) - return get_proof_by_hash(args.baseurl, hash, tree_size) + return get_proof_by_hash(baseurl, hash, tree_size) def get_certs_from_zipfiles(zipfiles, firstleaf, lastleaf): for i in range(firstleaf, lastleaf + 1): |