From 4fb40db932c9d183de7a4ee67163d6e70aac56c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bodo=20M=C3=B6ller?= Date: Mon, 23 Oct 2000 07:37:03 +0000 Subject: [PATCH] Don't ever set 'seeded' if RAND_status() returned 0 (although maybe this static variable should be abolished totally, it was introduced before RAND_status existed). --- apps/app_rand.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/app_rand.c b/apps/app_rand.c index c5d66a3b5f..2126fd5aa1 100644 --- a/apps/app_rand.c +++ b/apps/app_rand.c @@ -142,15 +142,18 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn) } if (file == NULL || !RAND_load_file(file, -1)) { - if (RAND_status() == 0 && !dont_warn) + if (RAND_status() == 0) { - BIO_printf(bio_e,"unable to load 'random state'\n"); - BIO_printf(bio_e,"This means that the random number generator has not been seeded\n"); - BIO_printf(bio_e,"with much random data.\n"); - if (consider_randfile) /* explanation does not apply when a file is explicitly named */ + if (!dont_warn) { - BIO_printf(bio_e,"Consider setting the RANDFILE environment variable to point at a file that\n"); - BIO_printf(bio_e,"'random' data can be kept in (the file will be overwritten).\n"); + BIO_printf(bio_e,"unable to load 'random state'\n"); + BIO_printf(bio_e,"This means that the random number generator has not been seeded\n"); + BIO_printf(bio_e,"with much random data.\n"); + if (consider_randfile) /* explanation does not apply when a file is explicitly named */ + { + BIO_printf(bio_e,"Consider setting the RANDFILE environment variable to point at a file that\n"); + BIO_printf(bio_e,"'random' data can be kept in (the file will be overwritten).\n"); + } } return 0; } -- 2.25.1