From 630b9d70fb4862a503373fd6e27cee36a557391d Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 11 Jan 2005 18:25:28 +0000 Subject: Use EXIT() instead of exit(). --- fips/aes/fips_aesavs.c | 15 ++++++++------- fips/des/fips_desmovs.c | 15 ++++++++------- fips/dsa/fips_dsatest.c | 4 ++-- fips/rand/fips_randtest.c | 6 +++--- fips/sha1/fips_sha1test.c | 14 ++++++++++---- 5 files changed, 31 insertions(+), 23 deletions(-) (limited to 'fips') 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 #include #include +#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 \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 -- cgit v1.2.3