From b9ff16498befe211205ea3c20c2eb341f97919fa Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Tue, 5 Jan 2016 17:08:57 +0100 Subject: Use random_bytes instead OpenSSL --- apps/encryption/lib/crypto/crypt.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'apps') diff --git a/apps/encryption/lib/crypto/crypt.php b/apps/encryption/lib/crypto/crypt.php index e071819b163..d5a41c29009 100644 --- a/apps/encryption/lib/crypto/crypt.php +++ b/apps/encryption/lib/crypto/crypt.php @@ -614,14 +614,7 @@ class Crypt { * @throws \Exception */ public function generateFileKey() { - // Generate key - $key = base64_encode(openssl_random_pseudo_bytes(32, $strong)); - if (!$key || !$strong) { - // If OpenSSL indicates randomness is insecure, log error - throw new \Exception('Encryption library, Insecure symmetric key was generated using openssl_random_pseudo_bytes()'); - } - - return $key; + return base64_encode(random_bytes(32)); } /** -- cgit v1.2.3