mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-10-26 19:01:53 -04: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:
parent
3db15dae44
commit
ce81b339dc
2 changed files with 7 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue