summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib/keymanager.php
diff options
context:
space:
mode:
authorClark Tomlinson <fallen013@gmail.com>2015-04-16 09:45:09 -0400
committerClark Tomlinson <fallen013@gmail.com>2015-04-16 09:45:09 -0400
commitac133e9faa0a3568716596e83c5ff0993c8dcf89 (patch)
treefa97f4a1d7d633050c23338407ad35e01865f551 /apps/encryption/lib/keymanager.php
parent1174ad0681bb82252a26b5ee44d5b2990171932b (diff)
parente93f262eac858bc149872966c85e8019a1970d0a (diff)
downloadnextcloud-server-ac133e9faa0a3568716596e83c5ff0993c8dcf89.tar.gz
nextcloud-server-ac133e9faa0a3568716596e83c5ff0993c8dcf89.zip
Merge pull request #15675 from owncloud/enc_error_messages
[encryption] display warning if password changed or if the keys are not initialized
Diffstat (limited to 'apps/encryption/lib/keymanager.php')
-rw-r--r--apps/encryption/lib/keymanager.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/encryption/lib/keymanager.php b/apps/encryption/lib/keymanager.php
index c098347a0ab..b451b5c25a9 100644
--- a/apps/encryption/lib/keymanager.php
+++ b/apps/encryption/lib/keymanager.php
@@ -295,6 +295,9 @@ class KeyManager {
* @return boolean
*/
public function init($uid, $passPhrase) {
+
+ $this->session->setStatus(Session::INIT_EXECUTED);
+
try {
$privateKey = $this->getPrivateKey($uid);
$privateKey = $this->crypt->decryptPrivateKey($privateKey,
@@ -305,10 +308,13 @@ class KeyManager {
return false;
}
- $this->session->setPrivateKey($privateKey);
- $this->session->setStatus(Session::INIT_SUCCESSFUL);
+ if ($privateKey) {
+ $this->session->setPrivateKey($privateKey);
+ $this->session->setStatus(Session::INIT_SUCCESSFUL);
+ return true;
+ }
- return true;
+ return false;
}
/**