summaryrefslogtreecommitdiffstats
path: root/apps/openssl.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2008-09-15 22:24:39 +0000
committerDr. Stephen Henson <steve@openssl.org>2008-09-15 22:24:39 +0000
commit3fa1a444ce3b6fbe70f501b7352153a785cdf97a (patch)
tree6d8cd3e090406a8d05335fc93db0071be5f247bd /apps/openssl.c
parenta2dc9b6be2c9e1919d8120aad43d9c601f47abd7 (diff)
Merge apps changes from FIPS branch.
Diffstat (limited to 'apps/openssl.c')
-rw-r--r--apps/openssl.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/apps/openssl.c b/apps/openssl.c
index ec25f990fe..7d2b476cf0 100644
--- a/apps/openssl.c
+++ b/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);
@@ -273,21 +287,9 @@ int main(int Argc, char *Argv[])
i=NCONF_load(config,p,&errline);
if (i == 0)
{
- if (ERR_GET_REASON(ERR_peek_last_error())
- == CONF_R_NO_SUCH_FILE)
- {
- BIO_printf(bio_err,
- "WARNING: can't open config file: %s\n",p);
- ERR_clear_error();
- NCONF_free(config);
- config = NULL;
- }
- else
- {
- ERR_print_errors(bio_err);
- NCONF_free(config);
- exit(1);
- }
+ NCONF_free(config);
+ config = NULL;
+ ERR_clear_error();
}
prog=prog_init();