For AEAD ciphers, EVP_CIPHER_CTX_iv_length() does not return the ctx's actual IV length, but the cipher's default IV length:
For example, changing a GCM cipher's IV length from 12 to 4 fails the assertion:
int iv_size = 4;
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, iv_size, NULL)
assert(EVP_CIPHER_CTX_iv_length(ctx) == iv_size);
Is this a bug? Or should the documentation make this clear?