f
This commit is contained in:
1 parent
ffb1fc00f3
commit
b120d441d5
2 files changed
+13
-2
No files matched your search
+2
-2
@@ -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)){
|
||||
|
||||
|
||||
Reference in new issue
Block a user