Void new FIPS tests if configured without FIPS.

This commit is contained in:
Andy Polyakov 2005-05-09 19:34:34 +00:00
parent 95477d36f6
commit 82b47955fc
3 changed files with 33 additions and 9 deletions

View file

@ -65,6 +65,16 @@
#include <openssl/err.h>
#include <openssl/x509v3.h>
#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

View file

@ -65,6 +65,16 @@
#include <openssl/err.h>
#include <openssl/x509v3.h>
#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

View file

@ -65,6 +65,16 @@
#include <openssl/err.h>
#include <openssl/x509v3.h>
#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