summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-04-16 13:47:27 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2015-04-16 14:30:19 +0200
commite93f262eac858bc149872966c85e8019a1970d0a (patch)
tree79088df187ddb383d0b1f770c176584f5b7fe184 /apps/encryption/lib
parent99b0c6e525e71de18245ba434852389349b4f2d7 (diff)
downloadnextcloud-server-e93f262eac858bc149872966c85e8019a1970d0a.tar.gz
nextcloud-server-e93f262eac858bc149872966c85e8019a1970d0a.zip
display warning if password changed or if the keys are not initialized
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 87adf75c924..0661b6762ee 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;
}
/**