size_t v = len;
OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
- params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN, &v);
- rv = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
- if (rv != EVP_CTRL_RET_UNSUPPORTED) {
- if (rv <= 0)
+ if (ctx->cipher->get_ctx_params != NULL) {
+ params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN,
+ &v);
+ rv = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
+ if (rv > 0) {
+ if (OSSL_PARAM_modified(params)
+ && !OSSL_PARAM_get_int(params, &len))
+ return -1;
+ } else if (rv != EVP_CTRL_RET_UNSUPPORTED) {
return -1;
- len = (int)v;
+ }
}
/* Code below to be removed when legacy support is dropped. */
else if ((EVP_CIPHER_get_flags(ctx->cipher)