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;