mirror of
https://github.com/adulau/netbeacon.git
synced 2024-11-21 09:37:09 +00:00
Sequence is an unsigned integer
This commit is contained in:
parent
66a5b4866a
commit
40aeeb4fe3
1 changed files with 2 additions and 2 deletions
|
@ -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'])
|
||||
|
|
Loading…
Reference in a new issue