diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c index b00a8cf340208b7277c59c9a57b3b9f88b6a5916..2f7fb843a95d204d5e688d7b2252b93770da2f09 100644 --- a/crypto/bn/bn_mont.c +++ b/crypto/bn/bn_mont.c @@ -116,7 +116,7 @@ * sections 3.8 and 4.2 in http://security.ece.orst.edu/koc/papers/r01rsasw.pdf */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include "cryptlib.h" diff --git a/crypto/crypto.h b/crypto/crypto.h index 84d3520ec23aca981021584dfcb190ca438ba57a..5089c658826409687040c8d77fcae0b2711c6d28 100644 --- a/crypto/crypto.h +++ b/crypto/crypto.h @@ -249,10 +249,6 @@ typedef struct openssl_item_st #define CRYPTO_add(a,b,c) ((*(a))+=(b)) #endif -#if defined(OPENSSL_FIPSCANISTER) && defined(OPENSSL_FIPSEVP) -#define CRYPTO_lock FIPS_lock -#endif - /* Some applications as well as some parts of OpenSSL need to allocate and deallocate locks in a dynamic fashion. The following typedef makes this possible in a type-safe manner. */ diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index 8096a15eb2dfcaa17b246ce65586afaffd2de5ea..d5a41c249a8eadb1a520e74b7f1f0faf0781c8cb 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -73,7 +73,7 @@ #ifndef OPENSSL_NO_SHA -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include "cryptlib.h" diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index 0db6f15ac9d909f01687f84ed3152a55dd67f288..086da7c794139256c783900bc0838e7c8ec41fd7 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -551,7 +551,7 @@ int FIPS_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, #endif -#if defined(OPENSSL_FIPSCANISTER) && defined(OPENSSL_FIPSEVP) +#if defined(OPENSSL_FIPSCANISTER) && defined(OPENSSL_FIPSAPI) #define EVP_MD_CTX_init FIPS_md_ctx_init #define EVP_MD_CTX_cleanup FIPS_md_ctx_cleanup diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index 88941bdb4565dd93d38520c8178857ab9f347f93..dc28d8da872972a755118b5f861b6020faef2f29 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/crypto/lock.c b/crypto/lock.c index 49db044fc175dc91c692089ab3ed28354226cc32..bbce52addb8a2006d1dabe81f65c552a71ade00d 100644 --- a/crypto/lock.c +++ b/crypto/lock.c @@ -116,6 +116,9 @@ #include "cryptlib.h" #include +#ifdef OPENSSL_FIPS +#include +#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; } diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c index a06fd209d9b8b264017059ef2cee31dff1b8417b..87d4bfb75d88c202a64dd04bb7f67c8deb9dafe4 100644 --- a/crypto/rand/md_rand.c +++ b/crypto/rand/md_rand.c @@ -109,7 +109,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #ifdef MD_RAND_DEBUG # ifndef NDEBUG diff --git a/crypto/rsa/rsa_eay.c b/crypto/rsa/rsa_eay.c index 1f18854f065789e0e624aecf97e0c55a69a8fa22..b088d0dbf5df7b5a7f0b047bcf52243f2043d277 100644 --- a/crypto/rsa/rsa_eay.c +++ b/crypto/rsa/rsa_eay.c @@ -109,7 +109,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include "cryptlib.h" diff --git a/crypto/rsa/rsa_oaep.c b/crypto/rsa/rsa_oaep.c index bf8dd044b1546addafc61bfbab3a4384a56d3afb..eaae71223682099f737e5c8377894662de1a15da 100644 --- a/crypto/rsa/rsa_oaep.c +++ b/crypto/rsa/rsa_oaep.c @@ -18,7 +18,7 @@ * an equivalent notion. */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1) diff --git a/crypto/rsa/rsa_pss.c b/crypto/rsa/rsa_pss.c index 794de9dff676b9aeee9b1642f196e2c08adc4d4f..e8f6798bbd6a5de9aa01476ec6bc57cb37719537 100644 --- a/crypto/rsa/rsa_pss.c +++ b/crypto/rsa/rsa_pss.c @@ -56,7 +56,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include "cryptlib.h" diff --git a/fips/aes/fips_aes_selftest.c b/fips/aes/fips_aes_selftest.c index 8b6dd97566ab26eb290c8c9d368292aff6d78084..8c5a0eeacd44efd8667b2d21af02571a50964154 100644 --- a/fips/aes/fips_aes_selftest.c +++ b/fips/aes/fips_aes_selftest.c @@ -47,7 +47,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/aes/fips_aesavs.c b/fips/aes/fips_aesavs.c index d7b18ee973700e1656ae8e9cd2a040d1be6d0ba7..1f302a59fcc464e1f316b931a74e2605fab830ca 100644 --- a/fips/aes/fips_aesavs.c +++ b/fips/aes/fips_aesavs.c @@ -57,7 +57,7 @@ U.S.A. ----------------------------------------------*/ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/des/fips_des_selftest.c b/fips/des/fips_des_selftest.c index cad3270cc899cb4dca01f35d325275ccba07e5ac..d93d3b5558de02c44f8bc4bda1d4617700806995 100644 --- a/fips/des/fips_des_selftest.c +++ b/fips/des/fips_des_selftest.c @@ -47,7 +47,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/des/fips_desmovs.c b/fips/des/fips_desmovs.c index baa0b0488be3681a2c75c23f67d4f43c37beb086..6766d1c9154b82ddd24cba4dfe601d7c99792644 100644 --- a/fips/des/fips_desmovs.c +++ b/fips/des/fips_desmovs.c @@ -58,7 +58,7 @@ U.S.A. ----------------------------------------------*/ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/dsa/fips_dsa_selftest.c b/fips/dsa/fips_dsa_selftest.c index db000a84840038d27fbec5a0df5cd2231c8440a0..9524e634a3db5fff0812d875e9a936f1977fe610 100644 --- a/fips/dsa/fips_dsa_selftest.c +++ b/fips/dsa/fips_dsa_selftest.c @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/dsa/fips_dsa_sign.c b/fips/dsa/fips_dsa_sign.c index c111ce0f25af2e50b1b8d573bb8f3551c3cd9628..7223589af3a324def636cbba18d4c3c0a74d43aa 100644 --- a/fips/dsa/fips_dsa_sign.c +++ b/fips/dsa/fips_dsa_sign.c @@ -56,7 +56,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/dsa/fips_dssvs.c b/fips/dsa/fips_dssvs.c index 9c9e37b4526b37c201a60b30b1294e0dfb6815dd..513df722cbbaf2cb49901658be65b8d8b1b9f67a 100644 --- a/fips/dsa/fips_dssvs.c +++ b/fips/dsa/fips_dssvs.c @@ -10,7 +10,7 @@ int main(int argc, char **argv) } #else -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/fips.c b/fips/fips.c index b6de3f7fdfae90ac2a67f0176ab16603dcc6e5c8..83b72e577f982deff37e747780b348a381dc297b 100644 --- a/fips/fips.c +++ b/fips/fips.c @@ -47,7 +47,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/fips.h b/fips/fips.h index 061ed9394be3beea023c46d302370301fce3049a..96d8ff64bba7f14d684bf7a0a3b7b49800a3d6b6 100644 --- a/fips/fips.h +++ b/fips/fips.h @@ -122,6 +122,10 @@ int FIPS_evp_md_ctx_cleanup(EVP_MD_CTX *ctx); void FIPS_set_locking_callback (void (*func)(int mode, int type, const char *file,int line)); +#if defined(OPENSSL_FIPSCANISTER) && defined(OPENSSL_FIPSAPI) +#define CRYPTO_lock FIPS_lock +#endif + /* BEGIN ERROR CODES */ /* The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. diff --git a/fips/fips_test_suite.c b/fips/fips_test_suite.c index 0d6bc807fde15b30520c87014c45d48b0fbfe7a6..6944dbca4a5fdb1dfb28b513f7b8dd931ddd5c2c 100644 --- a/fips/fips_test_suite.c +++ b/fips/fips_test_suite.c @@ -12,7 +12,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/rand/fips_rand.c b/fips/rand/fips_rand.c index b0505782d3985e5dba37ce85958507b494dcfdad..f573b26b6107090a1819c776488c975eee0ba3e7 100644 --- a/fips/rand/fips_rand.c +++ b/fips/rand/fips_rand.c @@ -47,7 +47,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI /* * This is a FIPS approved AES PRNG based on ANSI X9.31 A.2.4. diff --git a/fips/rsa/fips_rsa_sign.c b/fips/rsa/fips_rsa_sign.c index a7f73f5121e56290bf590dcc94342d3d0d303895..d07111b4be61c135ed9401665d47a28c073733b4 100644 --- a/fips/rsa/fips_rsa_sign.c +++ b/fips/rsa/fips_rsa_sign.c @@ -56,7 +56,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/rsa/fips_rsagtest.c b/fips/rsa/fips_rsagtest.c index 1b79ffa70f5f5f2e4031d2a84de103b7e2d54dac..95960ef0070830cc841cc93e0cd62f88394beea2 100644 --- a/fips/rsa/fips_rsagtest.c +++ b/fips/rsa/fips_rsagtest.c @@ -56,7 +56,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/rsa/fips_rsastest.c b/fips/rsa/fips_rsastest.c index 2a125ae02da7de2307f9efb4ec9fdd7bea8ba4af..9dff464a36bc880675aa8f25583cc11944b3176e 100644 --- a/fips/rsa/fips_rsastest.c +++ b/fips/rsa/fips_rsastest.c @@ -56,7 +56,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/rsa/fips_rsavtest.c b/fips/rsa/fips_rsavtest.c index 042180762301980eb8cfbbb27f28d362fcfb546b..0971f15fc02108b4ec9bb848c872eb722cbfb669 100644 --- a/fips/rsa/fips_rsavtest.c +++ b/fips/rsa/fips_rsavtest.c @@ -56,7 +56,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/sha/fips_sha1_selftest.c b/fips/sha/fips_sha1_selftest.c index 2c6a5917d5e794af77527ef86eeb103a30bcb1b0..4291617596357d36115a760586bc11dc7b631fbf 100644 --- a/fips/sha/fips_sha1_selftest.c +++ b/fips/sha/fips_sha1_selftest.c @@ -47,7 +47,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/sha/fips_shatest.c b/fips/sha/fips_shatest.c index 97b68b82b19f142e7656dbeffc69c3be5680dae0..480b990fb8236d851a0fa1b201921ab8af03c7b6 100644 --- a/fips/sha/fips_shatest.c +++ b/fips/sha/fips_shatest.c @@ -56,7 +56,7 @@ * */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include diff --git a/fips/utl/fips_lck.c b/fips/utl/fips_lck.c index 47168af233b3a242d2893692a7d3dc986f915955..63b4c0da73e7a512e4e778d85bab477d09475e3d 100644 --- a/fips/utl/fips_lck.c +++ b/fips/utl/fips_lck.c @@ -51,7 +51,7 @@ * ==================================================================== */ -#define OPENSSL_FIPSEVP +#define OPENSSL_FIPSAPI #include #include