Pass MCRYPT_DEV_URANDOM to mcrypt_create_iv() explicitly

This commit is contained in:
chinpei215 2018-01-20 00:25:35 +09:00
parent 5289aae64e
commit fc397bd481

View file

@ -192,7 +192,7 @@ class Security {
return openssl_random_pseudo_bytes($length);
}
if (function_exists('mcrypt_create_iv')) {
return mcrypt_create_iv($length);
return mcrypt_create_iv($length, MCRYPT_DEV_URANDOM);
}
trigger_error(
'You do not have a safe source of random data available. ' .