Explicit check for signature length before verifying to avoid exception

This commit is contained in:
Ondrej Mikle 2017-10-27 19:23:28 +02:00
parent 5730ad184c
commit d4a382ed2f

View file

@ -185,6 +185,9 @@ class DesfireEd25519Authenthicator(object):
try:
ndefSignature = self.nfcReader.readDesfireNDEF()
if len(ndefSignature) != 64:
logging.error("NDEF signature has wrong length")
return None
if self.signatureCheck(uid_hex.decode("hex"), ndefSignature):
return UidRecord(uid_hex, nick)
else: