From 364f36f85168b186612a0bc425f745caf99c0b08 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 17 Sep 2008 15:07:41 +0000 Subject: [PATCH] Don't change NUM_LOCKS value for non-FIPS builds. --- crypto/crypto.h | 4 ++++ crypto/dyn_lck.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/crypto/crypto.h b/crypto/crypto.h index e86d20f1e2..789742918e 100644 --- a/crypto/crypto.h +++ b/crypto/crypto.h @@ -219,9 +219,13 @@ typedef struct openssl_item_st #define CRYPTO_LOCK_EC_PRE_COMP 36 #define CRYPTO_LOCK_STORE 37 #define CRYPTO_LOCK_COMP 38 +#ifndef OPENSSL_FIPS +#define CRYPTO_NUM_LOCKS 39 +#else #define CRYPTO_LOCK_FIPS 39 #define CRYPTO_LOCK_FIPS2 40 #define CRYPTO_NUM_LOCKS 41 +#endif #define CRYPTO_LOCK 1 #define CRYPTO_UNLOCK 2 diff --git a/crypto/dyn_lck.c b/crypto/dyn_lck.c index 926b0b7f49..7f82c41264 100644 --- a/crypto/dyn_lck.c +++ b/crypto/dyn_lck.c @@ -166,10 +166,16 @@ static const char* const lock_names[CRYPTO_NUM_LOCKS] = "ec_pre_comp", "store", "comp", +#ifndef OPENSSL_FIPS +# if CRYPTO_NUM_LOCKS != 39 +# error "Inconsistency between crypto.h and cryptlib.c" +# endif +#else "fips", "fips2", -#if CRYPTO_NUM_LOCKS != 41 -# error "Inconsistency between crypto.h and cryptlib.c" +# if CRYPTO_NUM_LOCKS != 41 +# error "Inconsistency between crypto.h and cryptlib.c" +# endif #endif }; -- 2.25.1