From cdadd4cd1b1051b1c993eb245a27d0250f75fa74 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Sat, 12 Mar 2016 23:11:31 +0100 Subject: [PATCH] Fallback for crappy ancient distributions Fixes https://github.com/owncloud/core/issues/23181 --- apps/encryption/lib/crypto/crypt.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/encryption/lib/crypto/crypt.php b/apps/encryption/lib/crypto/crypt.php index 645f1ff054..ca70c88488 100644 --- a/apps/encryption/lib/crypto/crypt.php +++ b/apps/encryption/lib/crypto/crypt.php @@ -266,6 +266,13 @@ class Crypt { $cipher = self::DEFAULT_CIPHER; } + // Workaround for OpenSSL 0.9.8. Fallback to an old cipher that should work. + if(OPENSSL_VERSION_NUMBER < 0x1000101f) { + if($cipher === 'AES-256-CTR' || $cipher === 'AES-128-CTR') { + $cipher = self::LEGACY_CIPHER; + } + } + return $cipher; }