From: Jakub Zelenka Date: Sun, 30 Apr 2017 18:46:27 +0000 (+0100) Subject: Fix bug #73808 (iv length warning too restrictive for aes-128-ccm) X-Git-Tag: php-7.1.6RC1~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6028fe511efd7e7f8444af9e53c4bbd7368233b1;p=php Fix bug #73808 (iv length warning too restrictive for aes-128-ccm) --- diff --git a/NEWS b/NEWS index 17face6801..891c444494 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 43603a5fc5..766178b8f7 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 2107fea1fb..beb3074938 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 d8c464346a..11802e9d8e 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 1606044997..945e81dfd7 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 91fe23a637..60b48cd091 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