]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix broken legacy tests
authorFlorin Peter <github@florin-peter.de>
Fri, 17 May 2013 19:59:53 +0000 (21:59 +0200)
committerFlorin Peter <github@florin-peter.de>
Fri, 17 May 2013 19:59:53 +0000 (21:59 +0200)
apps/files_encryption/lib/crypt.php
apps/files_encryption/tests/crypt.php

index 56dacc94b0ce184d323fbd346d5c30daf85c7d22..046b4601b0613a104e5ce86a474bfda0cd9cbf52 100755 (executable)
@@ -652,7 +652,7 @@ class Crypt {
                return $legacyEncKey;\r
        \r
        }\r
-       \r
+\r
        /**\r
         * @brief encrypts content using legacy blowfish system\r
         * @param $content the cleartext message you want to encrypt\r
@@ -683,7 +683,7 @@ class Crypt {
                \r
                $decrypted = $bf->decrypt( $content );\r
                \r
-               return $decrypted;\r
+               return rtrim($decrypted, "\0");;\r
                \r
        }\r
 \r
index 69fd99d9a82779ca9a9970c215796e8613da7ca9..9737eefb96c72ec021bbb32e9ba35646e446a685 100755 (executable)
@@ -595,7 +595,7 @@ class Test_Crypt extends \PHPUnit_Framework_TestCase {
         */
        function testLegacyKeyRecryptKeyfileEncrypt( $crypted ) {
        
-               $recrypted = Encryption\Crypt::LegacyKeyRecryptKeyfile( $crypted, $this->pass, $this->genPublicKey, $this->pass );
+               $recrypted = Encryption\Crypt::LegacyKeyRecryptKeyfile( $crypted, $this->pass, array($this->genPublicKey), $this->pass, '');
                
                $this->assertNotEquals( $this->dataLong, $recrypted['data'] );