diff options
author | djm <> | 2005-04-29 05:37:34 +0000 |
---|---|---|
committer | djm <> | 2005-04-29 05:37:34 +0000 |
commit | a95585a25ab25668b931a78b7543f707a3354db8 (patch) | |
tree | f9e9febf7ac0c8f5d6df761fe70fd613aac06203 /src/lib/libcrypto/rand/randfile.c | |
parent | 58c08aa241f168c84ce7cc3052454ea59a44eada (diff) | |
download | openbsd-a95585a25ab25668b931a78b7543f707a3354db8.tar.gz openbsd-a95585a25ab25668b931a78b7543f707a3354db8.tar.bz2 openbsd-a95585a25ab25668b931a78b7543f707a3354db8.zip |
import of openssl-0.9.7g; tested on platforms from alpha to zaurus, ok deraadt@
Diffstat (limited to 'src/lib/libcrypto/rand/randfile.c')
-rw-r--r-- | src/lib/libcrypto/rand/randfile.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c index f5d0843d13..c7fba496a8 100644 --- a/src/lib/libcrypto/rand/randfile.c +++ b/src/lib/libcrypto/rand/randfile.c | |||
@@ -166,6 +166,7 @@ int RAND_write_file(const char *file) | |||
166 | } | 166 | } |
167 | 167 | ||
168 | #if defined(O_CREAT) && !defined(OPENSSL_SYS_WIN32) | 168 | #if defined(O_CREAT) && !defined(OPENSSL_SYS_WIN32) |
169 | { | ||
169 | /* For some reason Win32 can't write to files created this way */ | 170 | /* For some reason Win32 can't write to files created this way */ |
170 | 171 | ||
171 | /* chmod(..., 0600) is too late to protect the file, | 172 | /* chmod(..., 0600) is too late to protect the file, |
@@ -173,6 +174,7 @@ int RAND_write_file(const char *file) | |||
173 | int fd = open(file, O_CREAT, 0600); | 174 | int fd = open(file, O_CREAT, 0600); |
174 | if (fd != -1) | 175 | if (fd != -1) |
175 | out = fdopen(fd, "wb"); | 176 | out = fdopen(fd, "wb"); |
177 | } | ||
176 | #endif | 178 | #endif |
177 | if (out == NULL) | 179 | if (out == NULL) |
178 | out = fopen(file,"wb"); | 180 | out = fopen(file,"wb"); |