1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-06-16 06:15:24 +00:00

Feature: Read standard OpenSSL random seed file if any and linked with OpenSSL

This commit is contained in:
Philipp Schafft 2020-10-22 09:56:33 +00:00
parent a5f7b621c0
commit 2be5318067

View File

@ -64,6 +64,10 @@ static void prng_initial_seed(void)
pid_t ppid;
#endif
} seed;
#ifdef HAVE_OPENSSL
char buffer[1024];
const char *filename;
#endif
memset(&seed, 0, sizeof(seed));
@ -79,6 +83,13 @@ static void prng_initial_seed(void)
#endif
prng_write(&seed, sizeof(seed));
#ifdef HAVE_OPENSSL
filename = RAND_file_name(buffer, sizeof(buffer));
if (filename)
RAND_load_file(filename, -1);
ERR_get_error(); // clear error if any
#endif
}
static void prng_cross_seed(void)