Skip to content

Commit

Permalink
Merge pull request tlsnotary#2 from TheRushingWookie/master
Browse files Browse the repository at this point in the history
Updated to work with python 3.5.
  • Loading branch information
themighty1 authored Jan 26, 2018
2 parents 96dd7f1 + 5ac708c commit 45302aa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions aws_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import hmac
import base64
import hashlib
import urllib
from urllib import parse

if len(sys.argv) != 5:
print ('Output HTTPS GET links to be used to check the oracle status')
Expand All @@ -22,11 +22,12 @@ def makeurl(args, endpoint, abbr):
args.sort()
argstr = ''
for arg in args:
argstr += urllib.quote_plus(arg, '=')+'&'
argstr += parse.quote_plus(arg, '=')+'&'
argstr = argstr[:-1]
mhmac = hmac.new(secret, ('GET\n'+endpoint+'\n/\n'+argstr).encode('utf-8'),hashlib.sha256)
secret_bytes = bytes(secret , 'latin-1')
mhmac = hmac.new(secret_bytes, ('GET\n'+endpoint+'\n/\n'+argstr).encode('utf-8'),hashlib.sha256)
base64str = base64.b64encode(mhmac.digest()).strip().decode('utf-8')
urlenc_sig = urllib.quote_plus(base64str)
urlenc_sig = parse.quote_plus(base64str)
final_string='https://'+endpoint+'/?'+argstr+'&Signature='+urlenc_sig
print ("'" + abbr + "':'" + final_string + "',")

Expand Down

0 comments on commit 45302aa

Please sign in to comment.