diff options
-rw-r--r-- | ext/mcrypt/mcrypt.c | 88 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt | 6 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_cbc_3des_encrypt.phpt | 6 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_cbc_variation2.phpt | 40 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_decrypt_3des_cbc.phpt | 6 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_decrypt_3des_ecb.phpt | 6 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_decrypt_variation2.phpt | 40 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt | 6 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt | 6 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_ecb_variation2.phpt | 40 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt | 6 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt | 6 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_encrypt_variation2.phpt | 40 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt | 12 | ||||
-rw-r--r-- | ext/mcrypt/tests/mcrypt_rijndael128_256BitKey.phpt | 12 |
15 files changed, 186 insertions, 134 deletions
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 7ede8e6f6f..a9f34d77f5 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -40,6 +40,7 @@ #include "php_globals.h" #include "ext/standard/info.h" #include "ext/standard/php_rand.h" +#include "ext/standard/php_smart_str.h" #include "php_mcrypt_filter.h" static int le_mcrypt; @@ -1165,35 +1166,87 @@ PHP_FUNCTION(mcrypt_get_cipher_name) } /* }}} */ -static zend_bool php_mcrypt_is_valid_key_size(MCRYPT td, int key_len) /* {{{ */ +static char *php_mcrypt_get_key_size_str( + int max_key_size, const int *key_sizes, int key_size_count) /* {{{ */ { - if (key_len <= 0) { - return 0; + if (key_size_count == 0) { + char *str; + spprintf(&str, 0, "Only keys of size 1 to %d supported", max_key_size); + return str; + } else if (key_size_count == 1) { + char *str; + spprintf(&str, 0, "Only keys of size %d supported", key_sizes[0]); + return str; + } else { + int i; + smart_str str = {0}; + smart_str_appends(&str, "Only keys of sizes "); + + for (i = 0; i < key_size_count; ++i) { + if (i == key_size_count - 1) { + smart_str_appends(&str, " or "); + } else if (i != 0) { + smart_str_appends(&str, ", "); + } + + smart_str_append_long(&str, key_sizes[i]); + } + + smart_str_appends(&str, " supported"); + smart_str_0(&str); + return str.c; } +} +/* }}} */ - if (key_len > mcrypt_enc_get_key_size(td)) { +static zend_bool php_mcrypt_is_valid_key_size( + int key_size, int max_key_size, int *key_sizes, int key_size_count) /* {{{ */ +{ + int i; + + if (key_size <= 0 || key_size > max_key_size) { return 0; } - { - int count, i; - int *key_sizes = mcrypt_enc_get_supported_key_sizes(td, &count); + if (key_size_count == 0) { + /* All key sizes are valid */ + return 1; + } - if (!key_sizes) { - /* All key sizes are valid */ + for (i = 0; i < key_size_count; i++) { + if (key_sizes[i] == key_size) { return 1; } + } - for (i = 0; i < count; i++) { - if (key_sizes[i] == key_len) { - mcrypt_free(key_sizes); - return 1; - } - } + return 0; +} +/* }}} */ + +static int php_mcrypt_ensure_valid_key_size(MCRYPT td, int key_size TSRMLS_DC) /* {{{ */ +{ + int key_size_count; + int max_key_size = mcrypt_enc_get_key_size(td); + int *key_sizes = mcrypt_enc_get_supported_key_sizes(td, &key_size_count); + + zend_bool is_valid_key_size = php_mcrypt_is_valid_key_size( + key_size, max_key_size, key_sizes, key_size_count + ); + if (!is_valid_key_size) { + char *key_size_str = php_mcrypt_get_key_size_str( + max_key_size, key_sizes, key_size_count + ); + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "Key of size %d not supported by this algorithm. %s", key_size, key_size_str + ); + efree(key_size_str); + } + if (key_sizes) { mcrypt_free(key_sizes); - return 0; } + + return is_valid_key_size ? SUCCESS : FAILURE; } /* }}} */ @@ -1214,8 +1267,7 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, int key_len, cons } /* Checking for key-length */ - if (!php_mcrypt_is_valid_key_size(td, key_len)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key of length %d not supported by this algorithm", key_len); + if (php_mcrypt_ensure_valid_key_size(td, key_len TSRMLS_CC) == FAILURE) { RETURN_FALSE; } diff --git a/ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt b/ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt index 775c153643..c3559231be 100644 --- a/ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt +++ b/ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt @@ -75,14 +75,14 @@ key length=8 Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d -Warning: mcrypt_cbc(): Key of length 8 not supported by this algorithm 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 string(0) "" key length=20 Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d -Warning: mcrypt_cbc(): Key of length 20 not supported by this algorithm 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 string(0) "" key length=24 @@ -94,7 +94,7 @@ key length=26 Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d -Warning: mcrypt_cbc(): Key of length 26 not supported by this algorithm 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 string(0) "" --- testing different iv lengths diff --git a/ext/mcrypt/tests/mcrypt_cbc_3des_encrypt.phpt b/ext/mcrypt/tests/mcrypt_cbc_3des_encrypt.phpt index 2e8dd5fd50..978e263588 100644 --- a/ext/mcrypt/tests/mcrypt_cbc_3des_encrypt.phpt +++ b/ext/mcrypt/tests/mcrypt_cbc_3des_encrypt.phpt @@ -58,14 +58,14 @@ key length=8 Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d -Warning: mcrypt_cbc(): Key of length 8 not supported by this algorithm 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 string(0) "" key length=20 Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d -Warning: mcrypt_cbc(): Key of length 20 not supported by this algorithm 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 string(0) "" key length=24 @@ -77,7 +77,7 @@ key length=26 Deprecated: Function mcrypt_cbc() is deprecated in %s on line %d -Warning: mcrypt_cbc(): Key of length 26 not supported by this algorithm 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 string(0) "" --- testing different iv lengths diff --git a/ext/mcrypt/tests/mcrypt_cbc_variation2.phpt b/ext/mcrypt/tests/mcrypt_cbc_variation2.phpt index 6a1624127b..8efbf82f74 100644 --- a/ext/mcrypt/tests/mcrypt_cbc_variation2.phpt +++ b/ext/mcrypt/tests/mcrypt_cbc_variation2.phpt @@ -125,47 +125,47 @@ fclose($fp); --int 0-- Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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-- @@ -190,47 +190,47 @@ string(0) "" --uppercase NULL-- Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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-- @@ -240,12 +240,12 @@ string(0) "" --undefined var-- Error: 8192 - Function mcrypt_cbc() is deprecated, %s(%d) -Error: 2 - mcrypt_cbc(): Key of length %d not supported by this algorithm, %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 length %d not supported by this algorithm, %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-- diff --git a/ext/mcrypt/tests/mcrypt_decrypt_3des_cbc.phpt b/ext/mcrypt/tests/mcrypt_decrypt_3des_cbc.phpt index 0a366dc14a..f044908034 100644 --- a/ext/mcrypt/tests/mcrypt_decrypt_3des_cbc.phpt +++ b/ext/mcrypt/tests/mcrypt_decrypt_3des_cbc.phpt @@ -72,12 +72,12 @@ function special_var_dump($str) { key length=8 -Warning: mcrypt_decrypt(): Key of length 8 not supported by this algorithm 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_decrypt(): Key of length 20 not supported by this algorithm 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 @@ -85,7 +85,7 @@ string(32) "736563726574206d6573736167650000" key length=26 -Warning: mcrypt_decrypt(): Key of length 26 not supported by this algorithm 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_decrypt_3des_ecb.phpt b/ext/mcrypt/tests/mcrypt_decrypt_3des_ecb.phpt index a5a0e72792..c54e6e5098 100644 --- a/ext/mcrypt/tests/mcrypt_decrypt_3des_ecb.phpt +++ b/ext/mcrypt/tests/mcrypt_decrypt_3des_ecb.phpt @@ -71,12 +71,12 @@ function special_var_dump($str) { key length=8 -Warning: mcrypt_decrypt(): Key of length 8 not supported by this algorithm 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_decrypt(): Key of length 20 not supported by this algorithm 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 @@ -84,7 +84,7 @@ string(32) "736563726574206d6573736167650000" key length=26 -Warning: mcrypt_decrypt(): Key of length 26 not supported by this algorithm 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_decrypt_variation2.phpt b/ext/mcrypt/tests/mcrypt_decrypt_variation2.phpt index ce907bf696..985029c8ba 100644 --- a/ext/mcrypt/tests/mcrypt_decrypt_variation2.phpt +++ b/ext/mcrypt/tests/mcrypt_decrypt_variation2.phpt @@ -124,39 +124,39 @@ fclose($fp); *** Testing mcrypt_decrypt() : usage variation *** --int 0-- -Error: 2 - mcrypt_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --int 1-- -Error: 2 - mcrypt_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --int 12345-- -Error: 2 - mcrypt_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --int -12345-- -Error: 2 - mcrypt_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): 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_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): 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_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): 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_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): 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_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --float .5-- -Error: 2 - mcrypt_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --empty array-- @@ -176,39 +176,39 @@ Error: 2 - mcrypt_decrypt() expects parameter 2 to be string, array given, %s(%d string(0) "" --uppercase NULL-- -Error: 2 - mcrypt_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --lowercase null-- -Error: 2 - mcrypt_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --lowercase true-- -Error: 2 - mcrypt_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --lowercase false-- -Error: 2 - mcrypt_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --uppercase TRUE-- -Error: 2 - mcrypt_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --uppercase FALSE-- -Error: 2 - mcrypt_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): 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_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): 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_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): 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_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --instance of classWithoutToString-- @@ -216,11 +216,11 @@ Error: 2 - mcrypt_decrypt() expects parameter 2 to be string, object given, %s(% string(0) "" --undefined var-- -Error: 2 - mcrypt_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --unset var-- -Error: 2 - mcrypt_decrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_decrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --resource-- diff --git a/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt b/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt index 29772e9a70..e718107b9b 100644 --- a/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt +++ b/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt @@ -74,12 +74,12 @@ function special_var_dump($str) { key length=8 -Warning: mcrypt_ecb(): Key of length 8 not supported by this algorithm in %s on line %d +Warning: mcrypt_ecb(): 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 length 20 not supported by this algorithm in %s on line %d +Warning: mcrypt_ecb(): 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 +87,7 @@ string(32) "736563726574206d6573736167650000" key length=26 -Warning: mcrypt_ecb(): Key of length 26 not supported by this algorithm in %s on line %d +Warning: mcrypt_ecb(): 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 7a21df3d0b..7e29579779 100644 --- a/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt +++ b/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt @@ -59,12 +59,12 @@ foreach ($ivs as $iv) { key length=8 -Warning: mcrypt_ecb(): Key of length 8 not supported by this algorithm in %s on line %d +Warning: mcrypt_ecb(): 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 length 20 not supported by this algorithm in %s on line %d +Warning: mcrypt_ecb(): 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 +72,7 @@ string(112) "923eedcb20e18e3efa466a6ca1b842b34e6ac46aa3690ef739d0d68a26eb64e1a6a key length=26 -Warning: mcrypt_ecb(): Key of length 26 not supported by this algorithm in %s on line %d +Warning: mcrypt_ecb(): 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_variation2.phpt b/ext/mcrypt/tests/mcrypt_ecb_variation2.phpt index ea3af842f5..246533b722 100644 --- a/ext/mcrypt/tests/mcrypt_ecb_variation2.phpt +++ b/ext/mcrypt/tests/mcrypt_ecb_variation2.phpt @@ -126,39 +126,39 @@ fclose($fp); *** Testing mcrypt_ecb() : usage variation *** --int 0-- -Error: 2 - mcrypt_ecb(): Key of length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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-- @@ -178,39 +178,39 @@ Error: 2 - mcrypt_ecb() expects parameter 2 to be string, array given, %s(%d) string(0) "" --uppercase NULL-- -Error: 2 - mcrypt_ecb(): Key of length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +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-- @@ -218,11 +218,11 @@ Error: 2 - mcrypt_ecb() expects parameter 2 to be string, object given, %s(%d) string(0) "" --undefined var-- -Error: 2 - mcrypt_ecb(): Key of length %d not supported by this algorithm, %s(%d) +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 length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_ecb(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --resource-- diff --git a/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt b/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt index 9c9f926167..8f635a7869 100644 --- a/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt +++ b/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt @@ -65,12 +65,12 @@ foreach ($ivs as $iv) { key length=8 -Warning: mcrypt_encrypt(): Key of length 8 not supported by this algorithm 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_encrypt(): Key of length 20 not supported by this algorithm 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 @@ -78,7 +78,7 @@ string(112) "b85e21072239d60c63a80e7c9ae493cb741a1cd407e52f451c5f43a0d103f55a7b6 key length=26 -Warning: mcrypt_encrypt(): Key of length 26 not supported by this algorithm 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_encrypt_3des_ecb.phpt b/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt index 0531dcb27a..941eb7935f 100644 --- a/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt +++ b/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt @@ -57,12 +57,12 @@ foreach ($ivs as $iv) { key length=8 -Warning: mcrypt_encrypt(): Key of length 8 not supported by this algorithm 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_encrypt(): Key of length 20 not supported by this algorithm 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 @@ -70,7 +70,7 @@ string(112) "923eedcb20e18e3efa466a6ca1b842b34e6ac46aa3690ef739d0d68a26eb64e1a6a key length=26 -Warning: mcrypt_encrypt(): Key of length 26 not supported by this algorithm 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_encrypt_variation2.phpt b/ext/mcrypt/tests/mcrypt_encrypt_variation2.phpt index 286fbea463..b1bf7f74bd 100644 --- a/ext/mcrypt/tests/mcrypt_encrypt_variation2.phpt +++ b/ext/mcrypt/tests/mcrypt_encrypt_variation2.phpt @@ -124,39 +124,39 @@ fclose($fp); *** Testing mcrypt_encrypt() : usage variation *** --int 0-- -Error: 2 - mcrypt_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --int 1-- -Error: 2 - mcrypt_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --int 12345-- -Error: 2 - mcrypt_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --int -12345-- -Error: 2 - mcrypt_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): 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_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): 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_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): 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_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): 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_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --float .5-- -Error: 2 - mcrypt_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --empty array-- @@ -176,39 +176,39 @@ Error: 2 - mcrypt_encrypt() expects parameter 2 to be string, array given, %s(%d string(0) "" --uppercase NULL-- -Error: 2 - mcrypt_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --lowercase null-- -Error: 2 - mcrypt_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --lowercase true-- -Error: 2 - mcrypt_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --lowercase false-- -Error: 2 - mcrypt_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --uppercase TRUE-- -Error: 2 - mcrypt_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --uppercase FALSE-- -Error: 2 - mcrypt_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): 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_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): 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_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): 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_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --instance of classWithoutToString-- @@ -216,11 +216,11 @@ Error: 2 - mcrypt_encrypt() expects parameter 2 to be string, object given, %s(% string(0) "" --undefined var-- -Error: 2 - mcrypt_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --unset var-- -Error: 2 - mcrypt_encrypt(): Key of length %d not supported by this algorithm, %s(%d) +Error: 2 - mcrypt_encrypt(): Key of size %d not supported by this algorithm. Only keys of size 24 supported, %s(%d) string(0) "" --resource-- diff --git a/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt b/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt index ee1fceede5..decbff2e3a 100644 --- a/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt +++ b/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt @@ -76,32 +76,32 @@ foreach ($ivs as $iv) { key length=0 -Warning: mcrypt_encrypt(): Key of length 0 not supported by this algorithm in %s on line %d +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 length 0 not supported by this algorithm 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 length 0 not supported by this algorithm in %s on line %d +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 length 0 not supported by this algorithm 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 length 8 not supported by this algorithm in %s on line %d +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 length 8 not supported by this algorithm 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 diff --git a/ext/mcrypt/tests/mcrypt_rijndael128_256BitKey.phpt b/ext/mcrypt/tests/mcrypt_rijndael128_256BitKey.phpt index 7f6ad5ddf4..672e1ee1b7 100644 --- a/ext/mcrypt/tests/mcrypt_rijndael128_256BitKey.phpt +++ b/ext/mcrypt/tests/mcrypt_rijndael128_256BitKey.phpt @@ -63,10 +63,10 @@ foreach ($keys as $key) { key length=20 -Warning: mcrypt_encrypt(): Key of length 20 not supported by this algorithm in %s on line %d +Warning: mcrypt_encrypt(): Key of size 20 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in %s on line %d string(0) "" -Warning: mcrypt_decrypt(): Key of length 20 not supported by this algorithm in %s on line %d +Warning: mcrypt_decrypt(): Key of size 20 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in %s on line %d string(0) "" key length=24 @@ -75,10 +75,10 @@ string(128) "546869732069732074686520736563726574206d657373616765207768696368206 key length=30 -Warning: mcrypt_encrypt(): Key of length 30 not supported by this algorithm in %s on line %d +Warning: mcrypt_encrypt(): Key of size 30 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in %s on line %d string(0) "" -Warning: mcrypt_decrypt(): Key of length 30 not supported by this algorithm in %s on line %d +Warning: mcrypt_decrypt(): Key of size 30 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in %s on line %d string(0) "" key length=32 @@ -87,9 +87,9 @@ string(128) "546869732069732074686520736563726574206d657373616765207768696368206 key length=40 -Warning: mcrypt_encrypt(): Key of length 40 not supported by this algorithm in %s on line %d +Warning: mcrypt_encrypt(): Key of size 40 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in %s on line %d string(0) "" -Warning: mcrypt_decrypt(): Key of length 40 not supported by this algorithm in %s on line %d +Warning: mcrypt_decrypt(): Key of size 40 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in %s on line %d string(0) "" ===DONE=== |