Skip to content
Snippets Groups Projects
Commit 67bd6f9c authored by Dan Fandrich's avatar Dan Fandrich
Browse files

Don't try to read the whole of the random file because when /dev/urandom is

used, it slows initialization too much reading an infinitely long file!
parent 4869fa28
No related branches found
No related tags found
No related merge requests found
......@@ -169,7 +169,7 @@ int random_the_seed(struct SessionHandle *data)
/* let the option override the define */
nread += RAND_load_file((data->set.ssl.random_file?
data->set.ssl.random_file:RANDOM_FILE),
-1); /* -1 to read the entire file */
16384); /* bounded size in case it's /dev/urandom */
if(seed_enough(nread))
return nread;
}
......@@ -231,7 +231,7 @@ int random_the_seed(struct SessionHandle *data)
RAND_file_name(buf, BUFSIZE);
if(buf[0]) {
/* we got a file name to try */
nread += RAND_load_file(buf, -1);
nread += RAND_load_file(buf, 16384);
if(seed_enough(nread))
return nread;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment