aboutsummaryrefslogtreecommitdiffstats
path: root/apps/openssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/openssl.c')
-rw-r--r--apps/openssl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/openssl.c b/apps/openssl.c
index 7d2b476cf048..480fef9e14ae 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -235,16 +235,19 @@ int main(int Argc, char *Argv[])
in_FIPS_mode = 0;
-#ifdef OPENSSL_FIPS
if(getenv("OPENSSL_FIPS")) {
+#ifdef 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;
- }
+#else
+ fprintf(stderr, "FIPS mode not supported.\n");
+ EXIT(1);
#endif
+ }
if (bio_err == NULL)
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
@@ -333,7 +336,8 @@ int main(int Argc, char *Argv[])
else prompt="OpenSSL> ";
fputs(prompt,stdout);
fflush(stdout);
- fgets(p,n,stdin);
+ if (!fgets(p,n,stdin))
+ goto end;
if (p[0] == '\0') goto end;
i=strlen(p);
if (i <= 1) break;