diff options
| author | Stanislav Malyshev <stas@php.net> | 2020-09-28 21:42:19 -0700 |
|---|---|---|
| committer | Derick Rethans <github@derickrethans.nl> | 2020-09-29 10:59:18 +0100 |
| commit | d99c01953528dac2b16b6831e08055cd28ef8c21 (patch) | |
| tree | 1c68d03aa3cd892418b6a8012530ee0b80275be2 /ext/openssl/openssl.c | |
| parent | e88dcdcdc86852bb5688afec05821a799bd3ad0d (diff) | |
| download | php-git-d99c01953528dac2b16b6831e08055cd28ef8c21.tar.gz | |
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Update UPGRADING
Update NEWS & UPGRADING
Do not decode cookie names anymore
Fix bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12 bytes IV)
Diffstat (limited to 'ext/openssl/openssl.c')
| -rw-r--r-- | ext/openssl/openssl.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 8a45a6cfa2..84a74bd1ca 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -6521,11 +6521,6 @@ static int php_openssl_validate_iv(char **piv, size_t *piv_len, size_t iv_requir { char *iv_new; - /* Best case scenario, user behaved */ - if (*piv_len == iv_required_len) { - return SUCCESS; - } - 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"); @@ -6534,6 +6529,11 @@ static int php_openssl_validate_iv(char **piv, size_t *piv_len, size_t iv_requir return SUCCESS; } + /* Best case scenario, user behaved */ + if (*piv_len == iv_required_len) { + return SUCCESS; + } + iv_new = ecalloc(1, iv_required_len + 1); if (*piv_len == 0) { |
