[Pkg-owncloud-commits] [owncloud] 129/258: first check if a private key exists, if not it is always a recovery szenario
David Prévot
taffit at moszumanska.debian.org
Sat Oct 11 17:22:28 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit bd7f6c9e18ed113c138ff6e8fccf23f960f34c88
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date: Mon Sep 22 15:04:55 2014 +0200
first check if a private key exists, if not it is always a recovery szenario
---
apps/files_encryption/hooks/hooks.php | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index 0de7209..f38380b 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -205,13 +205,12 @@ class Hooks {
if (Crypt::mode() === 'server') {
$view = new \OC\Files\View('/');
+ $session = new \OCA\Encryption\Session($view);
- if ($params['uid'] === \OCP\User::getUser()) {
+ // Get existing decrypted private key
+ $privateKey = $session->getPrivateKey();
- $session = new \OCA\Encryption\Session($view);
-
- // Get existing decrypted private key
- $privateKey = $session->getPrivateKey();
+ if ($params['uid'] === \OCP\User::getUser() && $privateKey) {
// Encrypt private key with new user pwd as passphrase
$encryptedPrivateKey = Crypt::symmetricEncryptFileContent($privateKey, $params['password'], Helper::getCipher());
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list