diff options
author | Magnus Ahltorp <map@kth.se> | 2015-06-18 09:20:14 +0100 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2015-06-18 09:20:14 +0100 |
commit | 88c0aba850f0a79ecf92070f79c6dd3e95b8cc87 (patch) | |
tree | fe1228e0e518b379321cd1056aefd696e1f56c4d /tools/mergetools.py | |
parent | b8c86cf28520b7125aeda20adeee27f3a036055e (diff) |
Preliminary merge secondary support. Change merge db to lowercase.
Diffstat (limited to 'tools/mergetools.py')
-rw-r--r-- | tools/mergetools.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/mergetools.py b/tools/mergetools.py index 5cb36c4..9e84038 100644 --- a/tools/mergetools.py +++ b/tools/mergetools.py @@ -6,19 +6,23 @@ import struct from certtools import get_leaf_hash def parselogrow(row): - return base64.b16decode(row) + return base64.b16decode(row, casefold=True) def get_logorder(filename): f = open(filename, "r") return [parselogrow(row.rstrip()) for row in f] -def read_chain(chainsdir, key): - filename = base64.b16encode(key) +def read_chain_open(chainsdir, filename): path = chainsdir + "/" + filename[0:2] + "/" + filename[2:4] + "/" + filename[4:6] + f = open(path + "/" + filename, "r") + return f + +def read_chain(chainsdir, key): + filename = base64.b16encode(key).upper() try: - f = open(path + "/" + filename, "r") + f = read_chain_open(chainsdir, filename) except IOError, e: - f = open(chainsdir + "/" + filename, "r") + f = read_chain_open(chainsdir, filename.lower()) value = f.read() f.close() return value |