aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/hooks/hooks.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption/hooks/hooks.php')
-rw-r--r--apps/files_encryption/hooks/hooks.php13
1 files changed, 1 insertions, 12 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index c52d739eaa8..47e240769bc 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -55,18 +55,7 @@ class Hooks {
$encryptedKey = Keymanager::getPrivateKey($view, $params['uid']);
- $privateKey = Crypt::symmetricDecryptFileContent($encryptedKey, $params['password']);
-
- // check if this a valid private key
- $res = openssl_pkey_get_private($privateKey);
- if(is_resource($res)) {
- $sslInfo = openssl_pkey_get_details($res);
- if(!isset($sslInfo['key'])) {
- $privateKey = false;
- }
- } else {
- $privateKey = false;
- }
+ $privateKey = Crypt::decryptPrivateKey($encryptedKey, $params['password']);
if($privateKey === false) {
\OCP\Util::writeLog('Encryption library', 'Private key for user "' . $params['uid'] . '" is not valid! Maybe the user password was changed from outside if so please change it back to gain access', \OCP\Util::ERROR);