mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
Fix encryption error when openssl is installed but mcrypt isn't
backport https://github.com/defuse/php-encryption/pull/40 see https://www.xetown.com/qna/588527
This commit is contained in:
parent
8b229b91aa
commit
865e34c0d0
1 changed files with 2 additions and 2 deletions
4
vendor/defuse/php-encryption/Crypto.php
vendored
Executable file → Normal file
4
vendor/defuse/php-encryption/Crypto.php
vendored
Executable file → Normal file
|
|
@ -342,8 +342,8 @@ final class Crypto
|
|||
*/
|
||||
private static function SecureRandom($octets)
|
||||
{
|
||||
self::EnsureFunctionExists("mcrypt_create_iv");
|
||||
$random = mcrypt_create_iv($octets, MCRYPT_DEV_URANDOM);
|
||||
self::EnsureFunctionExists("openssl_random_pseudo_bytes");
|
||||
$random = openssl_random_pseudo_bytes($octets);
|
||||
if ($random === FALSE) {
|
||||
throw new CannotPerformOperationException();
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue