From: Andy Polyakov Date: Mon, 9 May 2005 19:34:34 +0000 (+0000) Subject: Void new FIPS tests if configured without FIPS. X-Git-Tag: BEN_FIPS_TEST_8~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82b47955fc44f0417112f48062f40ab611f11038;p=openssl Void new FIPS tests if configured without FIPS. --- diff --git a/fips/hmac/fips_hmactest.c b/fips/hmac/fips_hmactest.c index 0ace943d34..1a716ad99b 100644 --- a/fips/hmac/fips_hmactest.c +++ b/fips/hmac/fips_hmactest.c @@ -65,6 +65,16 @@ #include #include +#ifndef OPENSSL_FIPS + +int main(int argc, char *argv[]) +{ + printf("No FIPS HMAC support\n"); + return(0); +} + +#else + static int hmac_test(BIO *err, BIO *out, BIO *in); static int print_hmac(BIO *err, BIO *out, unsigned char *Key, int Klen, @@ -85,13 +95,11 @@ int main(int argc, char **argv) goto end; } -#ifdef OPENSSL_FIPS if(!FIPS_mode_set(1,argv[0])) { ERR_print_errors(err); goto end; } -#endif if (argc == 1) in = BIO_new_fp(stdin, BIO_NOCLOSE); @@ -307,4 +315,4 @@ static int print_hmac(BIO *err, BIO *out, return 1; } - +#endif diff --git a/fips/rsa/fips_rsastest.c b/fips/rsa/fips_rsastest.c index 9de82ed86f..8c96cbad36 100644 --- a/fips/rsa/fips_rsastest.c +++ b/fips/rsa/fips_rsastest.c @@ -65,6 +65,16 @@ #include #include +#ifndef OPENSSL_FIPS + +int main(int argc, char *argv[]) +{ + printf("No FIPS RSA support\n"); + return(0); +} + +#else + static int rsa_stest(BIO *err, BIO *out, BIO *in); static int rsa_printsig(BIO *err, BIO *out, RSA *rsa, const EVP_MD *dgst, unsigned char *Msg, long Msglen); @@ -84,13 +94,11 @@ int main(int argc, char **argv) goto end; } -#ifdef OPENSSL_FIPS if(!FIPS_mode_set(1,argv[0])) { ERR_print_errors(err); goto end; } -#endif if (argc == 1) in = BIO_new_fp(stdin, BIO_NOCLOSE); @@ -338,4 +346,4 @@ static int rsa_printsig(BIO *err, BIO *out, RSA *rsa, const EVP_MD *dgst, return ret; } - +#endif diff --git a/fips/rsa/fips_rsavtest.c b/fips/rsa/fips_rsavtest.c index 9da60773e1..c443a6b041 100644 --- a/fips/rsa/fips_rsavtest.c +++ b/fips/rsa/fips_rsavtest.c @@ -65,6 +65,16 @@ #include #include +#ifndef OPENSSL_FIPS + +int main(int argc, char *argv[]) +{ + printf("No FIPS RSA support\n"); + return(0); +} + +#else + static int rsa_test(BIO *err, BIO *out, BIO *in); static int rsa_printver(BIO *err, BIO *out, BIGNUM *n, BIGNUM *e, @@ -87,13 +97,11 @@ int main(int argc, char **argv) goto end; } -#ifdef OPENSSL_FIPS if(!FIPS_mode_set(1,argv[0])) { ERR_print_errors(err); goto end; } -#endif if (argc == 1) in = BIO_new_fp(stdin, BIO_NOCLOSE); @@ -347,4 +355,4 @@ static int rsa_printver(BIO *err, BIO *out, return ret; } - +#endif