diff options
| author | Dan Fandrich <dan@coneharvesters.com> | 2005-03-04 20:10:29 +0000 | 
|---|---|---|
| committer | Dan Fandrich <dan@coneharvesters.com> | 2005-03-04 20:10:29 +0000 | 
| commit | 67bd6f9ccd53630fd22fde32b8d6ad2186f38d99 (patch) | |
| tree | 412b9686361030733a954ee2840dab97b186b5c3 | |
| parent | 4869fa285b582efc110ecfc30aeeabb9e1d04c8c (diff) | |
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!
| -rw-r--r-- | lib/ssluse.c | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/lib/ssluse.c b/lib/ssluse.c index 0a6868d51..ed4ecf205 100644 --- a/lib/ssluse.c +++ b/lib/ssluse.c @@ -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;    } | 
