From: Björn Schießle Date: Tue, 11 Jun 2013 13:19:02 +0000 (+0200) Subject: Merge branch 'master' into files_encryption_check_private_key X-Git-Tag: v6.0.0alpha2~641^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=20ddd6e1c77224d18d5be74101b80144b7187475;p=nextcloud-server.git Merge branch 'master' into files_encryption_check_private_key Conflicts: apps/files_encryption/tests/crypt.php --- 20ddd6e1c77224d18d5be74101b80144b7187475 diff --cc apps/files_encryption/tests/crypt.php index d856e5d59b5,341904b1189..e6ea3bcd6b3 --- a/apps/files_encryption/tests/crypt.php +++ b/apps/files_encryption/tests/crypt.php @@@ -225,22 -240,9 +239,26 @@@ class Test_Encryption_Crypt extends \PH } + function testDecryptPrivateKey() { + + // test successful decrypt + $crypted = Encryption\Crypt::symmetricEncryptFileContent($this->genPrivateKey, 'hat'); + + $decrypted = Encryption\Crypt::decryptPrivateKey($crypted, 'hat'); + + $this->assertEquals($this->genPrivateKey, $decrypted); + + //test private key decrypt with wrong password + $wrongPasswd = Encryption\Crypt::decryptPrivateKey($crypted, 'hat2'); + + $this->assertEquals(false, $wrongPasswd); + + } + ++ + /** + * @medium + */ function testSymmetricEncryptFileContent() { # TODO: search in keyfile for actual content as IV will ensure this test always passes