diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2015-03-31 20:30:54 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-04-07 13:30:29 +0200 |
commit | 4efbcb02803bfba7844276e1f83f8ecb5c6370b7 (patch) | |
tree | 45018a00474ed8b2607f6b61377f0b618e2733a3 /apps/encryption/lib | |
parent | dac94679c640a34f897802e9b61bcd871014e1ec (diff) | |
download | nextcloud-server-4efbcb02803bfba7844276e1f83f8ecb5c6370b7.tar.gz nextcloud-server-4efbcb02803bfba7844276e1f83f8ecb5c6370b7.zip |
cleanup keymanager test and add some additional tests
Diffstat (limited to 'apps/encryption/lib')
-rw-r--r-- | apps/encryption/lib/keymanager.php | 9 | ||||
-rw-r--r-- | apps/encryption/lib/recovery.php | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/apps/encryption/lib/keymanager.php b/apps/encryption/lib/keymanager.php index e8e92cd549a..f96c426a725 100644 --- a/apps/encryption/lib/keymanager.php +++ b/apps/encryption/lib/keymanager.php @@ -300,6 +300,7 @@ class KeyManager { * * @param string $uid userid * @param string $passPhrase users password + * @return boolean */ public function init($uid, $passPhrase) { try { @@ -314,6 +315,8 @@ class KeyManager { $this->session->setPrivateKey($privateKey); $this->session->setStatus(Session::INIT_SUCCESSFUL); + + return true; } /** @@ -353,14 +356,14 @@ class KeyManager { } /** - * delete file key + * delete share key * * @param string $path * @param string $keyId * @return boolean */ - public function deleteFileKey($path, $keyId) { - return $this->keyStorage->deleteFileKey($path, $keyId); + public function deleteShareKey($path, $keyId) { + return $this->keyStorage->deleteFileKey($path, $keyId . '.' . $this->shareKeyId); } diff --git a/apps/encryption/lib/recovery.php b/apps/encryption/lib/recovery.php index 00711e3bfab..4201b829ec9 100644 --- a/apps/encryption/lib/recovery.php +++ b/apps/encryption/lib/recovery.php @@ -228,7 +228,7 @@ class Recovery { if ($item['type'] === 'dir') { $this->removeRecoveryKeys($filePath . '/'); } else { - $this->keyManager->deleteFileKey($filePath, $this->keyManager->getRecoveryKeyId() . '.shareKey'); + $this->keyManager->deleteShareKey($filePath, $this->keyManager->getRecoveryKeyId()); } } } |