summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/encryption/lib')
-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;
}
/**