diff options
author | Richard Levitte <levitte@openssl.org> | 2020-05-09 10:11:14 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-05-12 11:32:40 +0200 |
commit | fdaad3f1b31df6827554c378dd8385695a1deed4 (patch) | |
tree | b75f090aa64d03744896e9abd4d64240aec2cec8 /providers/defltprov.c | |
parent | b0f3c594083b22f082057719f7bb1aa575e7d5a1 (diff) | |
download | openssl-fdaad3f1b31df6827554c378dd8385695a1deed4.zip openssl-fdaad3f1b31df6827554c378dd8385695a1deed4.tar.gz openssl-fdaad3f1b31df6827554c378dd8385695a1deed4.tar.bz2 |
Fix some misunderstandings in our providers' main modules
This started with adding forward declarations of all provider side
interface functions, and fixing all compiler errors.
Furthermore, diminish the faulty assumption that the provider context
is and always will be just a library context. That means adding a
teardown function in all providers that aren't necessarily built into
libcrypto.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11777)
Diffstat (limited to 'providers/defltprov.c')
-rw-r--r-- | providers/defltprov.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/providers/defltprov.c b/providers/defltprov.c index f26654a..baea34a 100644 --- a/providers/defltprov.c +++ b/providers/defltprov.c @@ -15,11 +15,20 @@ #include <openssl/core_names.h> #include <openssl/params.h> #include "prov/bio.h" +#include "prov/provider_ctx.h" #include "prov/providercommon.h" #include "prov/implementations.h" #include "prov/provider_util.h" #include "internal/nelem.h" +/* + * Forward declarations to ensure that interface functions are correctly + * defined. + */ +static OSSL_provider_gettable_params_fn deflt_gettable_params; +static OSSL_provider_get_params_fn deflt_get_params; +static OSSL_provider_query_operation_fn deflt_query; + #define ALGC(NAMES, FUNC, CHECK) { { NAMES, "provider=default", FUNC }, CHECK } #define ALG(NAMES, FUNC) ALGC(NAMES, FUNC, NULL) @@ -35,12 +44,12 @@ static const OSSL_PARAM deflt_param_types[] = { OSSL_PARAM_END }; -static const OSSL_PARAM *deflt_gettable_params(const OSSL_PROVIDER *prov) +static const OSSL_PARAM *deflt_gettable_params(void *provctx) { return deflt_param_types; } -static int deflt_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[]) +static int deflt_get_params(void *provctx, OSSL_PARAM params[]) { OSSL_PARAM *p; @@ -500,8 +509,7 @@ static const OSSL_ALGORITHM deflt_serializer[] = { { NULL, NULL, NULL } }; -static const OSSL_ALGORITHM *deflt_query(OSSL_PROVIDER *prov, - int operation_id, +static const OSSL_ALGORITHM *deflt_query(void *provctx, int operation_id, int *no_cache) { *no_cache = 0; |