]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4' into PHP-8.0
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 19 Oct 2020 09:09:17 +0000 (11:09 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 19 Oct 2020 09:09:17 +0000 (11:09 +0200)
* PHP-7.4:
  Fix bug #79983: Add support for OCB mode

1  2 
ext/openssl/openssl.c

index b6556c23b53c3332424f68092f1597bcf21d2232,b18e5f8d99c495c393ccef24273882ece76698e0..f4f9dfc42aba9e813695723b3ab62c45863af2a7
@@@ -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;