[Pkg-owncloud-commits] [owncloud] 17/165: decrypt private key for public shares correctly

David Prévot taffit at moszumanska.debian.org
Thu Apr 23 04:06:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 959665003b408ed837066307350fb76b83beaa52
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Wed Apr 15 19:37:03 2015 +0200

    decrypt private key for public shares correctly
---
 apps/encryption/lib/crypto/crypt.php         | 4 ++--
 apps/encryption/lib/keymanager.php           | 2 +-
 apps/encryption/tests/lib/KeyManagerTest.php | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/apps/encryption/lib/crypto/crypt.php b/apps/encryption/lib/crypto/crypt.php
index c026aa6..9ada920 100644
--- a/apps/encryption/lib/crypto/crypt.php
+++ b/apps/encryption/lib/crypto/crypt.php
@@ -231,7 +231,7 @@ class Crypt {
 	 * @param string $password
 	 * @return bool|string
 	 */
-	public function decryptPrivateKey($privateKey, $password) {
+	public function decryptPrivateKey($privateKey, $password = '') {
 
 		$header = $this->parseHeader($privateKey);
 
@@ -273,7 +273,7 @@ class Crypt {
 	 * @return string
 	 * @throws DecryptionFailedException
 	 */
-	public function symmetricDecryptFileContent($keyFileContents, $passPhrase = '', $cipher = self::DEFAULT_CIPHER) {
+	public function symmetricDecryptFileContent($keyFileContents, $passPhrase, $cipher = self::DEFAULT_CIPHER) {
 		// Remove Padding
 		$noPadding = $this->removePadding($keyFileContents);
 
diff --git a/apps/encryption/lib/keymanager.php b/apps/encryption/lib/keymanager.php
index a280ea9..62970c1 100644
--- a/apps/encryption/lib/keymanager.php
+++ b/apps/encryption/lib/keymanager.php
@@ -337,7 +337,7 @@ class KeyManager {
 			$uid = $this->getPublicShareKeyId();
 			$shareKey = $this->getShareKey($path, $uid);
 			$privateKey = $this->keyStorage->getSystemUserKey($this->publicShareKeyId . '.privateKey');
-			$privateKey = $this->crypt->symmetricDecryptFileContent($privateKey);
+			$privateKey = $this->crypt->decryptPrivateKey($privateKey);
 		} else {
 			$shareKey = $this->getShareKey($path, $uid);
 			$privateKey = $this->session->getPrivateKey();
diff --git a/apps/encryption/tests/lib/KeyManagerTest.php b/apps/encryption/tests/lib/KeyManagerTest.php
index 1e51341..251628d 100644
--- a/apps/encryption/tests/lib/KeyManagerTest.php
+++ b/apps/encryption/tests/lib/KeyManagerTest.php
@@ -268,7 +268,7 @@ class KeyManagerTest extends TestCase {
 			->willReturn(true);
 
 		$this->cryptMock->expects($this->once())
-			->method('symmetricDecryptFileContent')
+			->method('decryptPrivateKey')
 			->willReturn(true);
 
 		$this->cryptMock->expects($this->once())

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list