From cea9208ceccda86a33ec294926d39adecb962ed2 Mon Sep 17 00:00:00 2001 From: Florin Peter Date: Fri, 17 May 2013 21:59:53 +0200 Subject: [PATCH] fix broken legacy tests --- apps/files_encryption/lib/crypt.php | 4 ++-- apps/files_encryption/tests/crypt.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php index 56dacc94b0..046b4601b0 100755 --- a/apps/files_encryption/lib/crypt.php +++ b/apps/files_encryption/lib/crypt.php @@ -652,7 +652,7 @@ class Crypt { return $legacyEncKey; } - + /** * @brief encrypts content using legacy blowfish system * @param $content the cleartext message you want to encrypt @@ -683,7 +683,7 @@ class Crypt { $decrypted = $bf->decrypt( $content ); - return $decrypted; + return rtrim($decrypted, "\0");; } diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php index 69fd99d9a8..9737eefb96 100755 --- a/apps/files_encryption/tests/crypt.php +++ b/apps/files_encryption/tests/crypt.php @@ -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'] );