summaryrefslogtreecommitdiff
path: root/tools/mergetools.py
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2015-06-18 09:20:14 +0100
committerLinus Nordberg <linus@nordu.net>2015-07-31 15:51:29 +0200
commit803adf14ec4116d2997feca38c4c259d5d47f71a (patch)
tree310a31650464d3eb69792f2b45ecf74b042ac615 /tools/mergetools.py
parentb6af0ebacb8cda356edc4769c2751eea06d43aea (diff)
Preliminary merge secondary support. Change merge db to lowercase.
Diffstat (limited to 'tools/mergetools.py')
-rw-r--r--tools/mergetools.py14
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