From 14ae26f2e4f83b9ec0cbb02976e08a69bc5e5ba4 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Thu, 3 Feb 2011 17:00:24 +0000 Subject: [PATCH] Transfer error redirection to fips.h, add OPENSSL_FIPSAPI to source files that use it. --- crypto/bn/bn_add.c | 2 ++ crypto/bn/bn_div.c | 2 ++ crypto/bn/bn_exp2.c | 2 ++ crypto/bn/bn_gcd.c | 2 ++ crypto/bn/bn_mod.c | 2 ++ crypto/dh/dh_gen.c | 2 ++ crypto/dh/dh_key.c | 2 ++ crypto/dsa/dsa_key.c | 2 ++ crypto/dsa/dsa_ossl.c | 2 ++ crypto/err/err.h | 5 ----- crypto/evp/e_aes.c | 2 ++ crypto/fips_err.c | 7 ------- crypto/rsa/rsa_crpt.c | 2 ++ crypto/rsa/rsa_none.c | 2 ++ crypto/rsa/rsa_pk1.c | 2 ++ crypto/rsa/rsa_ssl.c | 2 ++ crypto/rsa/rsa_x931.c | 2 ++ crypto/rsa/rsa_x931g.c | 2 ++ fips/fips.h | 3 +++ fips/hmac/fips_hmac_selftest.c | 2 ++ fips/rand/fips_rand_selftest.c | 2 ++ fips/utl/fips_err.c | 2 ++ 22 files changed, 41 insertions(+), 12 deletions(-) delete mode 100644 crypto/fips_err.c diff --git a/crypto/bn/bn_add.c b/crypto/bn/bn_add.c index 9405163706..f8e6729a47 100644 --- a/crypto/bn/bn_add.c +++ b/crypto/bn/bn_add.c @@ -56,6 +56,8 @@ * [including the GNU Public Licence.] */ +#define OPENSSL_FIPSAPI + #include #include "cryptlib.h" #include "bn_lcl.h" diff --git a/crypto/bn/bn_div.c b/crypto/bn/bn_div.c index 802a43d642..a6a955808b 100644 --- a/crypto/bn/bn_div.c +++ b/crypto/bn/bn_div.c @@ -56,6 +56,8 @@ * [including the GNU Public Licence.] */ +#define OPENSSL_FIPSAPI + #include #include #include "cryptlib.h" diff --git a/crypto/bn/bn_exp2.c b/crypto/bn/bn_exp2.c index bd0c34b91b..a00c115216 100644 --- a/crypto/bn/bn_exp2.c +++ b/crypto/bn/bn_exp2.c @@ -109,6 +109,8 @@ * */ +#define OPENSSL_FIPSAPI + #include #include "cryptlib.h" #include "bn_lcl.h" diff --git a/crypto/bn/bn_gcd.c b/crypto/bn/bn_gcd.c index 45b417bddc..adef79e87f 100644 --- a/crypto/bn/bn_gcd.c +++ b/crypto/bn/bn_gcd.c @@ -109,6 +109,8 @@ * */ +#define OPENSSL_FIPSAPI + #include "cryptlib.h" #include "bn_lcl.h" diff --git a/crypto/bn/bn_mod.c b/crypto/bn/bn_mod.c index 77d6ddb91a..49c74fbb83 100644 --- a/crypto/bn/bn_mod.c +++ b/crypto/bn/bn_mod.c @@ -111,6 +111,8 @@ * [including the GNU Public Licence.] */ +#define OPENSSL_FIPSAPI + #include "cryptlib.h" #include "bn_lcl.h" diff --git a/crypto/dh/dh_gen.c b/crypto/dh/dh_gen.c index 82e560068f..9749b72157 100644 --- a/crypto/dh/dh_gen.c +++ b/crypto/dh/dh_gen.c @@ -61,6 +61,8 @@ * - Geoff */ +#define OPENSSL_FIPSAPI + #include #include "cryptlib.h" #include diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c index 99c722bf03..bba83be312 100644 --- a/crypto/dh/dh_key.c +++ b/crypto/dh/dh_key.c @@ -56,6 +56,8 @@ * [including the GNU Public Licence.] */ +#define OPENSSL_FIPSAPI + #include #include "cryptlib.h" #include diff --git a/crypto/dsa/dsa_key.c b/crypto/dsa/dsa_key.c index 5cacc04478..a90b3c460b 100644 --- a/crypto/dsa/dsa_key.c +++ b/crypto/dsa/dsa_key.c @@ -56,6 +56,8 @@ * [including the GNU Public Licence.] */ +#define OPENSSL_FIPSAPI + #include #include #include "cryptlib.h" diff --git a/crypto/dsa/dsa_ossl.c b/crypto/dsa/dsa_ossl.c index fd757082f9..8fa39e9281 100644 --- a/crypto/dsa/dsa_ossl.c +++ b/crypto/dsa/dsa_ossl.c @@ -58,6 +58,8 @@ /* Original version from Steven Schoch */ +#define OPENSSL_FIPSAPI + #include #include "cryptlib.h" #include diff --git a/crypto/err/err.h b/crypto/err/err.h index 37aee6f485..3d71e4212e 100644 --- a/crypto/err/err.h +++ b/crypto/err/err.h @@ -137,11 +137,6 @@ extern "C" { #define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,NULL,0) #endif -#if defined(OPENSSL_FIPSCANISTER) && !defined(OPENSSL_NO_FIPS_ERR) -#define ERR_put_error FIPS_put_error -#define ERR_add_error_data FIPS_add_error_data -#endif - #ifdef OPENSSL_FIPS void FIPS_set_error_callbacks( void (*put_cb)(int lib, int func,int reason,const char *file,int line), diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c index 32c903386b..b4da40d0e2 100644 --- a/crypto/evp/e_aes.c +++ b/crypto/evp/e_aes.c @@ -48,6 +48,8 @@ * */ +#define OPENSSL_FIPSAPI + #include #ifndef OPENSSL_NO_AES #include diff --git a/crypto/fips_err.c b/crypto/fips_err.c deleted file mode 100644 index 09f11748f6..0000000000 --- a/crypto/fips_err.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -#ifdef OPENSSL_FIPS -# include "fips_err.h" -#else -static void *dummy=&dummy; -#endif diff --git a/crypto/rsa/rsa_crpt.c b/crypto/rsa/rsa_crpt.c index 7750366613..6a0cf39a5f 100644 --- a/crypto/rsa/rsa_crpt.c +++ b/crypto/rsa/rsa_crpt.c @@ -56,6 +56,8 @@ * [including the GNU Public Licence.] */ +#define OPENSSL_FIPSAPI + #include #include #include "cryptlib.h" diff --git a/crypto/rsa/rsa_none.c b/crypto/rsa/rsa_none.c index e6f3e627ca..b8d01a92cf 100644 --- a/crypto/rsa/rsa_none.c +++ b/crypto/rsa/rsa_none.c @@ -56,6 +56,8 @@ * [including the GNU Public Licence.] */ +#define OPENSSL_FIPSAPI + #include #include "cryptlib.h" #include diff --git a/crypto/rsa/rsa_pk1.c b/crypto/rsa/rsa_pk1.c index 8560755f1d..0cce4bf657 100644 --- a/crypto/rsa/rsa_pk1.c +++ b/crypto/rsa/rsa_pk1.c @@ -56,6 +56,8 @@ * [including the GNU Public Licence.] */ +#define OPENSSL_FIPSAPI + #include #include "cryptlib.h" #include diff --git a/crypto/rsa/rsa_ssl.c b/crypto/rsa/rsa_ssl.c index cfeff15bc9..1831fcf062 100644 --- a/crypto/rsa/rsa_ssl.c +++ b/crypto/rsa/rsa_ssl.c @@ -56,6 +56,8 @@ * [including the GNU Public Licence.] */ +#define OPENSSL_FIPSAPI + #include #include "cryptlib.h" #include diff --git a/crypto/rsa/rsa_x931.c b/crypto/rsa/rsa_x931.c index 21548e37ed..f037f4e47d 100644 --- a/crypto/rsa/rsa_x931.c +++ b/crypto/rsa/rsa_x931.c @@ -56,6 +56,8 @@ * */ +#define OPENSSL_FIPSAPI + #include #include "cryptlib.h" #include diff --git a/crypto/rsa/rsa_x931g.c b/crypto/rsa/rsa_x931g.c index 42c262aa41..1ccd0a1969 100644 --- a/crypto/rsa/rsa_x931g.c +++ b/crypto/rsa/rsa_x931g.c @@ -56,6 +56,8 @@ * [including the GNU Public Licence.] */ +#define OPENSSL_FIPSAPI + #include #include #include diff --git a/fips/fips.h b/fips/fips.h index ea01f9fc4b..9d7c37096d 100644 --- a/fips/fips.h +++ b/fips/fips.h @@ -120,6 +120,9 @@ void FIPS_set_locking_callback(void (*func)(int mode, int type, #define CRYPTO_malloc FIPS_malloc #define CRYPTO_free FIPS_free +#define ERR_put_error FIPS_put_error +#define ERR_add_error_data FIPS_add_error_data + #define EVP_MD_CTX_init FIPS_md_ctx_init #define EVP_MD_CTX_cleanup FIPS_md_ctx_cleanup #define EVP_MD_CTX_create FIPS_md_ctx_create diff --git a/fips/hmac/fips_hmac_selftest.c b/fips/hmac/fips_hmac_selftest.c index 73455ffee2..a3967a4a77 100644 --- a/fips/hmac/fips_hmac_selftest.c +++ b/fips/hmac/fips_hmac_selftest.c @@ -47,6 +47,8 @@ * */ +#define OPENSSL_FIPSAPI + #include #include #include diff --git a/fips/rand/fips_rand_selftest.c b/fips/rand/fips_rand_selftest.c index 2194a76cd1..f352cc6cd7 100644 --- a/fips/rand/fips_rand_selftest.c +++ b/fips/rand/fips_rand_selftest.c @@ -47,6 +47,8 @@ * */ +#define OPENSSL_FIPSAPI + #include #include #include diff --git a/fips/utl/fips_err.c b/fips/utl/fips_err.c index d5952444da..ddc9176da1 100644 --- a/fips/utl/fips_err.c +++ b/fips/utl/fips_err.c @@ -51,6 +51,8 @@ * ==================================================================== */ +#define OPENSSL_FIPSAPI + #include #include -- 2.40.0