Change OPENSSL_FIPSEVP to OPENSSL_FIPSAPI as it doesn't just refer
[openssl.git] / crypto / lock.c
index 49db044..bbce52a 100644 (file)
 
 #include "cryptlib.h"
 #include <openssl/safestack.h>
+#ifdef OPENSSL_FIPS
+#include <openssl/fips.h>
+#endif
 
 #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16)
 static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */
@@ -380,6 +383,9 @@ void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *(*func)
 void CRYPTO_set_dynlock_lock_callback(void (*func)(int mode,
        struct CRYPTO_dynlock_value *l, const char *file, int line))
        {
+#ifdef OPENSSL_FIPS
+       FIPS_set_locking_callback(CRYPTO_lock);
+#endif
        dynlock_lock_callback=func;
        }
 
@@ -405,6 +411,9 @@ int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount,int type,
 void CRYPTO_set_locking_callback(void (*func)(int mode,int type,
                                              const char *file,int line))
        {
+#ifdef OPENSSL_FIPS
+       FIPS_set_locking_callback(CRYPTO_lock);
+#endif
        locking_callback=func;
        }