make update
[oweals/openssl.git] / apps / openssl.c
index 7d2b476cf048ed93e743abe03969ba45f24b50d9..480fef9e14aed23f78487e0f4ba35e1caeec8cb2 100644 (file)
@@ -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;