diff options
author | Pauli <paul.dale@oracle.com> | 2020-09-07 11:58:03 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2020-09-12 16:46:20 +1000 |
commit | eab7b4240dc87e27d8b12b5af23d3cf20dd06f55 (patch) | |
tree | 6cf21b1522dd15ab0b961d5c4a0250d2bc354b09 /providers/legacyprov.c | |
parent | 5e8cd0a4f48f06df2542e7c74dcbb4310bce7c4c (diff) |
provider: add an 'is_running' call to all providers.
It can be accessed (read only) via the status parameter.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12801)
Diffstat (limited to 'providers/legacyprov.c')
-rw-r--r-- | providers/legacyprov.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/providers/legacyprov.c b/providers/legacyprov.c index 549906a68a..50c4479b38 100644 --- a/providers/legacyprov.c +++ b/providers/legacyprov.c @@ -15,6 +15,7 @@ #include <openssl/params.h> #include "prov/provider_ctx.h" #include "prov/implementations.h" +#include "prov/providercommon.h" /* * Forward declarations to ensure that interface functions are correctly @@ -40,6 +41,7 @@ static const OSSL_PARAM legacy_param_types[] = { OSSL_PARAM_DEFN(OSSL_PROV_PARAM_NAME, OSSL_PARAM_UTF8_PTR, NULL, 0), OSSL_PARAM_DEFN(OSSL_PROV_PARAM_VERSION, OSSL_PARAM_UTF8_PTR, NULL, 0), OSSL_PARAM_DEFN(OSSL_PROV_PARAM_BUILDINFO, OSSL_PARAM_UTF8_PTR, NULL, 0), + OSSL_PARAM_DEFN(OSSL_PROV_PARAM_STATUS, OSSL_PARAM_INTEGER, NULL, 0), OSSL_PARAM_END }; @@ -62,7 +64,7 @@ static int legacy_get_params(void *provctx, OSSL_PARAM params[]) if (p != NULL && !OSSL_PARAM_set_utf8_ptr(p, OPENSSL_FULL_VERSION_STR)) return 0; p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_STATUS); - if (p != NULL && !OSSL_PARAM_set_uint(p, 1)) + if (p != NULL && !OSSL_PARAM_set_int(p, ossl_prov_is_running())) return 0; return 1; } |