]> granicus.if.org Git - php/commitdiff
Print supported key sizes in error message
authorNikita Popov <nikic@php.net>
Sun, 2 Mar 2014 22:23:12 +0000 (23:23 +0100)
committerNikita Popov <nikic@php.net>
Wed, 5 Mar 2014 14:32:32 +0000 (15:32 +0100)
15 files changed:
ext/mcrypt/mcrypt.c
ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt
ext/mcrypt/tests/mcrypt_cbc_3des_encrypt.phpt
ext/mcrypt/tests/mcrypt_cbc_variation2.phpt
ext/mcrypt/tests/mcrypt_decrypt_3des_cbc.phpt
ext/mcrypt/tests/mcrypt_decrypt_3des_ecb.phpt
ext/mcrypt/tests/mcrypt_decrypt_variation2.phpt
ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt
ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt
ext/mcrypt/tests/mcrypt_ecb_variation2.phpt
ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt
ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt
ext/mcrypt/tests/mcrypt_encrypt_variation2.phpt
ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt
ext/mcrypt/tests/mcrypt_rijndael128_256BitKey.phpt

index 7ede8e6f6ffee4cef31548d5381b2df3d2ad53d8..a9f34d77f58357d61031dd000dcd142d533e0b08 100644 (file)
@@ -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;
        }
        
index 775c153643778aeb083726bf305f512961240c1c..c3559231be4742946534adefec5a1d3edb6a65bc 100644 (file)
@@ -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
index 2e8dd5fd50993ba86de165a5cfd59e0c57f4d081..978e263588b6b2f068109611d838bedca90a215f 100644 (file)
@@ -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
index 6a1624127b2b4c6e90d39a3a12031ac44573f014..8efbf82f740c9b9983d0b0006cf2ef2029a38b8e 100644 (file)
@@ -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--
index 0a366dc14aa9953ef9a7142a5cb89ce0d4a505ce..f0449080344566020433ba47861572397c2df056 100644 (file)
@@ -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
index a5a0e7279285d3308d4f3c9e16b9442eed7b7764..c54e6e50986a9a8b783ce3634e08b0aa46f7a3b2 100644 (file)
@@ -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
index ce907bf696a4f2b26649de9c8771a2c17faff8e6..985029c8ba89f78b386e944d746ae69b31cb25f3 100644 (file)
@@ -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--
index 29772e9a708c75cd2dbc33e44c916e093d858932..e718107b9be96709667655670ff6040c6a272862 100644 (file)
@@ -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
index 7a21df3d0bcc3aa6deeb973553d9604b4c47ddef..7e29579779301073fc47563489ba3666435c5374 100644 (file)
@@ -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
index ea3af842f5310942b5007e4a9160961a615957de..246533b722bda1c78ea3a9a11bfb077ac2dc2278 100644 (file)
@@ -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--
index 9c9f926167eac58f7a7af89a5b1a3a88073e5fa7..8f635a786915c586fcfb490ea6e3bc44d95c3fbe 100644 (file)
@@ -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
index 0531dcb27a44f567596d5af9d01e073a530d766a..941eb7935f57b008aa0583e88a048f5cca9418a6 100644 (file)
@@ -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
index 286fbea46330100dc2d1d37f5b63cca715529828..b1bf7f74bd42139a4df4da97129bca99b5988a5e 100644 (file)
@@ -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--
index ee1fceede515a814052bd1774d29c39596d32bbf..decbff2e3a8223dbf0031147e13cff6cdbc8c2d5 100644 (file)
@@ -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
index 7f6ad5ddf401cc97cba41212549cf3e0741e72c3..672e1ee1b7d55535f6fd865e81a2c96aa2a7f46d 100644 (file)
@@ -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===