From: Pauli Date: Mon, 7 Sep 2020 01:58:48 +0000 (+1000) Subject: FIPS: rename the status call to is_running. X-Git-Tag: openssl-3.0.0-alpha7~290 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6cf37302677a87539fd017e3466813510ce51023;p=thirdparty%2Fopenssl.git FIPS: rename the status call to is_running. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/12801) --- diff --git a/providers/fips/fipsprov.c b/providers/fips/fipsprov.c index c9867f998cf..0f1c979efef 100644 --- a/providers/fips/fipsprov.c +++ b/providers/fips/fipsprov.c @@ -99,7 +99,7 @@ static const OSSL_PARAM fips_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_UNSIGNED_INTEGER, NULL, 0), + OSSL_PARAM_DEFN(OSSL_PROV_PARAM_STATUS, OSSL_PARAM_INTEGER, NULL, 0), OSSL_PARAM_END }; @@ -148,7 +148,7 @@ static int fips_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, FIPS_is_running())) + if (p != NULL && !OSSL_PARAM_set_int(p, ossl_prov_is_running())) return 0; return 1; } @@ -480,7 +480,7 @@ static const OSSL_ALGORITHM *fips_query(void *provctx, int operation_id, { *no_cache = 0; - if (!FIPS_is_running()) + if (!ossl_prov_is_running()) return NULL; switch (operation_id) { diff --git a/providers/fips/self_test.c b/providers/fips/self_test.c index 978440adf1a..8a70bdee7cf 100644 --- a/providers/fips/self_test.c +++ b/providers/fips/self_test.c @@ -15,6 +15,8 @@ #include #include "e_os.h" #include "prov/providercommonerr.h" +#include "prov/providercommon.h" + /* * We're cheating here. Normally we don't allow RUN_ONCE usage inside the FIPS * module because all such initialisation should be associated with an @@ -307,7 +309,7 @@ end: } -unsigned int FIPS_is_running(void) +int ossl_prov_is_running(void) { return FIPS_state == FIPS_STATE_RUNNING || FIPS_state == FIPS_STATE_SELFTEST; diff --git a/providers/fips/self_test.h b/providers/fips/self_test.h index f40788581c5..20f8a124725 100644 --- a/providers/fips/self_test.h +++ b/providers/fips/self_test.h @@ -34,4 +34,3 @@ typedef struct self_test_post_params_st { int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test); int SELF_TEST_kats(OSSL_SELF_TEST *event, OPENSSL_CTX *libctx); -unsigned int FIPS_is_running(void);