Browse Source

decrypt private key for public shares correctly

tags/v8.1.0alpha2
Bjoern Schiessle 9 years ago
parent
commit
959665003b

+ 2
- 2
apps/encryption/lib/crypto/crypt.php View File

@@ -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);


+ 1
- 1
apps/encryption/lib/keymanager.php View File

@@ -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();

+ 1
- 1
apps/encryption/tests/lib/KeyManagerTest.php View File

@@ -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())

Loading…
Cancel
Save