mirror of
https://github.com/adulau/netbeacon.git
synced 2024-11-21 17:47:07 +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
|
i = 0
|
||||||
m = {}
|
m = {}
|
||||||
for v in line.rsplit(';'):
|
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)
|
m[message_keys[i]] = int(v)
|
||||||
else:
|
else:
|
||||||
m[message_keys[i]] = v
|
m[message_keys[i]] = v
|
||||||
|
@ -42,7 +42,7 @@ for line in sys.stdin:
|
||||||
m = {}
|
m = {}
|
||||||
m = nbparse(message=line)
|
m = nbparse(message=line)
|
||||||
print m['hmac']
|
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):
|
if m['hmac'] == nbsign(message=message):
|
||||||
print "valid signature for "+message
|
print "valid signature for "+message
|
||||||
timedelta = deltafromnow(epoch=m['epoch'])
|
timedelta = deltafromnow(epoch=m['epoch'])
|
||||||
|
|
Loading…
Reference in a new issue