From 4b5ddbae54d46bacc23661960b436ecd4f720026 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Fri, 2 Dec 2016 23:44:45 +0100 Subject: Add initlog.py. --- tools/merge_sth.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'tools/merge_sth.py') diff --git a/tools/merge_sth.py b/tools/merge_sth.py index 2184af1..89fcf18 100755 --- a/tools/merge_sth.py +++ b/tools/merge_sth.py @@ -18,7 +18,7 @@ from mergetools import parse_args, get_nfetched, hexencode, hexdecode, \ get_logorder, get_sth, flock_ex_or_fail, loginit from certtools import create_ssl_context, get_public_key_from_file, \ timing_point, create_sth_signature, write_file, check_sth_signature, \ - build_merkle_tree + build_merkle_tree, generate_tree_head_signature def merge_sth(args, config, localconfig): paths = localconfig["paths"] @@ -85,19 +85,10 @@ def merge_sth(args, config, localconfig): root_hash = root_hash_calc timestamp = int(time.time() * 1000) - tree_head_signature = None - for signingnode in signingnodes: - try: - tree_head_signature = \ - create_sth_signature(tree_size, timestamp, - root_hash, - "https://%s/" % signingnode["address"], - key=own_key) - break - except requests.exceptions.HTTPError, e: - logging.warning("create_sth_signature error: %s", e.response) + tree_head_signature = \ + generate_tree_head_signature(signingnodes, own_key, + tree_size, timestamp, root_hash) if tree_head_signature == None: - logging.error("Could not contact any signing nodes") return 0 sth = {"tree_size": tree_size, "timestamp": timestamp, -- cgit v1.1