]> source.dussan.org Git - nextcloud-server.git/commitdiff
use generated private key fro m setUp()
authorBjörn Schießle <schiessle@owncloud.com>
Mon, 3 Jun 2013 15:43:06 +0000 (17:43 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Mon, 3 Jun 2013 15:43:06 +0000 (17:43 +0200)
apps/files_encryption/tests/crypt.php

index 74f91e9b03723ef90f913d4b4fc32f43d7b93d08..bb84ff26907e4d612cf0227e91fbee1713fcb7d9 100755 (executable)
@@ -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');