aboutsummaryrefslogtreecommitdiff
path: root/crypto/rand
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-06-20 07:56:32 +0200
committerRichard Levitte <levitte@openssl.org>2016-06-20 11:06:40 +0200
commitb8f304f70df820edb7740abcac31ed90073f3ecd (patch)
treeca6249cd86ce1c2adea65217be0f7c55437ff1e9 /crypto/rand
parenta8db2cfa4b293f3db9566a305a26109c4fde74b2 (diff)
downloadopenssl-b8f304f70df820edb7740abcac31ed90073f3ecd.zip
openssl-b8f304f70df820edb7740abcac31ed90073f3ecd.tar.gz
openssl-b8f304f70df820edb7740abcac31ed90073f3ecd.tar.bz2
Change default directory for the .rnd file on Windows and VMS
The previous change for Windows wasn't quite right. Corrected to use %HOME%, %USERPROFILE% and %SYSTEMPROFILE%, in that order. Also adding the default home for VMS, SYS$LOGIN: Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'crypto/rand')
-rw-r--r--crypto/rand/randfile.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c
index 19cce2c..87cb6c0 100644
--- a/crypto/rand/randfile.c
+++ b/crypto/rand/randfile.c
@@ -292,11 +292,9 @@ const char *RAND_file_name(char *buf, size_t size)
* uses TCHARs, but getenv() gives us chars so its easier to do it this
* way
*/
- if ((s = getenv("TMP")) == NULL
- && (s = getenv("TEMP")) == NULL
- && (s = getenv("USERPROFILE")) == NULL
- && (s = getenv("SYSTEMROOT")) == NULL) {
- s = getenv("HOME");
+ if ((s = getenv("HOME")) == NULL
+ && (s = getenv("USERPROFILE")) == NULL) {
+ s = getenv("SYSTEMROOT");
}
#else
if (OPENSSL_issetugid() == 0)