mirror of
https://github.com/friendica/friendica
synced 2025-04-26 21:50:11 +00:00
Issue 3142: mcrypt is no more (as well as phpseclib)
This commit is contained in:
parent
d301a363b0
commit
f6d7ee2781
36 changed files with 85 additions and 16555 deletions
|
@ -342,9 +342,9 @@ final class Crypto
|
|||
*/
|
||||
private static function SecureRandom($octets)
|
||||
{
|
||||
self::EnsureFunctionExists("mcrypt_create_iv");
|
||||
$random = mcrypt_create_iv($octets, MCRYPT_DEV_URANDOM);
|
||||
if ($random === FALSE) {
|
||||
self::EnsureFunctionExists("openssl_random_pseudo_bytes");
|
||||
$random = openssl_random_pseudo_bytes($octets, $crypto_strong);
|
||||
if ($crypto_strong === FALSE) {
|
||||
throw new CannotPerformOperationException();
|
||||
} else {
|
||||
return $random;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue