mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 15:06:06 +00:00
hmac api key check with hex
This commit is contained in:
@@ -70,10 +70,16 @@ class Hmac implements Login
|
||||
|
||||
$string = $request->getMethod() . ' ' . $request->getResourcePath();
|
||||
|
||||
// To become a legacy.
|
||||
if ($hash === ApiKey::hash($secretKey, $string)) {
|
||||
return Result::success($user);
|
||||
}
|
||||
|
||||
// As of v8.4.1.
|
||||
if ($hash === hash_hmac('sha256', $string, $secretKey)) {
|
||||
return Result::success($user);
|
||||
}
|
||||
|
||||
return Result::fail(FailReason::HASH_NOT_MATCHED);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user