int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx)
{
- return EVP_CIPHER_iv_length(ctx->cipher);
+ int ok, v = EVP_CIPHER_iv_length(ctx->cipher);
+ OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+
+ params[0] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_IVLEN, &v);
+ ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->provctx, params);
+
+ return ok != 0 ? v : -1;
}
const unsigned char *EVP_CIPHER_CTX_original_iv(const EVP_CIPHER_CTX *ctx)