Sequence is an unsigned integer

This commit is contained in:
Alexandre Dulaunoy 2012-12-05 08:10:17 +01:00
parent 66a5b4866a
commit 40aeeb4fe3

View file

@ -23,7 +23,7 @@ def nbparse(message=None):
i = 0
m = {}
for v in line.rsplit(';'):
if message_keys[i] == "epoch":
if message_keys[i] == "epoch" or message_keys[i] == "sequence":
m[message_keys[i]] = int(v)
else:
m[message_keys[i]] = v
@ -42,7 +42,7 @@ for line in sys.stdin:
m = {}
m = nbparse(message=line)
print m['hmac']
message = m['header']+";"+str(m['epoch'])+";"+m['sequence']+";"
message = m['header']+";"+str(m['epoch'])+";"+str(m['sequence'])+";"
if m['hmac'] == nbsign(message=message):
print "valid signature for "+message
timedelta = deltafromnow(epoch=m['epoch'])