return OSSL_RECORD_RETURN_FATAL;
}
- if (EVP_CIPHER_get0_provider(ciph) != NULL
+ /*
+ * The cipher we actually ended up using in the EVP_CIPHER_CTX may be
+ * different to that in ciph if we have an ENGINE in use
+ */
+ if (EVP_CIPHER_get0_provider(EVP_CIPHER_CTX_get0_cipher(ciph_ctx)) != NULL
&& !ossl_set_tls_provider_parameters(rl, ciph_ctx, ciph, md)) {
/* ERR_raise already called */
return OSSL_RECORD_RETURN_FATAL;
ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
return OSSL_RECORD_RETURN_FATAL;
}
- if (EVP_CIPHER_get0_provider(ciph) != NULL
- && !ossl_set_tls_provider_parameters(rl, ciph_ctx, ciph, md))
+
+ /*
+ * The cipher we actually ended up using in the EVP_CIPHER_CTX may be
+ * different to that in ciph if we have an ENGINE in use
+ */
+ if (EVP_CIPHER_get0_provider(EVP_CIPHER_CTX_get0_cipher(ciph_ctx)) != NULL
+ && !ossl_set_tls_provider_parameters(rl, ciph_ctx, ciph, md)) {
+ /* ERR_raise already called */
return OSSL_RECORD_RETURN_FATAL;
+ }
/* Calculate the explicit IV length */
if (RLAYER_USE_EXPLICIT_IV(rl)) {