remove no random_bytes fallback

This commit is contained in:
Yuri Kuznetsov
2025-03-19 13:55:15 +02:00
parent 81937ca606
commit ca5aa8edf0
2 changed files with 1 additions and 16 deletions

View File

@@ -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));
}
}

View File

@@ -665,10 +665,6 @@ class Util
*/
public static function generateCryptId(): string
{
if (!function_exists('random_bytes')) {
return self::generateMoreEntropyId();
}
return bin2hex(random_bytes(16));
}