mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-05-21 22:09:40 +00:00
Let's lock a write lock when changing values, shall we?
Thanks to Dr Stephen Henson <shenson@drh-consultancy.co.uk> for making me aware of this error.
This commit is contained in:
parent
7f9c37457a
commit
eb7bb58471
@ -551,13 +551,13 @@ int fips_set_owning_thread(void)
|
||||
|
||||
if (fips_is_started())
|
||||
{
|
||||
CRYPTO_r_lock(CRYPTO_LOCK_FIPS2);
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_FIPS2);
|
||||
if (fips_thread == 0)
|
||||
{
|
||||
fips_thread = CRYPTO_thread_id();
|
||||
ret = 1;
|
||||
}
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_FIPS2);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_FIPS2);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -568,13 +568,13 @@ int fips_clear_owning_thread(void)
|
||||
|
||||
if (fips_is_started())
|
||||
{
|
||||
CRYPTO_r_lock(CRYPTO_LOCK_FIPS2);
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_FIPS2);
|
||||
if (fips_thread == CRYPTO_thread_id())
|
||||
{
|
||||
fips_thread = 0;
|
||||
ret = 1;
|
||||
}
|
||||
CRYPTO_r_unlock(CRYPTO_LOCK_FIPS2);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_FIPS2);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user