/* Provenance: openssl/openssl evp_cipher_get_asn1_aead_params (fixed). * repo: openssl/openssl * commit: ce39170276daec87f55c39dad1f629b56344429e * parent: 3250efdfe99d2d7fe4fb05231add7fba864b7653 * commit_url: https://github.com/openssl/openssl/commit/ce39170276daec87f55c39dad1f629b56344429e * cve: CVE-2025-15467 * license: Apache-2.0 * function: evp_cipher_get_asn1_aead_params * relpath: crypto/evp/evp_lib.c */ int evp_cipher_get_asn1_aead_params(EVP_CIPHER_CTX *c, ASN1_TYPE *type, evp_cipher_aead_asn1_params *asn1_params) { int i = 0; long tl; unsigned char iv[EVP_MAX_IV_LENGTH]; if (type == NULL || asn1_params == NULL) return 0; i = ossl_asn1_type_get_octetstring_int(type, &tl, iv, EVP_MAX_IV_LENGTH); if (i <= 0 || i > EVP_MAX_IV_LENGTH) return -1; memcpy(asn1_params->iv, iv, i); asn1_params->iv_len = i; return i; }