This commit is contained in:
lolcat committed 2026-11-30 17:24:40 -05:00
1 parent ffb1fc00f3
commit b120d441d5
2 files changed
+13 -2

No files matched your search

+2 -2
View File
@@ -347,7 +347,7 @@ class backend{
$header = pack("CN", $purpose, intdiv(time(), 60));
$hash = hash_hmac("sha256", $header . $payload, config::HMAC_SECRET, true);
$hash = hash_hmac("sha256", $header . $payload, hex2bin(config::HMAC_SECRET), true);
return rtrim(strtr(base64_encode(
$header . $hash
@@ -403,7 +403,7 @@ class backend{
// check hmac
$r_header = pack("CN", $expected_purpose, $timestamp);
$r_hash = hash_hmac("sha256", $r_header . $payload, config::HMAC_SECRET, true);
$r_hash = hash_hmac("sha256", $r_header . $payload, hex2bin(config::HMAC_SECRET), true);
if(!hash_equals($signature, $r_hash)){