From: Nicola Tuveri Date: Fri, 2 Oct 2020 00:58:10 +0000 (+0300) Subject: Fix segfault on missing provider_query_operation() X-Git-Tag: openssl-3.0.0-alpha7~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=993c437dbd14579cbbd55a2742274f10fc7c6e21;p=thirdparty%2Fopenssl.git Fix segfault on missing provider_query_operation() A provider without `provider_query_operation()` is admittedly quite useless, yet technically the base provider functions are not mandatory according to our documentation. Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/13058) --- diff --git a/crypto/provider_core.c b/crypto/provider_core.c index 754f6df1a49..742d3e2b503 100644 --- a/crypto/provider_core.c +++ b/crypto/provider_core.c @@ -866,7 +866,8 @@ const OSSL_ALGORITHM *ossl_provider_query_operation(const OSSL_PROVIDER *prov, int operation_id, int *no_cache) { - return prov->query_operation(prov->provctx, operation_id, no_cache); + return prov->query_operation == NULL + ? NULL : prov->query_operation(prov->provctx, operation_id, no_cache); } int ossl_provider_set_operation_bit(OSSL_PROVIDER *provider, size_t bitnum)