From: Björn Schießle Date: Mon, 3 Jun 2013 15:43:06 +0000 (+0200) Subject: use generated private key fro m setUp() X-Git-Tag: v6.0.0alpha2~641^2~18 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1e601cd6f1a4be0f3736467e08c6de8603b6aad0;p=nextcloud-server.git use generated private key fro m setUp() --- diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php index 74f91e9b037..bb84ff26907 100755 --- a/apps/files_encryption/tests/crypt.php +++ b/apps/files_encryption/tests/crypt.php @@ -228,14 +228,12 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { function testDecryptPrivateKey() { - $keypair = Encryption\Crypt::createKeypair(); - // test successful decrypt - $crypted = Encryption\Crypt::symmetricEncryptFileContent($keypair['privateKey'], 'hat'); + $crypted = Encryption\Crypt::symmetricEncryptFileContent($this->genPrivateKey, 'hat'); $decrypted = Encryption\Crypt::decryptPrivateKey($crypted, 'hat'); - $this->assertEquals($keypair['privateKey'], $decrypted); + $this->assertEquals($this->genPrivateKey, $decrypted); //test private key decrypt with wrong password $wrongPasswd = Encryption\Crypt::decryptPrivateKey($crypted, 'hat2');