diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-03-30 09:59:28 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-04-07 13:30:28 +0200 |
commit | 48fc3f3afe410ee02ed9e98f4cafaaeca99ce70c (patch) | |
tree | 764e2a733cd16b5e147887418b5b870c810f368f /apps | |
parent | c266b3b5b7c382c34c8ffaad5746b3251bb4fbb5 (diff) | |
download | nextcloud-server-48fc3f3afe410ee02ed9e98f4cafaaeca99ce70c.tar.gz nextcloud-server-48fc3f3afe410ee02ed9e98f4cafaaeca99ce70c.zip |
fix unit test execution, variable naming and kill no longer used $cacheFactory
Diffstat (limited to 'apps')
-rw-r--r-- | apps/encryption/lib/keymanager.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/encryption/lib/keymanager.php b/apps/encryption/lib/keymanager.php index ea338f88ea7..b3961c8566e 100644 --- a/apps/encryption/lib/keymanager.php +++ b/apps/encryption/lib/keymanager.php @@ -111,20 +111,21 @@ class KeyManager { 'recoveryKeyId'); $this->publicShareKeyId = $this->config->getAppValue('encryption', 'publicShareKeyId'); + $this->log = $log; if (empty($this->publicShareKeyId)) { $this->publicShareKeyId = 'pubShare_' . substr(md5(time()), 0, 8); $this->config->setAppValue('encryption', 'publicShareKeyId', $this->publicShareKeyId); - $keypair = $this->crypt->createKeyPair(); + $keyPair = $this->crypt->createKeyPair(); // Save public key $this->keyStorage->setSystemUserKey( $this->publicShareKeyId . '.publicKey', - $keypair['publicKey']); + $keyPair['publicKey']); // Encrypt private key empty passphrase - $encryptedKey = $this->crypt->symmetricEncryptFileContent($keypair['privateKey'], ''); + $encryptedKey = $this->crypt->symmetricEncryptFileContent($keyPair['privateKey'], ''); if ($encryptedKey) { $this->keyStorage->setSystemUserKey($this->publicShareKeyId . '.privateKey', $encryptedKey); } else { @@ -337,7 +338,7 @@ class KeyManager { public function setPassphrase($params, IUserSession $user, Util $util) { // Get existing decrypted private key - $privateKey = self::$cacheFactory->get('privateKey'); + $privateKey = self::$session->get('privateKey'); if ($params['uid'] === $user->getUser()->getUID() && $privateKey) { @@ -372,17 +373,17 @@ class KeyManager { $newUserPassword = $params['password']; - $keypair = $this->crypt->createKeyPair(); + $keyPair = $this->crypt->createKeyPair(); // Disable encryption proxy to prevent recursive calls $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; // Save public key - $this->setPublicKey($user, $keypair['publicKey']); + $this->setPublicKey($user, $keyPair['publicKey']); // Encrypt private key with new password - $encryptedKey = $this->crypt->symmetricEncryptFileContent($keypair['privateKey'], + $encryptedKey = $this->crypt->symmetricEncryptFileContent($keyPair['privateKey'], $newUserPassword); if ($encryptedKey) { |