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"))
else
{
printf("Unknown mode: %s\n", amode);
- exit(1);
+ EXIT(1);
}
if (ret)
{
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);
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);
}
if(do_mct(amode, akeysz, aKey, iVec,
dir, (unsigned char*)plaintext, len,
rfp) < 0)
- exit(1);
+ EXIT(1);
}
else
{
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();
if (proc_file(rfn))
{
printf(">>> Processing failed for: %s <<<\n", rfn);
- exit(1);
+ EXIT(1);
}
}
fclose(fp);
printf(">>> Processing failed for: %s <<<\n", fn);
}
}
+ EXIT(0);
return 0;
}
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
{
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);
}
if (imode == 6)
{
printf("Unrecognized mode: %s\n", amode);
- exit(1);
+ EXIT(1);
}
for(i=0 ; i < 400 ; ++i)
{
ERR_load_crypto_strings();
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
- exit(1);
+ EXIT(1);
}
#endif
ERR_load_crypto_strings();
if (proc_file(rfn))
{
printf(">>> Processing failed for: %s <<<\n", rfn);
- exit(1);
+ EXIT(1);
}
}
fclose(fp);
printf(">>> Processing failed for: %s <<<\n", fn);
}
}
+ EXIT(0);
return 0;
}
if(!FIPS_mode_set(1,argv[0]))
{
ERR_print_errors(bio_err);
- exit(1);
+ EXIT(1);
}
#endif
CRYPTO_malloc_debug_init();
bio_err = NULL;
}
EXIT(!ret);
- return(0);
+ return(!ret);
}
static int cb_exit(int ec)
puts("\n expected:");
dump(expected,8);
putchar('\n');
- exit(1);
+ EXIT(1);
}
}
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);
#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[])
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 ; ; )
else
montecarlo(buf,bit/8);
}
- return 0;
+ EXIT(0);
+ return(0);
}
#endif
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)
{
ERR_load_crypto_strings();
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
- exit(1);
+ EXIT(1);
}
else
fprintf(stderr,"*** IN FIPS MODE ***\n");