summaryrefslogtreecommitdiffstats
path: root/apps/encryption/hooks
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-08-07 14:04:17 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2015-08-07 15:21:08 +0200
commit62bc0e5264af50be48dbcbb720b7bd16e8d88df5 (patch)
treead0c95913483a7ed2d866066af4ed3d5c00bab6c /apps/encryption/hooks
parent43888bb9bf46928acfe79084377b96133609ef6c (diff)
downloadnextcloud-server-62bc0e5264af50be48dbcbb720b7bd16e8d88df5.tar.gz
nextcloud-server-62bc0e5264af50be48dbcbb720b7bd16e8d88df5.zip
use password hash instead of the plain password to encrypt the private key
Diffstat (limited to 'apps/encryption/hooks')
-rw-r--r--apps/encryption/hooks/userhooks.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/encryption/hooks/userhooks.php b/apps/encryption/hooks/userhooks.php
index a86b8662781..71c0435d200 100644
--- a/apps/encryption/hooks/userhooks.php
+++ b/apps/encryption/hooks/userhooks.php
@@ -220,8 +220,7 @@ class UserHooks implements IHook {
if ($user && $params['uid'] === $user->getUID() && $privateKey) {
// Encrypt private key with new user pwd as passphrase
- $encryptedPrivateKey = $this->crypt->symmetricEncryptFileContent($privateKey,
- $params['password']);
+ $encryptedPrivateKey = $this->crypt->encryptPrivateKey($privateKey, $params['password']);
// Save private key
if ($encryptedPrivateKey) {
@@ -259,8 +258,7 @@ class UserHooks implements IHook {
$this->keyManager->setPublicKey($user, $keyPair['publicKey']);
// Encrypt private key with new password
- $encryptedKey = $this->crypt->symmetricEncryptFileContent($keyPair['privateKey'],
- $newUserPassword);
+ $encryptedKey = $this->crypt->encryptPrivateKey($keyPair['privateKey'], $newUserPassword);
if ($encryptedKey) {
$this->keyManager->setPrivateKey($user, $this->crypt->generateHeader() . $encryptedKey);