summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/openssl.c2
-rw-r--r--fips/aes/fips_aesavs.c15
-rw-r--r--fips/des/fips_desmovs.c15
-rw-r--r--fips/dsa/fips_dsatest.c4
-rw-r--r--fips/rand/fips_randtest.c6
-rw-r--r--fips/sha1/fips_sha1test.c14
-rw-r--r--ssl/ssltest.c4
7 files changed, 34 insertions, 26 deletions
diff --git a/apps/openssl.c b/apps/openssl.c
index eb101ff670..65a9ee8a66 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -247,7 +247,7 @@ int main(int Argc, char *Argv[])
if (!FIPS_mode_set(1,p)) {
ERR_load_crypto_strings();
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
- exit(1);
+ EXIT(1);
}
in_FIPS_mode = 1;
if (getenv("OPENSSL_FIPS_MD5"))
diff --git a/fips/aes/fips_aesavs.c b/fips/aes/fips_aesavs.c
index b1239291f8..5fc2879067 100644
--- a/fips/aes/fips_aesavs.c
+++ b/fips/aes/fips_aesavs.c
@@ -103,7 +103,7 @@ int AESTest(EVP_CIPHER_CTX *ctx,
else
{
printf("Unknown mode: %s\n", amode);
- exit(1);
+ EXIT(1);
}
if (ret)
{
@@ -173,14 +173,14 @@ int AESTest(EVP_CIPHER_CTX *ctx,
break;
default:
printf("Didn't handle mode %d\n",kt);
- exit(1);
+ EXIT(1);
}
if (dir)
{ /* encrypt */
if(!EVP_CipherInit(ctx, cipher, aKey, iVec, AES_ENCRYPT))
{
ERR_print_errors_fp(stderr);
- exit(1);
+ EXIT(1);
}
EVP_Cipher(ctx, ciphertext, (unsigned char*)plaintext, len);
@@ -190,7 +190,7 @@ int AESTest(EVP_CIPHER_CTX *ctx,
if(!EVP_CipherInit(ctx, cipher, aKey, iVec, AES_DECRYPT))
{
ERR_print_errors_fp(stderr);
- exit(1);
+ EXIT(1);
}
EVP_Cipher(ctx, (unsigned char*)plaintext, ciphertext, len);
}
@@ -849,7 +849,7 @@ int proc_file(char *rqfile)
if(do_mct(amode, akeysz, aKey, iVec,
dir, (unsigned char*)plaintext, len,
rfp) < 0)
- exit(1);
+ EXIT(1);
}
else
{
@@ -942,7 +942,7 @@ int main(int argc, char **argv)
if(!FIPS_mode_set(1,argv[0]))
{
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
- exit(1);
+ EXIT(1);
}
#endif
ERR_load_crypto_strings();
@@ -987,7 +987,7 @@ int main(int argc, char **argv)
if (proc_file(rfn))
{
printf(">>> Processing failed for: %s <<<\n", rfn);
- exit(1);
+ EXIT(1);
}
}
fclose(fp);
@@ -1000,5 +1000,6 @@ int main(int argc, char **argv)
printf(">>> Processing failed for: %s <<<\n", fn);
}
}
+ EXIT(0);
return 0;
}
diff --git a/fips/des/fips_desmovs.c b/fips/des/fips_desmovs.c
index 08058940a5..d1b60c1a40 100644
--- a/fips/des/fips_desmovs.c
+++ b/fips/des/fips_desmovs.c
@@ -103,12 +103,12 @@ int DESTest(EVP_CIPHER_CTX *ctx,
else
{
printf("Unknown mode: %s\n", amode);
- exit(1);
+ EXIT(1);
}
if (akeysz != 64 && akeysz != 192)
{
printf("Invalid key size: %d\n", akeysz);
- exit(1);
+ EXIT(1);
}
else
{
@@ -153,12 +153,12 @@ int DESTest(EVP_CIPHER_CTX *ctx,
break;
default:
printf("Didn't handle mode %d\n",kt);
- exit(1);
+ EXIT(1);
}
if(!EVP_CipherInit(ctx, cipher, aKey, iVec, dir))
{
ERR_print_errors_fp(stderr);
- exit(1);
+ EXIT(1);
}
EVP_Cipher(ctx, out, in, len);
}
@@ -319,7 +319,7 @@ void do_mct(char *amode,
if (imode == 6)
{
printf("Unrecognized mode: %s\n", amode);
- exit(1);
+ EXIT(1);
}
for(i=0 ; i < 400 ; ++i)
@@ -770,7 +770,7 @@ int main(int argc, char **argv)
{
ERR_load_crypto_strings();
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
- exit(1);
+ EXIT(1);
}
#endif
ERR_load_crypto_strings();
@@ -815,7 +815,7 @@ int main(int argc, char **argv)
if (proc_file(rfn))
{
printf(">>> Processing failed for: %s <<<\n", rfn);
- exit(1);
+ EXIT(1);
}
}
fclose(fp);
@@ -828,5 +828,6 @@ int main(int argc, char **argv)
printf(">>> Processing failed for: %s <<<\n", fn);
}
}
+ EXIT(0);
return 0;
}
diff --git a/fips/dsa/fips_dsatest.c b/fips/dsa/fips_dsatest.c
index ffc9ccd828..7215940ede 100644
--- a/fips/dsa/fips_dsatest.c
+++ b/fips/dsa/fips_dsatest.c
@@ -150,7 +150,7 @@ int main(int argc, char **argv)
if(!FIPS_mode_set(1,argv[0]))
{
ERR_print_errors(bio_err);
- exit(1);
+ EXIT(1);
}
#endif
CRYPTO_malloc_debug_init();
@@ -227,7 +227,7 @@ end:
bio_err = NULL;
}
EXIT(!ret);
- return(0);
+ return(!ret);
}
static int cb_exit(int ec)
diff --git a/fips/rand/fips_randtest.c b/fips/rand/fips_randtest.c
index c5b2c3701c..6165944e56 100644
--- a/fips/rand/fips_randtest.c
+++ b/fips/rand/fips_randtest.c
@@ -178,7 +178,7 @@ static void compare(const unsigned char *result,const unsigned char *expected,
puts("\n expected:");
dump(expected,8);
putchar('\n');
- exit(1);
+ EXIT(1);
}
}
@@ -194,14 +194,14 @@ static void run_test(const PRNGtest *t)
if(RAND_bytes(buf,8) <= 0)
{
ERR_print_errors_fp(stderr);
- exit(2);
+ EXIT(2);
}
compare(buf,t->block1,8);
for(n=0 ; n < 99 ; ++n)
if(RAND_bytes(buf,8) <= 0)
{
ERR_print_errors_fp(stderr);
- exit(2);
+ EXIT(2);
}
compare(buf,t->block100,8);
FIPS_test_mode(0,NULL);
diff --git a/fips/sha1/fips_sha1test.c b/fips/sha1/fips_sha1test.c
index 5a5ed2b69b..176d6009bb 100644
--- a/fips/sha1/fips_sha1test.c
+++ b/fips/sha1/fips_sha1test.c
@@ -6,6 +6,11 @@
#include <openssl/sha.h>
#include <openssl/err.h>
#include <openssl/fips.h>
+#ifdef FLAT_INC
+#include "e_os.h"
+#else
+#include "../e_os.h"
+#endif
#ifndef OPENSSL_FIPS
int main(int argc, char *argv[])
@@ -67,20 +72,20 @@ int main(int argc,char **argv)
if(argc != 2)
{
fprintf(stderr,"%s <test vector file>\n",argv[0]);
- exit(1);
+ EXIT(1);
}
if(!FIPS_mode_set(1,argv[0]))
{
ERR_load_crypto_strings();
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
- exit(1);
+ EXIT(1);
}
fp=fopen(argv[1],"r");
if(!fp)
{
perror(argv[1]);
- exit(2);
+ EXIT(2);
}
for(phase=0 ; ; )
@@ -140,6 +145,7 @@ int main(int argc,char **argv)
else
montecarlo(buf,bit/8);
}
- return 0;
+ EXIT(0);
+ return(0);
}
#endif
diff --git a/ssl/ssltest.c b/ssl/ssltest.c
index c7f33d9a7f..7e58582f96 100644
--- a/ssl/ssltest.c
+++ b/ssl/ssltest.c
@@ -414,7 +414,7 @@ int main(int argc, char *argv[])
fips_mode=1;
#else
fprintf(stderr,"not compiled with FIPS support, so exitting without running.\n");
- exit(0);
+ EXIT(0);
#endif
}
else if (strcmp(*argv,"-server_auth") == 0)
@@ -568,7 +568,7 @@ bad:
{
ERR_load_crypto_strings();
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
- exit(1);
+ EXIT(1);
}
else
fprintf(stderr,"*** IN FIPS MODE ***\n");