From 132fb7d3e2874932b4a3a36b5bb7815ce93f4d96 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 3 May 2012 00:09:09 +0200 Subject: added some blowfish tests upstream plus a test for our modifications --- _test/tests/inc/blowfish.test.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 _test/tests/inc/blowfish.test.php (limited to '_test') diff --git a/_test/tests/inc/blowfish.test.php b/_test/tests/inc/blowfish.test.php new file mode 100644 index 000000000..972df11f4 --- /dev/null +++ b/_test/tests/inc/blowfish.test.php @@ -0,0 +1,33 @@ +assertEquals( + $string, + PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret) + ); + } + + public function testEncryptDecryptChars() { + $secret = '$%ÄüfuDFRR'; + $string = 'abcDEF012!"§$%&/()=?`´"\',.;:-_#+*~öäüÖÄÜ^°²³'; + $this->assertEquals( + $string, + PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret) + ); + } + + // FS#1690 FS#1713 + public function testEncryptDecryptBinary() { + $secret = '$%ÄüfuDFRR'; + $string = "this is\0binary because of\0zero bytes"; + $this->assertEquals( + $string, + PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret) + ); + } +} -- cgit v1.2.3