summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-12-11 06:17:47 +0100
committerLukas Reschke <lukas@owncloud.com>2015-12-11 08:47:36 +0100
commitf3360d51c6d069fc873a0b5563c01d37d58727c7 (patch)
tree61ae5808a8bac6b3bf03be520465bf2da43f72a9 /apps/encryption/lib
parentacce1638e5c06e0a3c98a0450fd82df9574524dc (diff)
downloadnextcloud-server-f3360d51c6d069fc873a0b5563c01d37d58727c7.tar.gz
nextcloud-server-f3360d51c6d069fc873a0b5563c01d37d58727c7.zip
Use PHP polyfills
Diffstat (limited to 'apps/encryption/lib')
-rw-r--r--apps/encryption/lib/crypto/crypt.php31
1 files changed, 8 insertions, 23 deletions
diff --git a/apps/encryption/lib/crypto/crypt.php b/apps/encryption/lib/crypto/crypt.php
index dbc0364a157..12e9008545a 100644
--- a/apps/encryption/lib/crypto/crypt.php
+++ b/apps/encryption/lib/crypto/crypt.php
@@ -30,7 +30,6 @@ use OC\Encryption\Exceptions\DecryptionFailedException;
use OC\Encryption\Exceptions\EncryptionFailedException;
use OCA\Encryption\Exceptions\MultiKeyDecryptException;
use OCA\Encryption\Exceptions\MultiKeyEncryptException;
-use OCA\Encryption\Vendor\PBKDF2Fallback;
use OCP\Encryption\Exceptions\GenericEncryptionException;
use OCP\IConfig;
use OCP\ILogger;
@@ -293,28 +292,14 @@ class Crypt {
$salt = hash('sha256', $uid . $instanceId . $instanceSecret, true);
$keySize = $this->getKeySize($cipher);
- if (function_exists('hash_pbkdf2')) {
- $hash = hash_pbkdf2(
- 'sha256',
- $password,
- $salt,
- 100000,
- $keySize,
- true
- );
- } else {
- // fallback to 3rdparty lib for PHP <= 5.4.
- // FIXME: Can be removed as soon as support for PHP 5.4 was dropped
- $fallback = new PBKDF2Fallback();
- $hash = $fallback->pbkdf2(
- 'sha256',
- $password,
- $salt,
- 100000,
- $keySize,
- true
- );
- }
+ $hash = hash_pbkdf2(
+ 'sha256',
+ $password,
+ $salt,
+ 100000,
+ $keySize,
+ true
+ );
return $hash;
}