From: Nikita Popov Date: Mon, 19 Oct 2020 09:09:17 +0000 (+0200) Subject: Merge branch 'PHP-7.4' into PHP-8.0 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7727a0227669a966221572831a6eb9bdfc9d953a;p=php Merge branch 'PHP-7.4' into PHP-8.0 * PHP-7.4: Fix bug #79983: Add support for OCB mode --- 7727a0227669a966221572831a6eb9bdfc9d953a diff --cc ext/openssl/openssl.c index b6556c23b5,b18e5f8d99..f4f9dfc42a --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@@ -7003,9 -6618,10 +7023,10 @@@ static int php_openssl_cipher_init(cons php_error_docref(NULL, E_WARNING, "Setting tag length for AEAD cipher failed"); return FAILURE; } - } else if (!enc && tag && tag_len > 0) { + } + if (!enc && tag && tag_len > 0) { if (!mode->is_aead) { - php_error_docref(NULL, E_WARNING, "The tag cannot be used because the cipher method does not support AEAD"); + php_error_docref(NULL, E_WARNING, "The tag cannot be used because the cipher algorithm does not support AEAD"); } else if (!EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_set_tag_flag, tag_len, (unsigned char *) tag)) { php_error_docref(NULL, E_WARNING, "Setting tag for AEAD cipher decryption failed"); return FAILURE;