diff options
author | djm <> | 2005-04-29 05:39:33 +0000 |
---|---|---|
committer | djm <> | 2005-04-29 05:39:33 +0000 |
commit | 68edd00d9258df93b1366c71ac124e0cadf7bc08 (patch) | |
tree | 3ce4ae2a9747bbc11aed1f95f9bbea92c41f8683 /src/lib/libcrypto/rand/rand_egd.c | |
parent | f396ed0f5ce0af56bfde2e75e15cf1f52924c779 (diff) | |
download | openbsd-68edd00d9258df93b1366c71ac124e0cadf7bc08.tar.gz openbsd-68edd00d9258df93b1366c71ac124e0cadf7bc08.tar.bz2 openbsd-68edd00d9258df93b1366c71ac124e0cadf7bc08.zip |
resolve conflicts
Diffstat (limited to 'src/lib/libcrypto/rand/rand_egd.c')
-rw-r--r-- | src/lib/libcrypto/rand/rand_egd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/libcrypto/rand/rand_egd.c b/src/lib/libcrypto/rand/rand_egd.c index 6f742900a0..cd666abfcb 100644 --- a/src/lib/libcrypto/rand/rand_egd.c +++ b/src/lib/libcrypto/rand/rand_egd.c | |||
@@ -95,7 +95,7 @@ | |||
95 | * RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255. | 95 | * RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255. |
96 | */ | 96 | */ |
97 | 97 | ||
98 | #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) | 98 | #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_VOS) |
99 | int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes) | 99 | int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes) |
100 | { | 100 | { |
101 | return(-1); | 101 | return(-1); |
@@ -216,7 +216,9 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes) | |||
216 | while (numbytes != 1) | 216 | while (numbytes != 1) |
217 | { | 217 | { |
218 | num = read(fd, egdbuf, 1); | 218 | num = read(fd, egdbuf, 1); |
219 | if (num >= 0) | 219 | if (num == 0) |
220 | goto err; /* descriptor closed */ | ||
221 | else if (num > 0) | ||
220 | numbytes += num; | 222 | numbytes += num; |
221 | else | 223 | else |
222 | { | 224 | { |
@@ -246,7 +248,9 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes) | |||
246 | while (numbytes != egdbuf[0]) | 248 | while (numbytes != egdbuf[0]) |
247 | { | 249 | { |
248 | num = read(fd, retrievebuf + numbytes, egdbuf[0] - numbytes); | 250 | num = read(fd, retrievebuf + numbytes, egdbuf[0] - numbytes); |
249 | if (num >= 0) | 251 | if (num == 0) |
252 | goto err; /* descriptor closed */ | ||
253 | else if (num > 0) | ||
250 | numbytes += num; | 254 | numbytes += num; |
251 | else | 255 | else |
252 | { | 256 | { |