]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
FIPS: rename the status call to is_running.
authorPauli <paul.dale@oracle.com>
Mon, 7 Sep 2020 01:58:48 +0000 (11:58 +1000)
committerPauli <paul.dale@oracle.com>
Sat, 12 Sep 2020 06:46:20 +0000 (16:46 +1000)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12801)

providers/fips/fipsprov.c
providers/fips/self_test.c
providers/fips/self_test.h

index c9867f998cf30b34d323e416dfd7bb5a1927c14b..0f1c979efef97281fb35ae406fe433ca317e1d3b 100644 (file)
@@ -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) {
index 978440adf1a6c4c9dde916072f28ddf6933bf9e5..8a70bdee7cf3d0d52e2fbef28961807866374de5 100644 (file)
@@ -15,6 +15,8 @@
 #include <openssl/err.h>
 #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;
index f40788581c56f22a8d2775da195e13888919b35b..20f8a1247253f8c47d5e6ef5e79e2e963dd4bdbe 100644 (file)
@@ -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);