mirror of
https://github.com/markqvist/Reticulum
synced 2026-11-22 23:10:32 +00:00
This will have *zero* effect on any actual, real-world or otherwise just tangentially relevant physically viable situation, but at this point I am fed up with receiving a daily dose of overly verbose machine soup from yet another random LLM-bro who's playing security researcher, so there you have it, now ffs leave me in peace to do some *actual* work, and keep your tech-fantasy wanking to yourself, thank you very much.
This commit is contained in:
2 files changed
+7
-2
No files matched your search
@@ -180,4 +180,9 @@ def digest(key, msg, digest):
|
||||
outer.update(key.translate(trans_5C))
|
||||
inner.update(msg)
|
||||
outer.update(inner.digest())
|
||||
return outer.digest()
|
||||
return outer.digest()
|
||||
|
||||
def _cd_internal(a, b): return a == b
|
||||
try: from hmac import compare_digest as _cd
|
||||
except ImportError: _cd = _cd_internal
|
||||
compare_digest = _cd
|
||||
@@ -80,7 +80,7 @@ class Token():
|
||||
received_hmac = token[-32:]
|
||||
expected_hmac = HMAC.new(self._signing_key, token[:-32]).digest()
|
||||
|
||||
if received_hmac == expected_hmac: return True
|
||||
if HMAC.compare_digest(received_hmac, expected_hmac): return True
|
||||
else: return False
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user