diff options
Diffstat (limited to 'apps/files_encryption/ajax/updatePrivateKeyPassword.php')
-rw-r--r-- | apps/files_encryption/ajax/updatePrivateKeyPassword.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/files_encryption/ajax/updatePrivateKeyPassword.php b/apps/files_encryption/ajax/updatePrivateKeyPassword.php index fa5e279b21b..97da3811a0f 100644 --- a/apps/files_encryption/ajax/updatePrivateKeyPassword.php +++ b/apps/files_encryption/ajax/updatePrivateKeyPassword.php @@ -36,10 +36,8 @@ if ($passwordCorrect !== false) { $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; -$keyPath = '/' . $user . '/files_encryption/' . $user . '.private.key'; - -$encryptedKey = $view->file_get_contents($keyPath); -$decryptedKey = \OCA\Encryption\Crypt::decryptPrivateKey($encryptedKey, $oldPassword); +$encryptedKey = Encryption\Keymanager::getPrivateKey($view, $user); +$decryptedKey = $encryptedKey ? \OCA\Encryption\Crypt::decryptPrivateKey($encryptedKey, $oldPassword) : false; if ($decryptedKey) { $cipher = \OCA\Encryption\Helper::getCipher(); |