diff options
Diffstat (limited to 'crypto/openssl/apps/openssl.c')
-rw-r--r-- | crypto/openssl/apps/openssl.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/openssl/apps/openssl.c b/crypto/openssl/apps/openssl.c index 47aee5b..7d2b476 100644 --- a/crypto/openssl/apps/openssl.c +++ b/crypto/openssl/apps/openssl.c @@ -147,6 +147,7 @@ char *default_config_file=NULL; #ifdef MONOLITH CONF *config=NULL; BIO *bio_err=NULL; +int in_FIPS_mode=0; #endif @@ -232,6 +233,19 @@ int main(int Argc, char *Argv[]) arg.data=NULL; arg.count=0; + in_FIPS_mode = 0; + +#ifdef OPENSSL_FIPS + if(getenv("OPENSSL_FIPS")) { + if (!FIPS_mode_set(1)) { + ERR_load_crypto_strings(); + ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE)); + EXIT(1); + } + in_FIPS_mode = 1; + } +#endif + if (bio_err == NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); |