mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
Feature: Read standard OpenSSL random seed file if any and linked with OpenSSL
This commit is contained in:
parent
a5f7b621c0
commit
2be5318067
11
src/prng.c
11
src/prng.c
@ -64,6 +64,10 @@ static void prng_initial_seed(void)
|
|||||||
pid_t ppid;
|
pid_t ppid;
|
||||||
#endif
|
#endif
|
||||||
} seed;
|
} seed;
|
||||||
|
#ifdef HAVE_OPENSSL
|
||||||
|
char buffer[1024];
|
||||||
|
const char *filename;
|
||||||
|
#endif
|
||||||
|
|
||||||
memset(&seed, 0, sizeof(seed));
|
memset(&seed, 0, sizeof(seed));
|
||||||
|
|
||||||
@ -79,6 +83,13 @@ static void prng_initial_seed(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
prng_write(&seed, sizeof(seed));
|
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)
|
static void prng_cross_seed(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user