summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/ajax/changeRecoveryPassword.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-07-21 13:02:28 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2014-07-23 12:14:01 +0200
commit4bbdcfbccfe1fef28d3b6feea8a742e156295a63 (patch)
tree4b920bc9e16ad4d5b4c1b2e2b8fc521ba9e0dd6e /apps/files_encryption/ajax/changeRecoveryPassword.php
parentddd8eae9320bcd5317f18a6305120c358f72bcdd (diff)
downloadnextcloud-server-4bbdcfbccfe1fef28d3b6feea8a742e156295a63.tar.gz
nextcloud-server-4bbdcfbccfe1fef28d3b6feea8a742e156295a63.zip
support aes 256
Diffstat (limited to 'apps/files_encryption/ajax/changeRecoveryPassword.php')
-rw-r--r--apps/files_encryption/ajax/changeRecoveryPassword.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/files_encryption/ajax/changeRecoveryPassword.php b/apps/files_encryption/ajax/changeRecoveryPassword.php
index 0cb010d3b56..99cc7b3cdde 100644
--- a/apps/files_encryption/ajax/changeRecoveryPassword.php
+++ b/apps/files_encryption/ajax/changeRecoveryPassword.php
@@ -35,11 +35,12 @@ $encryptedRecoveryKey = $view->file_get_contents($keyPath);
$decryptedRecoveryKey = \OCA\Encryption\Crypt::decryptPrivateKey($encryptedRecoveryKey, $oldPassword);
if ($decryptedRecoveryKey) {
-
- $encryptedRecoveryKey = \OCA\Encryption\Crypt::symmetricEncryptFileContent($decryptedRecoveryKey, $newPassword);
- $view->file_put_contents($keyPath, $encryptedRecoveryKey);
-
- $return = true;
+ $cipher = \OCA\Encryption\Helper::getCipher();
+ $encryptedKey = \OCA\Encryption\Crypt::symmetricEncryptFileContent($decryptedRecoveryKey, $newPassword, $cipher);
+ if ($encryptedKey) {
+ \OCA\Encryption\Keymanager::setPrivateSystemKey($encryptedKey, $keyId . '.private.key');
+ $return = true;
+ }
}
\OC_FileProxy::$enabled = $proxyStatus;