com php-src: Fix bug #73808 (iv length warning too restrictive for aes-128-ccm): NEWS ext/openssl/openssl.c ext/openssl/tests/open ssl_decrypt_ccm.phpt ext/openssl/tests/openssl_decryp t_gcm.phpt ext/openssl/tests/openssl_encrypt_ccm.ph pt ext/openssl/tests/openssl_encrypt_gcm.phpt

[email protected] (Jakub Zelenka)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    6028fe511efd7e7f8444af9e53c4bbd7368233b1
Author:    Jakub Zelenka <[email protected]>         Sun, 30 Apr 2017 19:46:27 +0100
Parents:   9891b9ede225b58c358372c2b7b8603c2c91ac12
Branches:  PHP-7.1

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=6028fe511efd7e7f8444af9e53c4bbd7368233b1

Log:
Fix bug #73808 (iv length warning too restrictive for aes-128-ccm)

Bugs:
https://bugs.php.net/73808

Changed paths:
  M  NEWS
  M  ext/openssl/openssl.c
  M  ext/openssl/tests/openssl_decrypt_ccm.phpt
  M  ext/openssl/tests/openssl_decrypt_gcm.phpt
  M  ext/openssl/tests/openssl_encrypt_ccm.phpt
  M  ext/openssl/tests/openssl_encrypt_gcm.phpt


Diff:
diff --git a/NEWS b/NEWS
index 17face6..891c444 100644
--- 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). 
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 43603a5..766178b 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -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;
diff --git a/ext/openssl/tests/openssl_decrypt_ccm.phpt b/ext/openssl/tests/openssl_decrypt_ccm.phpt
index 2107fea..beb3074 100644
--- a/ext/openssl/tests/openssl_decrypt_ccm.phpt
+++ b/ext/openssl/tests/openssl_decrypt_ccm.phpt
@@ -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)
diff --git a/ext/openssl/tests/openssl_decrypt_gcm.phpt b/ext/openssl/tests/openssl_decrypt_gcm.phpt
index d8c4643..11802e9 100644
--- a/ext/openssl/tests/openssl_decrypt_gcm.phpt
+++ b/ext/openssl/tests/openssl_decrypt_gcm.phpt
@@ -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)
diff --git a/ext/openssl/tests/openssl_encrypt_ccm.phpt b/ext/openssl/tests/openssl_encrypt_ccm.phpt
index 1606044..945e81d 100644
--- a/ext/openssl/tests/openssl_encrypt_ccm.phpt
+++ b/ext/openssl/tests/openssl_encrypt_ccm.phpt
@@ -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)
diff --git a/ext/openssl/tests/openssl_encrypt_gcm.phpt b/ext/openssl/tests/openssl_encrypt_gcm.phpt
index 91fe23a..60b48cd 100644
--- a/ext/openssl/tests/openssl_encrypt_gcm.phpt
+++ b/ext/openssl/tests/openssl_encrypt_gcm.phpt
@@ -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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.