summaryrefslogtreecommitdiff
path: root/tools/certtools.py
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2016-07-16 17:26:54 +0200
committerLinus Nordberg <linus@nordu.net>2016-07-16 17:26:54 +0200
commit374900dca397ba8fe38fc028e9eb657feb5ce073 (patch)
tree708bfe4081bf50961bab983e0e4a610cd7ac1355 /tools/certtools.py
parentcde186313b20e46be41736c9ac506674fa4f2d23 (diff)
WIP
NOTE: tests don't work -- SCT's don't validate
Diffstat (limited to 'tools/certtools.py')
-rw-r--r--tools/certtools.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/certtools.py b/tools/certtools.py
index 9296401..ec4177c 100644
--- a/tools/certtools.py
+++ b/tools/certtools.py
@@ -137,7 +137,7 @@ def pyopenssl_https_get(url):
return response_lines[len(response_lines) - 1]
def get_sth(baseurl):
- result = urlopen(baseurl + "open/gaol/v1/get-sth").read()
+ result = urlopen(baseurl + "dt/v1/get-sth").read()
return json.loads(result)
def get_proof_by_hash(baseurl, hash, tree_size):
@@ -145,7 +145,7 @@ def get_proof_by_hash(baseurl, hash, tree_size):
params = urllib.urlencode({"hash":base64.b64encode(hash),
"tree_size":tree_size})
result = \
- urlopen(baseurl + "open/gaol/v1/get-proof-by-hash?" + params).read()
+ urlopen(baseurl + "dt/v1/get-proof-by-hash?" + params).read()
return json.loads(result)
except urllib2.HTTPError, e:
print "ERROR:", e.read()
@@ -156,7 +156,7 @@ def get_consistency_proof(baseurl, tree_size1, tree_size2):
params = urllib.urlencode({"first":tree_size1,
"second":tree_size2})
result = \
- urlopen(baseurl + "open/gaol/v1/get-sth-consistency?" + params).read()
+ urlopen(baseurl + "dt/v1/get-sth-consistency?" + params).read()
return json.loads(result)["consistency"]
except urllib2.HTTPError, e:
print "ERROR:", e.read()
@@ -179,7 +179,8 @@ def unpack_tls_array(packed_data, length_len):
def add_chain(baseurl, submission):
try:
- result = urlopen(baseurl + "open/gaol/v1/add-blob", json.dumps(submission)).read()
+ result = urlopen(baseurl + "dt/v1/add-rr-chain",
+ json.dumps(submission)).read()
return json.loads(result)
except urllib2.HTTPError, e:
print "ERROR", e.code,":", e.read()
@@ -196,7 +197,7 @@ def add_chain(baseurl, submission):
def add_prechain(baseurl, submission):
try:
- result = urlopen(baseurl + "open/gaol/v1/add-pre-chain",
+ result = urlopen(baseurl + "dt/v1/add-pre-chain",
json.dumps(submission)).read()
return json.loads(result)
except urllib2.HTTPError, e:
@@ -215,7 +216,7 @@ def add_prechain(baseurl, submission):
def get_entries(baseurl, start, end):
params = urllib.urlencode({"start":start, "end":end})
try:
- result = urlopen(baseurl + "open/gaol/v1/get-entries?" + params).read()
+ result = urlopen(baseurl + "dt/v1/get-entries?" + params).read()
return json.loads(result)
except urllib2.HTTPError, e:
print "ERROR:", e.read()