summaryrefslogtreecommitdiffstats
path: root/apps/encryption
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2016-03-02 19:25:44 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2016-03-18 11:06:14 +0100
commit89223379ad155ae0896d1481089e3751257aa76f (patch)
treeb0e8f229ad3bbf4197499b7fc9b0626c699a2b9c /apps/encryption
parent5e267589d40400223e5dce692568ab2933be14f7 (diff)
downloadnextcloud-server-89223379ad155ae0896d1481089e3751257aa76f.tar.gz
nextcloud-server-89223379ad155ae0896d1481089e3751257aa76f.zip
replaceUserKeys() actually deletes the users keys -> update method name and doc-block
Diffstat (limited to 'apps/encryption')
-rw-r--r--apps/encryption/hooks/userhooks.php2
-rw-r--r--apps/encryption/lib/keymanager.php4
-rw-r--r--apps/encryption/tests/hooks/UserHooksTest.php2
3 files changed, 5 insertions, 3 deletions
diff --git a/apps/encryption/hooks/userhooks.php b/apps/encryption/hooks/userhooks.php
index 08b6c155186..b1141030bd9 100644
--- a/apps/encryption/hooks/userhooks.php
+++ b/apps/encryption/hooks/userhooks.php
@@ -296,7 +296,7 @@ class UserHooks implements IHook {
public function postPasswordReset($params) {
$password = $params['password'];
- $this->keyManager->replaceUserKeys($params['uid']);
+ $this->keyManager->deleteUserKeys($params['uid']);
$this->userSetup->setupUser($params['uid'], $password);
}
diff --git a/apps/encryption/lib/keymanager.php b/apps/encryption/lib/keymanager.php
index 1b81936aed1..f9a8f7bec3e 100644
--- a/apps/encryption/lib/keymanager.php
+++ b/apps/encryption/lib/keymanager.php
@@ -557,9 +557,11 @@ class KeyManager {
}
/**
+ * creat a backup of the users private and public key and then delete it
+ *
* @param string $uid
*/
- public function replaceUserKeys($uid) {
+ public function deleteUserKeys($uid) {
$this->backupAllKeys('password_reset');
$this->deletePublicKey($uid);
$this->deletePrivateKey($uid);
diff --git a/apps/encryption/tests/hooks/UserHooksTest.php b/apps/encryption/tests/hooks/UserHooksTest.php
index 1aeafad0ba2..34cd74cd369 100644
--- a/apps/encryption/tests/hooks/UserHooksTest.php
+++ b/apps/encryption/tests/hooks/UserHooksTest.php
@@ -251,7 +251,7 @@ class UserHooksTest extends TestCase {
public function testPostPasswordReset() {
$this->keyManagerMock->expects($this->once())
- ->method('replaceUserKeys')
+ ->method('deleteUserKeys')
->with('testUser');
$this->userSetupMock->expects($this->once())