]> granicus.if.org Git - php/commitdiff
Fix bug #73808 (iv length warning too restrictive for aes-128-ccm)
authorJakub Zelenka <bukka@php.net>
Sun, 30 Apr 2017 18:46:27 +0000 (19:46 +0100)
committerJakub Zelenka <bukka@php.net>
Sun, 30 Apr 2017 18:46:27 +0000 (19:46 +0100)
NEWS
ext/openssl/openssl.c
ext/openssl/tests/openssl_decrypt_ccm.phpt
ext/openssl/tests/openssl_decrypt_gcm.phpt
ext/openssl/tests/openssl_encrypt_ccm.phpt
ext/openssl/tests/openssl_encrypt_gcm.phpt

diff --git a/NEWS b/NEWS
index 17face6801d40cedae30b274f108d55cbaa4ad85..891c444494c50457aae5de98f58bdb6343c9f712 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -66,6 +66,8 @@ PHP                                                                        NEWS
     key). (Jakub Zelenka)
   . Fixed bug #74341 (openssl_x509_parse fails to parse ASN.1 UTCTime without
     seconds). (Moritz Fain)
+  . Fixed bug #73808 (iv length warning too restrictive for aes-128-ccm).
+    (Jakub Zelenka)
 
 - phar:
   . Fixed bug #74383 (phar method parameters reflection correction). 
index 43603a5fc5a1045f2610fd2e580177bd2b6a0153..766178b8f7700073a2ef00eb6231e93e02ad2f1e 100644 (file)
@@ -6214,9 +6214,7 @@ static int php_openssl_validate_iv(char **piv, size_t *piv_len, size_t iv_requir
 
        if (mode->is_aead) {
                if (EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_ivlen_flag, *piv_len, NULL) != 1) {
-                       php_error_docref(NULL, E_WARNING,
-                                       "Setting of IV length for AEAD mode failed, the expected length is %zd bytes",
-                                       iv_required_len);
+                       php_error_docref(NULL, E_WARNING, "Setting of IV length for AEAD mode failed");
                        return FAILURE;
                }
                return SUCCESS;
index 2107fea1fb14965deb0e096cca0c63c792b803af..beb307493863cf00258c8e341c9250795114f565 100644 (file)
@@ -35,7 +35,7 @@ var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
 TEST 0
 bool(true)
 
-Warning: openssl_decrypt(): Setting of IV length for AEAD mode failed, the expected length is 12 bytes in %s on line %d
+Warning: openssl_decrypt(): Setting of IV length for AEAD mode failed in %s on line %d
 bool(false)
 bool(false)
 bool(false)
index d8c464346aa13c6efb08170e03b8f90608d606b0..11802e9d8e94927bb540b5e0bb71199a9c20d14d 100644 (file)
@@ -45,7 +45,7 @@ bool(true)
 TEST 5
 bool(true)
 
-Warning: openssl_decrypt(): Setting of IV length for AEAD mode failed, the expected length is 12 bytes in %s on line %d
+Warning: openssl_decrypt(): Setting of IV length for AEAD mode failed in %s on line %d
 bool(false)
 bool(false)
 bool(false)
index 160604499746fe477947108e90a9f54c2abc6ea0..945e81dfd75ae97bf9cfd24c876f6b337d81aaf8 100644 (file)
@@ -33,7 +33,7 @@ TEST 0
 bool(true)
 bool(true)
 
-Warning: openssl_encrypt(): Setting of IV length for AEAD mode failed, the expected length is 12 bytes in %s on line %d
+Warning: openssl_encrypt(): Setting of IV length for AEAD mode failed in %s on line %d
 bool(false)
 string(8) "p/lvgA=="
 int(1024)
index 91fe23a637c63db0398e681a2dc252f5f503a017..60b48cd091661793907dd95b4e93fb276f46e83c 100644 (file)
@@ -50,7 +50,7 @@ TEST 5
 bool(true)
 bool(true)
 
-Warning: openssl_encrypt(): Setting of IV length for AEAD mode failed, the expected length is 12 bytes in %s on line %d
+Warning: openssl_encrypt(): Setting of IV length for AEAD mode failed in %s on line %d
 bool(false)
 
 Warning: openssl_encrypt(): Retrieving verification tag failed in %s on line %d