From 7810659cc372b17d48a7f0a799cc1509471916a1 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 9 Mar 2015 11:14:35 +0100 Subject: [PATCH] Removed deprecated mcrypt_ecb() etc --- NEWS | 1 + UPGRADING | 5 +- ext/mcrypt/mcrypt.c | 100 ------- ext/mcrypt/tests/mcrypt_cbc.phpt | 16 +- ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt | 34 +-- ext/mcrypt/tests/mcrypt_cbc_3des_encrypt.phpt | 34 +-- ext/mcrypt/tests/mcrypt_cbc_error.phpt | 56 ---- ext/mcrypt/tests/mcrypt_cbc_variation1.phpt | 256 ------------------ ext/mcrypt/tests/mcrypt_cbc_variation2.phpt | 255 ----------------- ext/mcrypt/tests/mcrypt_cbc_variation3.phpt | 235 ---------------- ext/mcrypt/tests/mcrypt_cbc_variation4.phpt | 231 ---------------- ext/mcrypt/tests/mcrypt_cbc_variation5.phpt | 256 ------------------ ext/mcrypt/tests/mcrypt_cfb.phpt | 14 +- ext/mcrypt/tests/mcrypt_ecb.phpt | 12 +- ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt | 18 +- ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt | 18 +- ext/mcrypt/tests/mcrypt_ecb_error.phpt | 54 ---- ext/mcrypt/tests/mcrypt_ecb_variation1.phpt | 232 ---------------- ext/mcrypt/tests/mcrypt_ecb_variation2.phpt | 232 ---------------- ext/mcrypt/tests/mcrypt_ecb_variation3.phpt | 212 --------------- ext/mcrypt/tests/mcrypt_ecb_variation4.phpt | 207 -------------- ext/mcrypt/tests/mcrypt_ecb_variation5.phpt | 212 --------------- ext/mcrypt/tests/mcrypt_ofb.phpt | 14 +- .../tests/mcrypt_rijndael128_128BitKey.phpt | 47 +--- 24 files changed, 49 insertions(+), 2702 deletions(-) delete mode 100644 ext/mcrypt/tests/mcrypt_cbc_error.phpt delete mode 100644 ext/mcrypt/tests/mcrypt_cbc_variation1.phpt delete mode 100644 ext/mcrypt/tests/mcrypt_cbc_variation2.phpt delete mode 100644 ext/mcrypt/tests/mcrypt_cbc_variation3.phpt delete mode 100644 ext/mcrypt/tests/mcrypt_cbc_variation4.phpt delete mode 100644 ext/mcrypt/tests/mcrypt_cbc_variation5.phpt delete mode 100644 ext/mcrypt/tests/mcrypt_ecb_error.phpt delete mode 100644 ext/mcrypt/tests/mcrypt_ecb_variation1.phpt delete mode 100644 ext/mcrypt/tests/mcrypt_ecb_variation2.phpt delete mode 100644 ext/mcrypt/tests/mcrypt_ecb_variation3.phpt delete mode 100644 ext/mcrypt/tests/mcrypt_ecb_variation4.phpt delete mode 100644 ext/mcrypt/tests/mcrypt_ecb_variation5.phpt diff --git a/NEWS b/NEWS index 9a69062225267..de18fdecc467f 100644 --- a/NEWS +++ b/NEWS @@ -104,6 +104,7 @@ - Mcrypt: . Fixed possible read after end of buffer and use after free. (Dmitry) . Removed mcrypt_generic_end() alias. (Nikita) + . Removed mcrypt_ecb(), mcrypt_cbc(), mcrypt_cfb(), mcrypt_ofb(). (Nikita) - Opcache: . Fixed bug with try blocks being removed when extended_info opcode diff --git a/UPGRADING b/UPGRADING index 1312a1be3cb3b..1e81505f86b16 100644 --- a/UPGRADING +++ b/UPGRADING @@ -362,8 +362,11 @@ Other them consistent with other GMP functions. - Mcrypt - . Removed deprecate mcrypt_generic_end() alias in favor of + . Removed deprecated mcrypt_generic_end() alias in favor of mcrypt_generic_deinit(). + . Removed deprecated mcrypt_ecb(), mcrypt_cbc(), mcrypt_cfb() and mcrypt_ofb() + functions in favor of mcrypt_encrypt() and mcrypt_decrypt() with an + MCRYPT_MODE_* flag. - Session . session_start() accepts all INI settings as array. e.g. ['cache_limiter'=>'private'] diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 83184f9b6fecd..399c6313b9565 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -200,38 +200,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mcrypt_decrypt, 0, 0, 5) ZEND_ARG_INFO(0, iv) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_mcrypt_ecb, 0, 0, 5) - ZEND_ARG_INFO(0, cipher) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, data) - ZEND_ARG_INFO(0, mode) - ZEND_ARG_INFO(0, iv) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_mcrypt_cbc, 0, 0, 5) - ZEND_ARG_INFO(0, cipher) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, data) - ZEND_ARG_INFO(0, mode) - ZEND_ARG_INFO(0, iv) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_mcrypt_cfb, 0, 0, 5) - ZEND_ARG_INFO(0, cipher) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, data) - ZEND_ARG_INFO(0, mode) - ZEND_ARG_INFO(0, iv) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_mcrypt_ofb, 0, 0, 5) - ZEND_ARG_INFO(0, cipher) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, data) - ZEND_ARG_INFO(0, mode) - ZEND_ARG_INFO(0, iv) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_mcrypt_create_iv, 0, 0, 1) ZEND_ARG_INFO(0, size) ZEND_ARG_INFO(0, source) @@ -239,10 +207,6 @@ ZEND_END_ARG_INFO() /* }}} */ const zend_function_entry mcrypt_functions[] = { /* {{{ */ - PHP_DEP_FE(mcrypt_ecb, arginfo_mcrypt_ecb) - PHP_DEP_FE(mcrypt_cbc, arginfo_mcrypt_cbc) - PHP_DEP_FE(mcrypt_cfb, arginfo_mcrypt_cfb) - PHP_DEP_FE(mcrypt_ofb, arginfo_mcrypt_ofb) PHP_FE(mcrypt_get_key_size, arginfo_mcrypt_get_key_size) PHP_FE(mcrypt_get_block_size, arginfo_mcrypt_get_block_size) PHP_FE(mcrypt_get_cipher_name, arginfo_mcrypt_get_cipher_name) @@ -1342,70 +1306,6 @@ PHP_FUNCTION(mcrypt_decrypt) } /* }}} */ -/* {{{ proto string mcrypt_ecb(int cipher, string key, string data, int mode, string iv) - ECB crypt/decrypt data using key key with cipher cipher starting with iv */ -PHP_FUNCTION(mcrypt_ecb) -{ - zval *mode; - char *cipher, *key, *data, *iv = NULL; - size_t cipher_len, key_len, data_len, iv_len = 0; - - MCRYPT_GET_CRYPT_ARGS - - convert_to_long_ex(mode); - - php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ecb", iv, iv_len, Z_LVAL_P(mode), return_value); -} -/* }}} */ - -/* {{{ proto string mcrypt_cbc(int cipher, string key, string data, int mode, string iv) - CBC crypt/decrypt data using key key with cipher cipher starting with iv */ -PHP_FUNCTION(mcrypt_cbc) -{ - zval *mode; - char *cipher, *key, *data, *iv = NULL; - size_t cipher_len, key_len, data_len, iv_len = 0; - - MCRYPT_GET_CRYPT_ARGS - - convert_to_long_ex(mode); - - php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cbc", iv, iv_len, Z_LVAL_P(mode), return_value); -} -/* }}} */ - -/* {{{ proto string mcrypt_cfb(int cipher, string key, string data, int mode, string iv) - CFB crypt/decrypt data using key key with cipher cipher starting with iv */ -PHP_FUNCTION(mcrypt_cfb) -{ - zval *mode; - char *cipher, *key, *data, *iv = NULL; - size_t cipher_len, key_len, data_len, iv_len = 0; - - MCRYPT_GET_CRYPT_ARGS - - convert_to_long_ex(mode); - - php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cfb", iv, iv_len, Z_LVAL_P(mode), return_value); -} -/* }}} */ - -/* {{{ proto string mcrypt_ofb(int cipher, string key, string data, int mode, string iv) - OFB crypt/decrypt data using key key with cipher cipher starting with iv */ -PHP_FUNCTION(mcrypt_ofb) -{ - zval *mode; - char *cipher, *key, *data, *iv = NULL; - size_t cipher_len, key_len, data_len, iv_len = 0; - - MCRYPT_GET_CRYPT_ARGS - - convert_to_long_ex(mode); - - php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ofb", iv, iv_len, Z_LVAL_P(mode), return_value); -} -/* }}} */ - /* {{{ proto string mcrypt_create_iv(int size, int source) Create an initialization vector (IV) */ PHP_FUNCTION(mcrypt_create_iv) diff --git a/ext/mcrypt/tests/mcrypt_cbc.phpt b/ext/mcrypt/tests/mcrypt_cbc.phpt index c2e879370d8ab..310c4a88bd6f2 100644 --- a/ext/mcrypt/tests/mcrypt_cbc.phpt +++ b/ext/mcrypt/tests/mcrypt_cbc.phpt @@ -8,24 +8,18 @@ $key = "0123456789012345"; $secret = "PHP Testfest 2008"; $cipher = MCRYPT_RIJNDAEL_128; -$iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND); -$enc_data = mcrypt_cbc($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv); +$iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_CBC), MCRYPT_RAND); +$enc_data = mcrypt_encrypt($cipher, $key, $secret, MCRYPT_MODE_CBC, $iv); // we have to trim as AES rounds the blocks and decrypt doesnt detect that -echo trim(mcrypt_cbc($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv)) . "\n"; +echo trim(mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_CBC, $iv)) . "\n"; // a warning must be issued if we don't use a IV on a AES cipher, that usually requires an IV -var_dump(mcrypt_cbc($cipher, $key, $enc_data, MCRYPT_DECRYPT)); +var_dump(mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_CBC)); ?> --EXPECTF-- - -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d PHP Testfest 2008 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Encryption mode requires an initialization vector of size 16 in %s on line %d +Warning: mcrypt_decrypt(): Encryption mode requires an initialization vector of size 16 in %s on line %d bool(false) diff --git a/ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt b/ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt index e610f7cfa0cf3..939cc57196b86 100644 --- a/ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt +++ b/ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt @@ -14,12 +14,8 @@ if (!extension_loaded("mcrypt")) { * Alias to functions: */ -echo "*** Testing mcrypt_cbc() : basic functionality ***\n"; - - $cipher = MCRYPT_TRIPLEDES; $data = b"This is the secret message which must be encrypted"; -$mode = MCRYPT_DECRYPT; // tripledes uses keys with exactly 192 bits (24 bytes) $keys = array( @@ -51,14 +47,14 @@ $iv = b'12345678'; echo "\n--- testing different key lengths\n"; for ($i = 0; $i < sizeof($keys); $i++) { echo "\nkey length=".strlen($keys[$i])."\n"; - special_var_dump(mcrypt_cbc($cipher, $keys[$i], base64_decode($data1[$i]), $mode, $iv)); + special_var_dump(mcrypt_decrypt($cipher, $keys[$i], base64_decode($data1[$i]), MCRYPT_MODE_CBC, $iv)); } $key = b'123456789012345678901234'; echo "\n--- testing different iv lengths\n"; for ($i = 0; $i < sizeof($ivs); $i++) { echo "\niv length=".strlen($ivs[$i])."\n"; - special_var_dump(mcrypt_cbc($cipher, $key, base64_decode($data2[$i]), $mode, $ivs[$i])); + special_var_dump(mcrypt_decrypt($cipher, $key, base64_decode($data2[$i]), MCRYPT_MODE_CBC, $ivs[$i])); } function special_var_dump($str) { @@ -67,54 +63,38 @@ function special_var_dump($str) { ?> ===DONE=== --EXPECTF-- -*** Testing mcrypt_cbc() : basic functionality *** - --- testing different key lengths key length=8 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Key of size 8 not supported by this algorithm. Only keys of size 24 supported in %s on line %d +Warning: mcrypt_decrypt(): Key of size 8 not supported by this algorithm. Only keys of size 24 supported in %s on line %d string(0) "" key length=20 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Key of size 20 not supported by this algorithm. Only keys of size 24 supported in %s on line %d +Warning: mcrypt_decrypt(): Key of size 20 not supported by this algorithm. Only keys of size 24 supported in %s on line %d string(0) "" key length=24 - -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d string(32) "736563726574206d6573736167650000" key length=26 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Key of size 26 not supported by this algorithm. Only keys of size 24 supported in %s on line %d +Warning: mcrypt_decrypt(): Key of size 26 not supported by this algorithm. Only keys of size 24 supported in %s on line %d string(0) "" --- testing different iv lengths iv length=4 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Received initialization vector of size 4, but size 8 is required for this encryption mode in %s on line %d +Warning: mcrypt_decrypt(): Received initialization vector of size 4, but size 8 is required for this encryption mode in %s on line %d string(0) "" iv length=8 - -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d string(32) "659ec947f4dc3a3b9c50de744598d3c8" iv length=9 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Received initialization vector of size 9, but size 8 is required for this encryption mode in %s on line %d +Warning: mcrypt_decrypt(): Received initialization vector of size 9, but size 8 is required for this encryption mode in %s on line %d string(0) "" ===DONE=== diff --git a/ext/mcrypt/tests/mcrypt_cbc_3des_encrypt.phpt b/ext/mcrypt/tests/mcrypt_cbc_3des_encrypt.phpt index c5606e71a028b..ef662cc383d02 100644 --- a/ext/mcrypt/tests/mcrypt_cbc_3des_encrypt.phpt +++ b/ext/mcrypt/tests/mcrypt_cbc_3des_encrypt.phpt @@ -14,12 +14,8 @@ if (!extension_loaded("mcrypt")) { * Alias to functions: */ -echo "*** Testing mcrypt_cbc() : basic functionality ***\n"; - - $cipher = MCRYPT_TRIPLEDES; $data = b"This is the secret message which must be encrypted"; -$mode = MCRYPT_ENCRYPT; // tripledes uses keys with exactly 192 bits (24 bytes) $keys = array( @@ -38,66 +34,50 @@ $iv = b'12345678'; echo "\n--- testing different key lengths\n"; foreach ($keys as $key) { echo "\nkey length=".strlen($key)."\n"; - var_dump(bin2hex(mcrypt_cbc($cipher, $key, $data, $mode, $iv))); + var_dump(bin2hex(mcrypt_encrypt($cipher, $key, $data, MCRYPT_MODE_CBC, $iv))); } $key = b'123456789012345678901234'; echo "\n--- testing different iv lengths\n"; foreach ($ivs as $iv) { echo "\niv length=".strlen($iv)."\n"; - var_dump(bin2hex(mcrypt_cbc($cipher, $key, $data, $mode, $iv))); + var_dump(bin2hex(mcrypt_encrypt($cipher, $key, $data, MCRYPT_MODE_CBC, $iv))); } ?> ===DONE=== --EXPECTF-- -*** Testing mcrypt_cbc() : basic functionality *** - --- testing different key lengths key length=8 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Key of size 8 not supported by this algorithm. Only keys of size 24 supported in %s on line %d +Warning: mcrypt_encrypt(): Key of size 8 not supported by this algorithm. Only keys of size 24 supported in %s on line %d string(0) "" key length=20 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Key of size 20 not supported by this algorithm. Only keys of size 24 supported in %s on line %d +Warning: mcrypt_encrypt(): Key of size 20 not supported by this algorithm. Only keys of size 24 supported in %s on line %d string(0) "" key length=24 - -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d string(112) "b85e21072239d60c63a80e7c9ae493cb741a1cd407e52f451c5f43a0d103f55a7b62617eb2e44213c2d44462d388bc0b8f119384b12c84ac" key length=26 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Key of size 26 not supported by this algorithm. Only keys of size 24 supported in %s on line %d +Warning: mcrypt_encrypt(): Key of size 26 not supported by this algorithm. Only keys of size 24 supported in %s on line %d string(0) "" --- testing different iv lengths iv length=4 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Received initialization vector of size 4, but size 8 is required for this encryption mode in %s on line %d +Warning: mcrypt_encrypt(): Received initialization vector of size 4, but size 8 is required for this encryption mode in %s on line %d string(0) "" iv length=8 - -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d string(112) "b85e21072239d60c63a80e7c9ae493cb741a1cd407e52f451c5f43a0d103f55a7b62617eb2e44213c2d44462d388bc0b8f119384b12c84ac" iv length=9 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Received initialization vector of size 9, but size 8 is required for this encryption mode in %s on line %d +Warning: mcrypt_encrypt(): Received initialization vector of size 9, but size 8 is required for this encryption mode in %s on line %d string(0) "" ===DONE=== diff --git a/ext/mcrypt/tests/mcrypt_cbc_error.phpt b/ext/mcrypt/tests/mcrypt_cbc_error.phpt deleted file mode 100644 index 3c221802147e4..0000000000000 --- a/ext/mcrypt/tests/mcrypt_cbc_error.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Test mcrypt_cbc() function : error conditions ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing mcrypt_cbc() : error conditions *** - --- Testing mcrypt_cbc() function with more than expected no. of arguments -- - -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc() expects at most 5 parameters, 6 given in %s on line %d -NULL - --- Testing mcrypt_cbc() function with less than expected no. of arguments -- - -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc() expects at least 4 parameters, 3 given in %s on line %d -NULL -===DONE=== - diff --git a/ext/mcrypt/tests/mcrypt_cbc_variation1.phpt b/ext/mcrypt/tests/mcrypt_cbc_variation1.phpt deleted file mode 100644 index eb233e3f92e90..0000000000000 --- a/ext/mcrypt/tests/mcrypt_cbc_variation1.phpt +++ /dev/null @@ -1,256 +0,0 @@ ---TEST-- -Test mcrypt_cbc() function : usage variation ---SKIPIF-- - ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource variable - 'resource' => $fp -); - -// loop through each element of the array for cipher - -foreach($inputs as $valueType =>$value) { - echo "\n--$valueType--\n"; - var_dump( mcrypt_cbc($value, $key, $data, $mode, $iv) ); -}; - -fclose($fp); - -?> -===DONE=== ---EXPECTF-- -*** Testing mcrypt_cbc() : usage variation *** - ---int 0-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---int 1-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---int 12345-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---int -12345-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---float 10.5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---float -10.5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---float 12.3456789000e10-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---float -12.3456789000e10-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---float .5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---empty array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 1 to be string, array given, %s(%d) -NULL - ---int indexed array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 1 to be string, array given, %s(%d) -NULL - ---associative array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 1 to be string, array given, %s(%d) -NULL - ---nested arrays-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 1 to be string, array given, %s(%d) -NULL - ---uppercase NULL-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---lowercase null-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---lowercase true-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---lowercase false-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---uppercase TRUE-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---uppercase FALSE-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---empty string DQ-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---empty string SQ-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---instance of classWithToString-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---instance of classWithoutToString-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 1 to be string, object given, %s(%d) -NULL - ---undefined var-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---unset var-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d) -bool(false) - ---resource-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 1 to be string, resource given, %s(%d) -NULL -===DONE=== - diff --git a/ext/mcrypt/tests/mcrypt_cbc_variation2.phpt b/ext/mcrypt/tests/mcrypt_cbc_variation2.phpt deleted file mode 100644 index 8efbf82f740c9..0000000000000 --- a/ext/mcrypt/tests/mcrypt_cbc_variation2.phpt +++ /dev/null @@ -1,255 +0,0 @@ ---TEST-- -Test mcrypt_cbc() function : usage variation ---SKIPIF-- - ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource variable - 'resource' => $fp -); - -// loop through each element of the array for key - -foreach($inputs as $valueType =>$value) { - echo "\n--$valueType--\n"; - var_dump(bin2hex(mcrypt_cbc($cipher, $value, $data, $mode, $iv))); -}; - -fclose($fp); - -?> -===DONE=== ---EXPECTF-- -*** Testing mcrypt_cbc() : usage variation *** - ---int 0-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---int 1-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---int 12345-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---int -12345-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---float 10.5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---float -10.5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---float 12.3456789000e10-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---float -12.3456789000e10-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---float .5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---empty array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 2 to be string, array given, %s(%d) -string(0) "" - ---int indexed array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 2 to be string, array given, %s(%d) -string(0) "" - ---associative array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 2 to be string, array given, %s(%d) -string(0) "" - ---nested arrays-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 2 to be string, array given, %s(%d) -string(0) "" - ---uppercase NULL-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---lowercase null-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---lowercase true-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---lowercase false-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---uppercase TRUE-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---uppercase FALSE-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---empty string DQ-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---empty string SQ-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---instance of classWithToString-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---instance of classWithoutToString-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 2 to be string, object given, %s(%d) -string(0) "" - ---undefined var-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---unset var-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---resource-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 2 to be string, resource given, %s(%d) -string(0) "" -===DONE=== diff --git a/ext/mcrypt/tests/mcrypt_cbc_variation3.phpt b/ext/mcrypt/tests/mcrypt_cbc_variation3.phpt deleted file mode 100644 index f9098a4221b2b..0000000000000 --- a/ext/mcrypt/tests/mcrypt_cbc_variation3.phpt +++ /dev/null @@ -1,235 +0,0 @@ ---TEST-- -Test mcrypt_cbc() function : usage variation ---SKIPIF-- - ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource variable - 'resource' => $fp -); - -// loop through each element of the array for data - -foreach($inputs as $valueType =>$value) { - echo "\n--$valueType--\n"; - var_dump(bin2hex(mcrypt_cbc($cipher, $key, $value, $mode, $iv))); -}; - -fclose($fp); - -?> -===DONE=== ---EXPECTF-- -*** Testing mcrypt_cbc() : usage variation *** - ---int 0-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "ce5fcfe737859795" - ---int 1-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "84df495f6cd82dd9" - ---int 12345-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "905ab1ae27ee9991" - ---int -12345-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "5835174e9c67c3e7" - ---float 10.5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "28ff0601ad9e47fa" - ---float -10.5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "ce9f2b6e2fc3d9f7" - ---float 12.3456789000e10-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "24eb882ce9763e4018fba9b7f01b0c3e" - ---float -12.3456789000e10-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5eed30e428f32de1d7a7064d0ed4d3eb" - ---float .5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "bebf2a13676e1e30" - ---empty array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 3 to be string, array given, %s(%d) -string(0) "" - ---int indexed array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 3 to be string, array given, %s(%d) -string(0) "" - ---associative array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 3 to be string, array given, %s(%d) -string(0) "" - ---nested arrays-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 3 to be string, array given, %s(%d) -string(0) "" - ---uppercase NULL-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "206f6d3617a5ab32" - ---lowercase null-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "206f6d3617a5ab32" - ---lowercase true-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "84df495f6cd82dd9" - ---lowercase false-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "206f6d3617a5ab32" - ---uppercase TRUE-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "84df495f6cd82dd9" - ---uppercase FALSE-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "206f6d3617a5ab32" - ---empty string DQ-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "206f6d3617a5ab32" - ---empty string SQ-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "206f6d3617a5ab32" - ---instance of classWithToString-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "7c91cdf8f8c51485034a9ee528eb016b" - ---instance of classWithoutToString-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 3 to be string, object given, %s(%d) -string(0) "" - ---undefined var-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "206f6d3617a5ab32" - ---unset var-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(16) "206f6d3617a5ab32" - ---resource-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 3 to be string, resource given, %s(%d) -string(0) "" -===DONE=== diff --git a/ext/mcrypt/tests/mcrypt_cbc_variation4.phpt b/ext/mcrypt/tests/mcrypt_cbc_variation4.phpt deleted file mode 100644 index a13e4ffb7c3cf..0000000000000 --- a/ext/mcrypt/tests/mcrypt_cbc_variation4.phpt +++ /dev/null @@ -1,231 +0,0 @@ ---TEST-- -Test mcrypt_cbc() function : usage variation ---SKIPIF-- - ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource variable - 'resource' => $fp -); - -// loop through each element of the array for mode - -foreach($inputs as $valueType =>$value) { - echo "\n--$valueType--\n"; - var_dump(bin2hex(mcrypt_cbc($cipher, $key, $data, $value, $iv))); -}; - -fclose($fp); - -?> -===DONE=== ---EXPECTF-- -*** Testing mcrypt_cbc() : usage variation *** - ---float 10.5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "983d5edc5f77fe42e2372a0339dc22b0" - ---float -10.5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "983d5edc5f77fe42e2372a0339dc22b0" - ---float 12.3456789000e10-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "983d5edc5f77fe42e2372a0339dc22b0" - ---float -12.3456789000e10-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "983d5edc5f77fe42e2372a0339dc22b0" - ---float .5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---empty array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---int indexed array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "983d5edc5f77fe42e2372a0339dc22b0" - ---associative array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "983d5edc5f77fe42e2372a0339dc22b0" - ---nested arrays-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "983d5edc5f77fe42e2372a0339dc22b0" - ---uppercase NULL-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---lowercase null-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---lowercase true-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "983d5edc5f77fe42e2372a0339dc22b0" - ---lowercase false-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---uppercase TRUE-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "983d5edc5f77fe42e2372a0339dc22b0" - ---uppercase FALSE-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---empty string DQ-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---empty string SQ-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---string DQ-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---string SQ-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---mixed case string-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---heredoc-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---instance of classWithToString-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 8 - Object of class classWithToString could not be converted to int, %s(%d) -string(32) "983d5edc5f77fe42e2372a0339dc22b0" - ---instance of classWithoutToString-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 8 - Object of class classWithoutToString could not be converted to int, %s(%d) -string(32) "983d5edc5f77fe42e2372a0339dc22b0" - ---undefined var-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---unset var-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "5f781523f696d596e4b809d72197a0cc" - ---resource-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -string(32) "983d5edc5f77fe42e2372a0339dc22b0" -===DONE=== diff --git a/ext/mcrypt/tests/mcrypt_cbc_variation5.phpt b/ext/mcrypt/tests/mcrypt_cbc_variation5.phpt deleted file mode 100644 index 884d90963eced..0000000000000 --- a/ext/mcrypt/tests/mcrypt_cbc_variation5.phpt +++ /dev/null @@ -1,256 +0,0 @@ ---TEST-- -Test mcrypt_cbc() function : usage variation ---SKIPIF-- - ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource variable - 'resource' => $fp -); - -// loop through each element of the array for iv - -foreach($inputs as $valueType =>$value) { - echo "\n--$valueType--\n"; - var_dump( bin2hex(mcrypt_cbc($cipher, $key, $data, $mode, $value)) ); -}; - -fclose($fp); - -?> -===DONE=== ---EXPECTF-- -*** Testing mcrypt_cbc() : usage variation *** - ---int 0-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---int 1-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---int 12345-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---int -12345-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---float 10.5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---float -10.5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---float 12.3456789000e10-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---float -12.3456789000e10-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---float .5-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---empty array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 5 to be string, array given, %s(%d) -string(0) "" - ---int indexed array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 5 to be string, array given, %s(%d) -string(0) "" - ---associative array-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 5 to be string, array given, %s(%d) -string(0) "" - ---nested arrays-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 5 to be string, array given, %s(%d) -string(0) "" - ---uppercase NULL-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---lowercase null-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---lowercase true-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---lowercase false-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---uppercase TRUE-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---uppercase FALSE-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---empty string DQ-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---empty string SQ-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---instance of classWithToString-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---instance of classWithoutToString-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 5 to be string, object given, %s(%d) -string(0) "" - ---undefined var-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---unset var-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Received initialization vector of size %d, but size 8 is required for this encryption mode, %s(%d) -string(0) "" - ---resource-- -Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc() expects parameter 5 to be string, resource given, %s(%d) -string(0) "" -===DONE=== - diff --git a/ext/mcrypt/tests/mcrypt_cfb.phpt b/ext/mcrypt/tests/mcrypt_cfb.phpt index 5b6842310bbb5..ebbbea7c93a0e 100644 --- a/ext/mcrypt/tests/mcrypt_cfb.phpt +++ b/ext/mcrypt/tests/mcrypt_cfb.phpt @@ -9,22 +9,16 @@ $secret = "PHP Testfest 2008"; $cipher = MCRYPT_RIJNDAEL_128; $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_CFB), MCRYPT_RAND); -$enc_data = mcrypt_cfb($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv); +$enc_data = mcrypt_encrypt($cipher, $key, $secret, MCRYPT_MODE_CFB, $iv); // we have to trim as AES rounds the blocks and decrypt doesnt detect that -echo trim(mcrypt_cfb($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv)) . "\n"; +echo trim(mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_CFB, $iv)) . "\n"; // a warning must be issued if we don't use a IV on a AES cipher, that usually requires an IV -var_dump(mcrypt_cfb($cipher, $key, $enc_data, MCRYPT_DECRYPT)); +var_dump(mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_CFB)); --EXPECTF-- - -Deprecated: Function mcrypt_cfb() is deprecated in %s on line %d - -Deprecated: Function mcrypt_cfb() is deprecated in %s on line %d PHP Testfest 2008 -Deprecated: Function mcrypt_cfb() is deprecated in %s on line %d - -Warning: mcrypt_cfb(): Encryption mode requires an initialization vector of size 16 in %s on line %d +Warning: mcrypt_decrypt(): Encryption mode requires an initialization vector of size 16 in %s on line %d bool(false) diff --git a/ext/mcrypt/tests/mcrypt_ecb.phpt b/ext/mcrypt/tests/mcrypt_ecb.phpt index 7a4bc3aa6a858..33c86bb45d941 100644 --- a/ext/mcrypt/tests/mcrypt_ecb.phpt +++ b/ext/mcrypt/tests/mcrypt_ecb.phpt @@ -9,19 +9,13 @@ $secret = "PHP Testfest 2008"; $cipher = MCRYPT_RIJNDAEL_128; $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND); -$enc_data = mcrypt_ecb($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv); +$enc_data = mcrypt_encrypt($cipher, $key, $secret, MCRYPT_MODE_ECB, $iv); // we have to trim as AES rounds the blocks and decrypt doesnt detect that -echo trim(mcrypt_ecb($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv)) . "\n"; +echo trim(mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_ECB, $iv)) . "\n"; // a warning must be issued if we don't use a IV on a AES cipher, that usually requires an IV -mcrypt_ecb($cipher, $key, $enc_data, MCRYPT_DECRYPT); +mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_ECB); --EXPECTF-- - -Deprecated: Function mcrypt_ecb() is deprecated in %s on line %d - -Deprecated: Function mcrypt_ecb() is deprecated in %s on line %d PHP Testfest 2008 - -Deprecated: Function mcrypt_ecb() is deprecated in %s on line %d diff --git a/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt b/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt index ace9f829d89e9..6319fa15d0208 100644 --- a/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt +++ b/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt @@ -8,7 +8,7 @@ if (!extension_loaded("mcrypt")) { ?> --FILE-- ===DONE=== --EXPECTF-- -*** Testing mcrypt_ecb() : basic functionality *** - --- testing different key lengths key length=8 -Warning: mcrypt_ecb(): Key of size 8 not supported by this algorithm. Only keys of size 24 supported in %s on line %d +Warning: mcrypt_decrypt(): Key of size 8 not supported by this algorithm. Only keys of size 24 supported in %s on line %d string(0) "" key length=20 -Warning: mcrypt_ecb(): Key of size 20 not supported by this algorithm. Only keys of size 24 supported in %s on line %d +Warning: mcrypt_decrypt(): Key of size 20 not supported by this algorithm. Only keys of size 24 supported in %s on line %d string(0) "" key length=24 @@ -87,7 +81,7 @@ string(32) "736563726574206d6573736167650000" key length=26 -Warning: mcrypt_ecb(): Key of size 26 not supported by this algorithm. Only keys of size 24 supported in %s on line %d +Warning: mcrypt_decrypt(): Key of size 26 not supported by this algorithm. Only keys of size 24 supported in %s on line %d string(0) "" --- testing different iv lengths diff --git a/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt b/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt index 65ef3ad8e2c8e..0ccf4b70b39cb 100644 --- a/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt +++ b/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt @@ -8,7 +8,7 @@ if (!extension_loaded("mcrypt")) { ?> --FILE-- ===DONE=== --EXPECTF-- -*** Testing mcrypt_ecb() : basic functionality *** - --- testing different key lengths key length=8 -Warning: mcrypt_ecb(): Key of size 8 not supported by this algorithm. Only keys of size 24 supported in %s on line %d +Warning: mcrypt_encrypt(): Key of size 8 not supported by this algorithm. Only keys of size 24 supported in %s on line %d string(0) "" key length=20 -Warning: mcrypt_ecb(): Key of size 20 not supported by this algorithm. Only keys of size 24 supported in %s on line %d +Warning: mcrypt_encrypt(): Key of size 20 not supported by this algorithm. Only keys of size 24 supported in %s on line %d string(0) "" key length=24 @@ -72,7 +66,7 @@ string(112) "923eedcb20e18e3efa466a6ca1b842b34e6ac46aa3690ef739d0d68a26eb64e1a6a key length=26 -Warning: mcrypt_ecb(): Key of size 26 not supported by this algorithm. Only keys of size 24 supported in %s on line %d +Warning: mcrypt_encrypt(): Key of size 26 not supported by this algorithm. Only keys of size 24 supported in %s on line %d string(0) "" --- testing different iv lengths diff --git a/ext/mcrypt/tests/mcrypt_ecb_error.phpt b/ext/mcrypt/tests/mcrypt_ecb_error.phpt deleted file mode 100644 index 7e521f2225e6c..0000000000000 --- a/ext/mcrypt/tests/mcrypt_ecb_error.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -Test mcrypt_ecb() function : error conditions ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing mcrypt_ecb() : error conditions *** - --- Testing mcrypt_ecb() function with more than expected no. of arguments -- - -Warning: mcrypt_ecb() expects at most 5 parameters, 6 given in %s on line %d -NULL - --- Testing mcrypt_ecb() function with less than expected no. of arguments -- - -Warning: mcrypt_ecb() expects at least 4 parameters, 3 given in %s on line %d -NULL -===DONE=== - diff --git a/ext/mcrypt/tests/mcrypt_ecb_variation1.phpt b/ext/mcrypt/tests/mcrypt_ecb_variation1.phpt deleted file mode 100644 index 7271deec132ee..0000000000000 --- a/ext/mcrypt/tests/mcrypt_ecb_variation1.phpt +++ /dev/null @@ -1,232 +0,0 @@ ---TEST-- -Test mcrypt_ecb() function : usage variation ---SKIPIF-- - ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource variable - 'resource' => $fp -); - -// loop through each element of the array for cipher - -foreach($inputs as $valueType =>$value) { - echo "\n--$valueType--\n"; - var_dump( mcrypt_ecb($value, $key, $data, $mode, $iv) ); -}; - -fclose($fp); - -?> -===DONE=== ---EXPECTF-- -*** Testing mcrypt_ecb() : usage variation *** - ---int 0-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---int 1-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---int 12345-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---int -12345-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---float 10.5-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---float -10.5-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---float 12.3456789000e10-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---float -12.3456789000e10-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---float .5-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---empty array-- -Error: 2 - mcrypt_ecb() expects parameter 1 to be string, array given, %s(%d) -NULL - ---int indexed array-- -Error: 2 - mcrypt_ecb() expects parameter 1 to be string, array given, %s(%d) -NULL - ---associative array-- -Error: 2 - mcrypt_ecb() expects parameter 1 to be string, array given, %s(%d) -NULL - ---nested arrays-- -Error: 2 - mcrypt_ecb() expects parameter 1 to be string, array given, %s(%d) -NULL - ---uppercase NULL-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---lowercase null-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---lowercase true-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---lowercase false-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---uppercase TRUE-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---uppercase FALSE-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---empty string DQ-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---empty string SQ-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---instance of classWithToString-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---instance of classWithoutToString-- -Error: 2 - mcrypt_ecb() expects parameter 1 to be string, object given, %s(%d) -NULL - ---undefined var-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---unset var-- -Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d) -bool(false) - ---resource-- -Error: 2 - mcrypt_ecb() expects parameter 1 to be string, resource given, %s(%d) -NULL -===DONE=== - diff --git a/ext/mcrypt/tests/mcrypt_ecb_variation2.phpt b/ext/mcrypt/tests/mcrypt_ecb_variation2.phpt deleted file mode 100644 index 246533b722bda..0000000000000 --- a/ext/mcrypt/tests/mcrypt_ecb_variation2.phpt +++ /dev/null @@ -1,232 +0,0 @@ ---TEST-- -Test mcrypt_ecb() function : usage variation ---SKIPIF-- - ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource variable - 'resource' => $fp -); - -// loop through each element of the array for key - -foreach($inputs as $valueType =>$value) { - echo "\n--$valueType--\n"; - var_dump(bin2hex(mcrypt_ecb($cipher, $value, $data, $mode, $iv))); -}; - -fclose($fp); - -?> -===DONE=== ---EXPECTF-- -*** Testing mcrypt_ecb() : usage variation *** - ---int 0-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---int 1-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---int 12345-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---int -12345-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---float 10.5-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---float -10.5-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---float 12.3456789000e10-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---float -12.3456789000e10-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---float .5-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---empty array-- -Error: 2 - mcrypt_ecb() expects parameter 2 to be string, array given, %s(%d) -string(0) "" - ---int indexed array-- -Error: 2 - mcrypt_ecb() expects parameter 2 to be string, array given, %s(%d) -string(0) "" - ---associative array-- -Error: 2 - mcrypt_ecb() expects parameter 2 to be string, array given, %s(%d) -string(0) "" - ---nested arrays-- -Error: 2 - mcrypt_ecb() expects parameter 2 to be string, array given, %s(%d) -string(0) "" - ---uppercase NULL-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---lowercase null-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---lowercase true-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---lowercase false-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---uppercase TRUE-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---uppercase FALSE-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---empty string DQ-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---empty string SQ-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---instance of classWithToString-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---instance of classWithoutToString-- -Error: 2 - mcrypt_ecb() expects parameter 2 to be string, object given, %s(%d) -string(0) "" - ---undefined var-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---unset var-- -Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) -string(0) "" - ---resource-- -Error: 2 - mcrypt_ecb() expects parameter 2 to be string, resource given, %s(%d) -string(0) "" -===DONE=== - diff --git a/ext/mcrypt/tests/mcrypt_ecb_variation3.phpt b/ext/mcrypt/tests/mcrypt_ecb_variation3.phpt deleted file mode 100644 index 171468f82fb55..0000000000000 --- a/ext/mcrypt/tests/mcrypt_ecb_variation3.phpt +++ /dev/null @@ -1,212 +0,0 @@ ---TEST-- -Test mcrypt_ecb() function : usage variation ---SKIPIF-- - ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource variable - 'resource' => $fp -); - -// loop through each element of the array for data - -foreach($inputs as $valueType =>$value) { - echo "\n--$valueType--\n"; - var_dump(bin2hex(mcrypt_ecb($cipher, $key, $value, $mode, $iv))); -}; - -fclose($fp); - -?> -===DONE=== ---EXPECTF-- -*** Testing mcrypt_ecb() : usage variation *** - ---int 0-- -string(16) "51dc9cd9179b718b" - ---int 1-- -string(16) "619c335f8c4f9cbf" - ---int 12345-- -string(16) "b1258d67ab73de00" - ---int -12345-- -string(16) "8eecf134443bd6b9" - ---float 10.5-- -string(16) "34b5750a793baff5" - ---float -10.5-- -string(16) "7a605f2aacc8a11d" - ---float 12.3456789000e10-- -string(32) "74a0d7026ae586f476d4b17808851e86" - ---float -12.3456789000e10-- -string(32) "bfb155997017986c01090afebd62c7ca" - ---float .5-- -string(16) "cc60ac201164b6c7" - ---empty array-- -Error: 2 - mcrypt_ecb() expects parameter 3 to be string, array given, %s(%d) -string(0) "" - ---int indexed array-- -Error: 2 - mcrypt_ecb() expects parameter 3 to be string, array given, %s(%d) -string(0) "" - ---associative array-- -Error: 2 - mcrypt_ecb() expects parameter 3 to be string, array given, %s(%d) -string(0) "" - ---nested arrays-- -Error: 2 - mcrypt_ecb() expects parameter 3 to be string, array given, %s(%d) -string(0) "" - ---uppercase NULL-- -string(16) "6ece228c41457539" - ---lowercase null-- -string(16) "6ece228c41457539" - ---lowercase true-- -string(16) "619c335f8c4f9cbf" - ---lowercase false-- -string(16) "6ece228c41457539" - ---uppercase TRUE-- -string(16) "619c335f8c4f9cbf" - ---uppercase FALSE-- -string(16) "6ece228c41457539" - ---empty string DQ-- -string(16) "6ece228c41457539" - ---empty string SQ-- -string(16) "6ece228c41457539" - ---instance of classWithToString-- -string(32) "749c3b4d16731d98370128754b7c930f" - ---instance of classWithoutToString-- -Error: 2 - mcrypt_ecb() expects parameter 3 to be string, object given, %s(%d) -string(0) "" - ---undefined var-- -string(16) "6ece228c41457539" - ---unset var-- -string(16) "6ece228c41457539" - ---resource-- -Error: 2 - mcrypt_ecb() expects parameter 3 to be string, resource given, %s(%d) -string(0) "" -===DONE=== - diff --git a/ext/mcrypt/tests/mcrypt_ecb_variation4.phpt b/ext/mcrypt/tests/mcrypt_ecb_variation4.phpt deleted file mode 100644 index b5c4f294eb521..0000000000000 --- a/ext/mcrypt/tests/mcrypt_ecb_variation4.phpt +++ /dev/null @@ -1,207 +0,0 @@ ---TEST-- -Test mcrypt_ecb() function : usage variation ---SKIPIF-- - ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource variable - 'resource' => $fp -); - -// loop through each element of the array for mode - -foreach($inputs as $valueType =>$value) { - echo "\n--$valueType--\n"; - var_dump(bin2hex(mcrypt_ecb($cipher, $key, $data, $value, $iv))); -}; - -fclose($fp); - -?> -===DONE=== ---EXPECTF-- -*** Testing mcrypt_ecb() : usage variation *** - ---float 10.5-- -string(32) "a80c6cef6b42c8759143586a57bb7dc6" - ---float -10.5-- -string(32) "a80c6cef6b42c8759143586a57bb7dc6" - ---float 12.3456789000e10-- -string(32) "a80c6cef6b42c8759143586a57bb7dc6" - ---float -12.3456789000e10-- -string(32) "a80c6cef6b42c8759143586a57bb7dc6" - ---float .5-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---empty array-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---int indexed array-- -string(32) "a80c6cef6b42c8759143586a57bb7dc6" - ---associative array-- -string(32) "a80c6cef6b42c8759143586a57bb7dc6" - ---nested arrays-- -string(32) "a80c6cef6b42c8759143586a57bb7dc6" - ---uppercase NULL-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---lowercase null-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---lowercase true-- -string(32) "a80c6cef6b42c8759143586a57bb7dc6" - ---lowercase false-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---uppercase TRUE-- -string(32) "a80c6cef6b42c8759143586a57bb7dc6" - ---uppercase FALSE-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---empty string DQ-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---empty string SQ-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---string DQ-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---string SQ-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---mixed case string-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---heredoc-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---instance of classWithToString-- -Error: 8 - Object of class classWithToString could not be converted to int, %s(%d) -string(32) "a80c6cef6b42c8759143586a57bb7dc6" - ---instance of classWithoutToString-- -Error: 8 - Object of class classWithoutToString could not be converted to int, %s(%d) -string(32) "a80c6cef6b42c8759143586a57bb7dc6" - ---undefined var-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---unset var-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---resource-- -string(%d) %s -===DONE=== diff --git a/ext/mcrypt/tests/mcrypt_ecb_variation5.phpt b/ext/mcrypt/tests/mcrypt_ecb_variation5.phpt deleted file mode 100644 index 8771b9a78c714..0000000000000 --- a/ext/mcrypt/tests/mcrypt_ecb_variation5.phpt +++ /dev/null @@ -1,212 +0,0 @@ ---TEST-- -Test mcrypt_ecb() function : usage variation ---SKIPIF-- - ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource variable - 'resource' => $fp -); - -// loop through each element of the array for iv - -foreach($inputs as $valueType =>$value) { - echo "\n--$valueType--\n"; - var_dump(bin2hex( mcrypt_ecb($cipher, $key, $data, $mode, $value))); -}; - -fclose($fp); - -?> -===DONE=== ---EXPECTF-- -*** Testing mcrypt_ecb() : usage variation *** - ---int 0-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---int 1-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---int 12345-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---int -12345-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---float 10.5-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---float -10.5-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---float 12.3456789000e10-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---float -12.3456789000e10-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---float .5-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---empty array-- -Error: 2 - mcrypt_ecb() expects parameter 5 to be string, array given, %s(%d) -string(0) "" - ---int indexed array-- -Error: 2 - mcrypt_ecb() expects parameter 5 to be string, array given, %s(%d) -string(0) "" - ---associative array-- -Error: 2 - mcrypt_ecb() expects parameter 5 to be string, array given, %s(%d) -string(0) "" - ---nested arrays-- -Error: 2 - mcrypt_ecb() expects parameter 5 to be string, array given, %s(%d) -string(0) "" - ---uppercase NULL-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---lowercase null-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---lowercase true-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---lowercase false-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---uppercase TRUE-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---uppercase FALSE-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---empty string DQ-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---empty string SQ-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---instance of classWithToString-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---instance of classWithoutToString-- -Error: 2 - mcrypt_ecb() expects parameter 5 to be string, object given, %s(%d) -string(0) "" - ---undefined var-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---unset var-- -string(32) "6438db90653c4d300909aa02fd6163c2" - ---resource-- -Error: 2 - mcrypt_ecb() expects parameter 5 to be string, resource given, %s(%d) -string(0) "" -===DONE=== - diff --git a/ext/mcrypt/tests/mcrypt_ofb.phpt b/ext/mcrypt/tests/mcrypt_ofb.phpt index 5580575a4826c..5d87fcd855943 100644 --- a/ext/mcrypt/tests/mcrypt_ofb.phpt +++ b/ext/mcrypt/tests/mcrypt_ofb.phpt @@ -8,20 +8,16 @@ $key = "0123456789012345"; $secret = "PHP Testfest 2008"; $cipher = MCRYPT_RIJNDAEL_128; -$iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND); -$enc_data = mcrypt_ofb($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv); +$iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_OFB), MCRYPT_RAND); +$enc_data = mcrypt_decrypt($cipher, $key, $secret, MCRYPT_MODE_OFB, $iv); // we have to trim as AES rounds the blocks and decrypt doesnt detect that -echo trim(mcrypt_ofb($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv)) . "\n"; +echo trim(mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_OFB, $iv)) . "\n"; // a warning must be issued if we don't use a IV on a AES cipher, that usually requires an IV -mcrypt_ofb($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv); +mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_OFB); --EXPECTF-- - -Deprecated: Function mcrypt_ofb() is deprecated in %s on line %d - -Deprecated: Function mcrypt_ofb() is deprecated in %s on line %d PHP Testfest 2008 -Deprecated: Function mcrypt_ofb() is deprecated in %s on line %d +Warning: mcrypt_decrypt(): Encryption mode requires an initialization vector of size 16 in %s on line %d diff --git a/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt b/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt index 5f5a4bea56c1f..7889f67851f8f 100644 --- a/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt +++ b/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt @@ -53,16 +53,12 @@ foreach ($keys as $key) { echo "\nkey length=".strlen($key)."\n"; $res = mcrypt_encrypt($cipher, $key, $data, MCRYPT_MODE_CBC, $iv); var_dump(bin2hex($res)); - $res = mcrypt_cbc($cipher, $key, $res, MCRYPT_DECRYPT, $iv); - var_dump(bin2hex($res)); } $key = b'1234567890123456'; echo "\n--- testing different iv lengths\n"; foreach ($ivs as $iv) { echo "\niv length=".strlen($iv)."\n"; - $res = mcrypt_cbc($cipher, $key, $data, $mode, $iv); - var_dump(bin2hex($res)); $res = mcrypt_decrypt($cipher, $key, $res, MCRYPT_MODE_CBC, $iv); var_dump(bin2hex($res)); } @@ -79,82 +75,41 @@ key length=0 Warning: mcrypt_encrypt(): Key of size 0 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in %s on line %d string(0) "" -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Key of size 0 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in %s on line %d -string(0) "" - key length=0 Warning: mcrypt_encrypt(): Key of size 0 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in %s on line %d string(0) "" -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Key of size 0 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in %s on line %d -string(0) "" - key length=8 Warning: mcrypt_encrypt(): Key of size 8 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in %s on line %d string(0) "" -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Key of size 8 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in %s on line %d -string(0) "" - key length=16 string(128) "dc8f957ec530acf10cd95ba7da7b6405380fe19a2941e9a8de54680512f18491bc374e5464885ae6c2ae2aa7a6cdd2fbe12a06bbc4bd59dbbfaa15f09044f101" -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d -string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000" - --- testing different iv lengths iv length=0 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Received initialization vector of size 0, but size 16 is required for this encryption mode in %s on line %d -string(0) "" - Warning: mcrypt_decrypt(): Received initialization vector of size 0, but size 16 is required for this encryption mode in %s on line %d string(0) "" iv length=0 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Received initialization vector of size 0, but size 16 is required for this encryption mode in %s on line %d -string(0) "" - Warning: mcrypt_decrypt(): Received initialization vector of size 0, but size 16 is required for this encryption mode in %s on line %d string(0) "" iv length=8 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Received initialization vector of size 8, but size 16 is required for this encryption mode in %s on line %d -string(0) "" - Warning: mcrypt_decrypt(): Received initialization vector of size 8, but size 16 is required for this encryption mode in %s on line %d string(0) "" iv length=16 - -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d -string(128) "dc8f957ec530acf10cd95ba7da7b6405380fe19a2941e9a8de54680512f18491bc374e5464885ae6c2ae2aa7a6cdd2fbe12a06bbc4bd59dbbfaa15f09044f101" -string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000" +string(32) "42adc8c0db19473f2c684ff2d6e828a5" iv length=17 -Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d - -Warning: mcrypt_cbc(): Received initialization vector of size 17, but size 16 is required for this encryption mode in %s on line %d -string(0) "" - Warning: mcrypt_decrypt(): Received initialization vector of size 17, but size 16 is required for this encryption mode in %s on line %d string(0) "" ===DONE===