From 616be2a18cea1ecfee327105a58f4f397a7e28f1 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Fri, 25 Nov 2016 14:29:00 +0100 Subject: Manual rebase onto master with map/robust-distribution. --- tools/certtools.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/certtools.py') 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 -- cgit v1.1