summaryrefslogtreecommitdiff
path: root/tools/certtools.py
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2015-05-29 17:44:22 +0200
committerLinus Nordberg <linus@nordu.net>2015-05-29 17:44:22 +0200
commitc14d572f160f05e3d532714ad3b62c0b20b03aa1 (patch)
treef878ee42e0ccf81323d55cceeeb6823b6cddad58 /tools/certtools.py
parentd9df4af0fcc91e1988a411892bba0b792ce62427 (diff)
parent42eebf1c68849b1367a8e87757f8019732058c50 (diff)
Merge remote-tracking branch 'refs/remotes/map/fsynclogorder'
Diffstat (limited to 'tools/certtools.py')
-rw-r--r--tools/certtools.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/certtools.py b/tools/certtools.py
index 405aabd..ccbc76e 100644
--- a/tools/certtools.py
+++ b/tools/certtools.py
@@ -219,7 +219,12 @@ def encode_signature(hash_alg, signature_alg, unpacked_signature):
def check_signature(baseurl, signature, data, publickey=None):
if publickey == None:
- publickey = base64.decodestring(publickeys[baseurl])
+ if baseurl in publickeys:
+ publickey = base64.decodestring(publickeys[baseurl])
+ else:
+ print >>sys.stderr, "Public key for", baseurl, \
+ "not found, specify key file with --publickey"
+ sys.exit(1)
(hash_alg, signature_alg, unpacked_signature) = decode_signature(signature)
assert hash_alg == 4, \
"hash_alg is %d, expected 4" % (hash_alg,) # sha256