fips: use tsan counter instead of tsan_add to increment

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/21199)
This commit is contained in:
Pauli 2023-06-14 16:53:51 +10:00
parent 2525109f90
commit ff934cfdc8
1 changed files with 1 additions and 1 deletions

View File

@ -460,7 +460,7 @@ int ossl_prov_is_running(void)
loclstate = tsan_load(&FIPS_state); loclstate = tsan_load(&FIPS_state);
res = loclstate == FIPS_STATE_RUNNING || loclstate == FIPS_STATE_SELFTEST; res = loclstate == FIPS_STATE_RUNNING || loclstate == FIPS_STATE_SELFTEST;
if (loclstate == FIPS_STATE_ERROR) 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); ERR_raise(ERR_LIB_PROV, PROV_R_FIPS_MODULE_IN_ERROR_STATE);
return res; return res;
} }