summaryrefslogtreecommitdiff
path: root/ext/openssl/openssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/openssl.c')
-rw-r--r--ext/openssl/openssl.c10
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) {