diff options
author | Linus Nordberg <linus@nordu.net> | 2016-11-25 14:29:00 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2016-11-25 14:37:29 +0100 |
commit | 616be2a18cea1ecfee327105a58f4f397a7e28f1 (patch) | |
tree | 520ea9a3fbe29ac78ce76c4b4527a70e8a70ae1d /tools/certtools.py | |
parent | d8ce0c149f10d841dc19cbc32c8fc844aa4d65fb (diff) |
Manual rebase onto master with map/robust-distribution.
Diffstat (limited to 'tools/certtools.py')
-rw-r--r-- | tools/certtools.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/certtools.py b/tools/certtools.py index 0009d5d..e9ee99b 100644 --- a/tools/certtools.py +++ b/tools/certtools.py @@ -11,12 +11,12 @@ import struct import sys import hashlib import ecdsa -import datetime import cStringIO import zipfile import shutil import requests import warnings +from datetime import datetime from certkeys import publickeys @@ -336,8 +336,8 @@ def check_sth_signature(baseurl, sth, publickey=None): signature_type = struct.pack(">b", 1) timestamp = struct.pack(">Q", sth["timestamp"]) tree_size = struct.pack(">Q", sth["tree_size"]) - hash = base64.decodestring(sth["sha256_root_hash"]) - tree_head = version + signature_type + timestamp + tree_size + hash + ehash = base64.decodestring(sth["sha256_root_hash"]) + tree_head = version + signature_type + timestamp + tree_size + ehash check_signature(baseurl, signature, tree_head, publickey=publickey) @@ -426,7 +426,7 @@ def get_leaf_hash(merkle_tree_leaf): return leaf_hash.digest() def timing_point(timer_dict=None, name=None): - t = datetime.datetime.now() + t = datetime.now() if timer_dict: starttime = timer_dict["lasttime"] stoptime = t |