aboutsummaryrefslogtreecommitdiff
path: root/apps/lib/app_rand.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/lib/app_rand.c')
-rw-r--r--apps/lib/app_rand.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/lib/app_rand.c b/apps/lib/app_rand.c
index 713792ead40a..64d0f9b30910 100644
--- a/apps/lib/app_rand.c
+++ b/apps/lib/app_rand.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -7,6 +7,7 @@
* https://www.openssl.org/source/license.html
*/
+#include "internal/e_os.h" /* LIST_SEPARATOR_CHAR */
#include "apps.h"
#include <openssl/bio.h>
#include <openssl/err.h>
@@ -18,12 +19,10 @@ static STACK_OF(OPENSSL_STRING) *randfiles;
void app_RAND_load_conf(CONF *c, const char *section)
{
- const char *randfile = NCONF_get_string(c, section, "RANDFILE");
+ const char *randfile = app_conf_try_string(c, section, "RANDFILE");
- if (randfile == NULL) {
- ERR_clear_error();
+ if (randfile == NULL)
return;
- }
if (RAND_load_file(randfile, -1) < 0) {
BIO_printf(bio_err, "Can't load %s into RNG\n", randfile);
ERR_print_errors(bio_err);
@@ -43,7 +42,7 @@ static int loadfiles(char *name)
char *p;
int last, ret = 1;
- for ( ; ; ) {
+ for (;;) {
last = 0;
for (p = name; *p != '\0' && *p != LIST_SEPARATOR_CHAR; p++)
continue;