1 parent 2437fc3 commit 7fd5322Copy full SHA for 7fd5322
1 file changed
‎src/schnee/services/ntag_profile.py‎
@@ -2,6 +2,7 @@
2
3
from __future__ import annotations
4
5
+import hmac
6
import sys
7
from typing import ClassVar, NamedTuple, Self
8
@@ -697,7 +698,7 @@ def process(self) -> VerifyNtag424SdmMacResult:
697
698
counter=self.req.counter,
699
)
700
return VerifyNtag424SdmMacResult(
- valid=calculated_mac == self.req.mac,
701
+ valid=hmac.compare_digest(calculated_mac, self.req.mac),
702
calculated_mac=calculated_mac,
703
ndef_prefix=self.req.ndef_prefix,
704
prefix_removed=normalized_text.prefix_removed,
0 commit comments