Skip to content
Snippets Groups Projects

Draft: Resolve "Object / Person identification using SDM NFC cards"

1 file
+ 5
0
Compare changes
  • Side-by-side
  • Inline
@@ -46,6 +46,11 @@ class NfcSdmAuthenticator(ObjectAuthenticator):
@@ -46,6 +46,11 @@ class NfcSdmAuthenticator(ObjectAuthenticator):
if card.person != obj:
if card.person != obj:
raise BadRequest("Card is not linked to identified object")
raise BadRequest("Card is not linked to identified object")
 
if card.last_read_counter <= res["read_ctr"]:
 
raise BadRequest("Read counter went backwards, possible replay attack")
 
card.last_read_counter = res["read_ctr"]
 
card.save()
 
return True
return True
Loading