summaryrefslogtreecommitdiff
path: root/tools/certtools.py
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2017-02-07 14:41:59 +0100
committerLinus Nordberg <linus@nordu.net>2017-02-07 14:41:59 +0100
commit71cc72d3c5e977355ebb0aa8bcb065a08207ec2f (patch)
tree1cdb0030b875fae416f45f138c4c85c58afa2ea2 /tools/certtools.py
parent81292083fab81009ac9b1401947feefd094b9384 (diff)
Parallelised merge, sth phase.
Diffstat (limited to 'tools/certtools.py')
-rw-r--r--tools/certtools.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/certtools.py b/tools/certtools.py
index 9febc69..82339aa 100644
--- a/tools/certtools.py
+++ b/tools/certtools.py
@@ -761,3 +761,21 @@ def write_file(fn, jsondata):
tempname = fn + ".new"
open(tempname, 'w').write(json.dumps(jsondata))
mv_file(tempname, fn)
+
+def generate_tree_head_signature(signingnodes, own_key,
+ tree_size, timestamp, root_hash):
+ 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)
+ if tree_head_signature == None:
+ logging.error("Could not contact any signing nodes")
+
+ return tree_head_signature