From 40aeeb4fe3c0c9b94db1e7fd1df6453a34f63e39 Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Wed, 5 Dec 2012 08:10:17 +0100 Subject: [PATCH] Sequence is an unsigned integer --- nb_verify.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nb_verify.py b/nb_verify.py index a6ad68f..94c6935 100644 --- a/nb_verify.py +++ b/nb_verify.py @@ -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'])