summaryrefslogtreecommitdiff
path: root/tools/merge_sth.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/merge_sth.py')
-rwxr-xr-xtools/merge_sth.py17
1 files changed, 4 insertions, 13 deletions
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,