fips: use tsan counter instead of tsan_add to increment
authorPauli <pauli@openssl.org>
Wed, 14 Jun 2023 06:53:51 +0000 (16:53 +1000)
committerPauli <pauli@openssl.org>
Fri, 16 Jun 2023 10:10:47 +0000 (20:10 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/21199)

(cherry picked from commit ff934cfdc85a7b8ddb4bdebf9ab68d518bf68b7f)

providers/fips/self_test.c

index 9a55bfb79de89b7d44d7fd5c927c559526cabeb0..0a0046389aa6fc7e24c429710261b3f9d1e6a1ef 100644 (file)
@@ -460,7 +460,7 @@ int ossl_prov_is_running(void)
     loclstate = tsan_load(&FIPS_state);
     res = loclstate == FIPS_STATE_RUNNING || loclstate == FIPS_STATE_SELFTEST;
     if (loclstate == FIPS_STATE_ERROR)
-        if (tsan_add(&rate_limit, 1) < FIPS_ERROR_REPORTING_RATE_LIMIT)
+        if (tsan_counter(&rate_limit) < FIPS_ERROR_REPORTING_RATE_LIMIT)
             ERR_raise(ERR_LIB_PROV, PROV_R_FIPS_MODULE_IN_ERROR_STATE);
     return res;
 }