rasmus Sun, 26 Jul 2009 08:13:40 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=286353
Log: Fix a bunch of binary/unicode issues in the mcrypt tests Changed paths: U php/php-src/trunk/ext/mcrypt/tests/bug41252.phpt U php/php-src/trunk/ext/mcrypt/tests/mcrypt_cbc.phpt U php/php-src/trunk/ext/mcrypt/tests/mcrypt_cbf.phpt U php/php-src/trunk/ext/mcrypt/tests/mcrypt_decrypt.phpt U php/php-src/trunk/ext/mcrypt/tests/mcrypt_ecb.phpt U php/php-src/trunk/ext/mcrypt/tests/mcrypt_list_modes.phpt U php/php-src/trunk/ext/mcrypt/tests/mcrypt_ofb.phpt Modified: php/php-src/trunk/ext/mcrypt/tests/bug41252.phpt =================================================================== --- php/php-src/trunk/ext/mcrypt/tests/bug41252.phpt 2009-07-26 07:21:02 UTC (rev 286352) +++ php/php-src/trunk/ext/mcrypt/tests/bug41252.phpt 2009-07-26 08:13:40 UTC (rev 286353) @@ -5,7 +5,7 @@ --FILE-- <?php $td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, ''); -echo mcrypt_generic($td,'aaaaaaaa'); +echo mcrypt_generic($td,b'aaaaaaaa'); print "I'm alive!\n"; ?> --EXPECTF-- Modified: php/php-src/trunk/ext/mcrypt/tests/mcrypt_cbc.phpt =================================================================== --- php/php-src/trunk/ext/mcrypt/tests/mcrypt_cbc.phpt 2009-07-26 07:21:02 UTC (rev 286352) +++ php/php-src/trunk/ext/mcrypt/tests/mcrypt_cbc.phpt 2009-07-26 08:13:40 UTC (rev 286353) @@ -4,8 +4,8 @@ <?php if (!extension_loaded("mcrypt") || unicode_semantics()) print "skip"; ?> --FILE-- <?php -$key = "FooBar"; -$secret = "PHP Testfest 2008"; +$key = b"FooBar"; +$secret = b"PHP Testfest 2008"; $cipher = MCRYPT_RIJNDAEL_128; $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND); Modified: php/php-src/trunk/ext/mcrypt/tests/mcrypt_cbf.phpt =================================================================== --- php/php-src/trunk/ext/mcrypt/tests/mcrypt_cbf.phpt 2009-07-26 07:21:02 UTC (rev 286352) +++ php/php-src/trunk/ext/mcrypt/tests/mcrypt_cbf.phpt 2009-07-26 08:13:40 UTC (rev 286353) @@ -4,8 +4,8 @@ <?php if (!extension_loaded("mcrypt") || unicode_semantics()) print "skip"; ?> --FILE-- <?php -$key = "FooBar"; -$secret = "PHP Testfest 2008"; +$key = b"FooBar"; +$secret = b"PHP Testfest 2008"; $cipher = MCRYPT_RIJNDAEL_128; $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND); Modified: php/php-src/trunk/ext/mcrypt/tests/mcrypt_decrypt.phpt =================================================================== --- php/php-src/trunk/ext/mcrypt/tests/mcrypt_decrypt.phpt 2009-07-26 07:21:02 UTC (rev 286352) +++ php/php-src/trunk/ext/mcrypt/tests/mcrypt_decrypt.phpt 2009-07-26 08:13:40 UTC (rev 286353) @@ -4,8 +4,8 @@ <?php if (!extension_loaded("mcrypt") || unicode_semantics()) print "skip"; ?> --FILE-- <?php -$key = "FooBar"; -$secret = "PHP Testfest 2008"; +$key = b"FooBar"; +$secret = b"PHP Testfest 2008"; $mode = MCRYPT_MODE_CBC; $cipher = MCRYPT_RIJNDAEL_128; @@ -18,7 +18,7 @@ // a warning must be issued if we don't use a IV on a AES cipher, that usually requires an IV mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_CBC); -var_dump(strpos(mcrypt_decrypt(MCRYPT_BLOWFISH, "FooBar", $enc_data, MCRYPT_MODE_CBC, $iv), "Testfest") !== false); +var_dump(strpos(mcrypt_decrypt(MCRYPT_BLOWFISH, b"FooBar", $enc_data, MCRYPT_MODE_CBC, $iv), b"Testfest") !== false); --EXPECTF-- PHP Testfest 2008 Modified: php/php-src/trunk/ext/mcrypt/tests/mcrypt_ecb.phpt =================================================================== --- php/php-src/trunk/ext/mcrypt/tests/mcrypt_ecb.phpt 2009-07-26 07:21:02 UTC (rev 286352) +++ php/php-src/trunk/ext/mcrypt/tests/mcrypt_ecb.phpt 2009-07-26 08:13:40 UTC (rev 286353) @@ -4,8 +4,8 @@ <?php if (!extension_loaded("mcrypt") || unicode_semantics()) print "skip"; ?> --FILE-- <?php -$key = "FooBar"; -$secret = "PHP Testfest 2008"; +$key = b"FooBar"; +$secret = b"PHP Testfest 2008"; $cipher = MCRYPT_RIJNDAEL_128; $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND); Modified: php/php-src/trunk/ext/mcrypt/tests/mcrypt_list_modes.phpt =================================================================== --- php/php-src/trunk/ext/mcrypt/tests/mcrypt_list_modes.phpt 2009-07-26 07:21:02 UTC (rev 286352) +++ php/php-src/trunk/ext/mcrypt/tests/mcrypt_list_modes.phpt 2009-07-26 08:13:40 UTC (rev 286353) @@ -8,19 +8,19 @@ --EXPECT-- array(8) { [0]=> - string(3) "cbc" + unicode(3) "cbc" [1]=> - string(3) "cfb" + unicode(3) "cfb" [2]=> - string(3) "ctr" + unicode(3) "ctr" [3]=> - string(3) "ecb" + unicode(3) "ecb" [4]=> - string(4) "ncfb" + unicode(4) "ncfb" [5]=> - string(4) "nofb" + unicode(4) "nofb" [6]=> - string(3) "ofb" + unicode(3) "ofb" [7]=> - string(6) "stream" + unicode(6) "stream" } Modified: php/php-src/trunk/ext/mcrypt/tests/mcrypt_ofb.phpt =================================================================== --- php/php-src/trunk/ext/mcrypt/tests/mcrypt_ofb.phpt 2009-07-26 07:21:02 UTC (rev 286352) +++ php/php-src/trunk/ext/mcrypt/tests/mcrypt_ofb.phpt 2009-07-26 08:13:40 UTC (rev 286353) @@ -4,8 +4,8 @@ <?php if (!extension_loaded("mcrypt") || unicode_semantics()) print "skip"; ?> --FILE-- <?php -$key = "FooBar"; -$secret = "PHP Testfest 2008"; +$key = b"FooBar"; +$secret = b"PHP Testfest 2008"; $cipher = MCRYPT_RIJNDAEL_128; $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php