Void new FIPS tests if configured without FIPS.
authorAndy Polyakov <appro@openssl.org>
Mon, 9 May 2005 19:34:34 +0000 (19:34 +0000)
committerAndy Polyakov <appro@openssl.org>
Mon, 9 May 2005 19:34:34 +0000 (19:34 +0000)
fips/hmac/fips_hmactest.c
fips/rsa/fips_rsastest.c
fips/rsa/fips_rsavtest.c

index 0ace943d348813eb6f1ba6001b0602485f5acd3e..1a716ad99b28b7ae7adaff866049d6aa2f6be94b 100644 (file)
 #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
index 9de82ed86fdf4de35527268f2b83fc3f9367e51b..8c96cbad364a675188bc5e76e8690fcd1cfbd2e3 100644 (file)
 #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
index 9da60773e19bd7978af2159667e186b0fa276834..c443a6b0417f8e4a92b763272131e6b1cfd4c8da 100644 (file)
 #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