From 8776ef63c15528053ee6410d35e1b26a44548e2a Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Mon, 4 Apr 2011 15:38:21 +0000 Subject: [PATCH] Change FIPS locking functions to macros so we get useful line information. Set fips_thread_set properly. --- fips/fips.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fips/fips.c b/fips/fips.c index 2b66160bb5..e8d99c5004 100644 --- a/fips/fips.c +++ b/fips/fips.c @@ -80,10 +80,10 @@ static int fips_set_owning_thread(void); static int fips_clear_owning_thread(void); static unsigned char *fips_signature_witness(void); -static void fips_w_lock(void) { CRYPTO_w_lock(CRYPTO_LOCK_FIPS); } -static void fips_w_unlock(void) { CRYPTO_w_unlock(CRYPTO_LOCK_FIPS); } -static void fips_r_lock(void) { CRYPTO_r_lock(CRYPTO_LOCK_FIPS); } -static void fips_r_unlock(void) { CRYPTO_r_unlock(CRYPTO_LOCK_FIPS); } +#define fips_w_lock() CRYPTO_w_lock(CRYPTO_LOCK_FIPS) +#define fips_w_unlock() CRYPTO_w_unlock(CRYPTO_LOCK_FIPS) +#define fips_r_lock() CRYPTO_r_lock(CRYPTO_LOCK_FIPS) +#define fips_r_unlock() CRYPTO_r_unlock(CRYPTO_LOCK_FIPS) static void fips_set_mode(int onoff) { @@ -404,6 +404,7 @@ int fips_set_owning_thread(void) { CRYPTO_THREADID_current(&fips_thread); ret = 1; + fips_thread_set = 1; } CRYPTO_w_unlock(CRYPTO_LOCK_FIPS2); } -- 2.40.0