summaryrefslogtreecommitdiff
path: root/apps/lib/app_rand.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2023-05-16 10:17:03 +0200
committerDr. David von Oheimb <dev@ddvo.net>2023-05-25 09:04:35 +0200
commitda7f81d39308f9ecab6fde1f9116ff673ef3f3b3 (patch)
tree3f1b8310b685dc306c3ff266e552d96829ea1db0 /apps/lib/app_rand.c
parentc8aec16383c7a9aec76b28e6eb95d36bef6f7e56 (diff)
APPS: replace awkward and error-prone pattern by calls to new app_conf_try_string()
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/20971)
Diffstat (limited to 'apps/lib/app_rand.c')
-rw-r--r--apps/lib/app_rand.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/lib/app_rand.c b/apps/lib/app_rand.c
index ad93858bfd..9691e71d7c 100644
--- a/apps/lib/app_rand.c
+++ b/apps/lib/app_rand.c
@@ -18,12 +18,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);