Change default directory for storing the .rnd file on Windows
authorMatt Caswell <matt@openssl.org>
Wed, 15 Jun 2016 15:14:30 +0000 (11:14 -0400)
committerMatt Caswell <matt@openssl.org>
Fri, 17 Jun 2016 16:26:18 +0000 (17:26 +0100)
commit13c03c8d6da334bb1cde6ce4133e7c75b3b76947
tree488a74f29a2db17f65502eac3b59926b2e4970c9
parent4813ad2d245cbf7fed2898d173eaa9e2a00e3e23
Change default directory for storing the .rnd file on Windows

Previously we would try %RANDFILE%, then %HOME% and finally "C:".
Unfortunately this often ends up being "C:" which the user may not
have write permission for.

Now we try %RANDFILE% first, and then the same set of environment vars
as GetTempFile() uses, i.e. %TMP%, then %TEMP%, %USERPROFILE% and
%SYSTEMROOT%. If all else fails we fall back to %HOME% and only then "C:".

Reviewed-by: Rich Salz <rsalz@openssl.org>
CHANGES
crypto/rand/randfile.c
doc/crypto/RAND_load_file.pod