Don't change NUM_LOCKS value for non-FIPS builds.
authorDr. Stephen Henson <steve@openssl.org>
Wed, 17 Sep 2008 15:07:41 +0000 (15:07 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 17 Sep 2008 15:07:41 +0000 (15:07 +0000)
crypto/crypto.h
crypto/dyn_lck.c

index e86d20f1e26c332da5892480b0868a47ce0ff418..789742918ed706c9a717b13ce1e08f4ccfe8f9d7 100644 (file)
@@ -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
index 926b0b7f4993dac63b912b95c67bb6087b2ea64b..7f82c4126493dcbf7d77e787a953f2fed648cb07 100644 (file)
@@ -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
        };