]> 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>
Thu, 13 Jun 2013 11:26:59 +0000 (13:26 +0200)
apps/files_encryption/tests/crypt.php

index ccf3c52fa97dcb9fa1c8123d60c0866d49e3e2a5..a203f78bc545acc0eb25a911959c318aaa9f74ca 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');