mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
remove no random_bytes fallback
This commit is contained in:
@@ -159,17 +159,6 @@ class EspoManager implements Manager
|
||||
{
|
||||
$length = self::TOKEN_RANDOM_LENGTH;
|
||||
|
||||
if (function_exists('random_bytes')) {
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
return bin2hex(random_bytes($length));
|
||||
}
|
||||
|
||||
if (function_exists('openssl_random_pseudo_bytes')) {
|
||||
$randomValue = openssl_random_pseudo_bytes($length);
|
||||
|
||||
return bin2hex($randomValue);
|
||||
}
|
||||
|
||||
throw new RuntimeException("Could not generate token.");
|
||||
return bin2hex(random_bytes($length));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -665,10 +665,6 @@ class Util
|
||||
*/
|
||||
public static function generateCryptId(): string
|
||||
{
|
||||
if (!function_exists('random_bytes')) {
|
||||
return self::generateMoreEntropyId();
|
||||
}
|
||||
|
||||
return bin2hex(random_bytes(16));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user