diff options
Diffstat (limited to 'src/lib/libcrypto/crypto/getentropy_solaris.c')
| -rw-r--r-- | src/lib/libcrypto/crypto/getentropy_solaris.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/crypto/getentropy_solaris.c b/src/lib/libcrypto/crypto/getentropy_solaris.c index 13afe7e3c9..83cc30aac2 100644 --- a/src/lib/libcrypto/crypto/getentropy_solaris.c +++ b/src/lib/libcrypto/crypto/getentropy_solaris.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: getentropy_solaris.c,v 1.2 2014/07/12 13:19:44 beck Exp $ */ | 1 | /* $OpenBSD: getentropy_solaris.c,v 1.3 2014/07/12 14:46:31 deraadt Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> | 4 | * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> |
| @@ -43,7 +43,6 @@ | |||
| 43 | #define SHA512_Update SHA512Update | 43 | #define SHA512_Update SHA512Update |
| 44 | #define SHA512_Final SHA512Final | 44 | #define SHA512_Final SHA512Final |
| 45 | 45 | ||
| 46 | |||
| 47 | #include <sys/vfs.h> | 46 | #include <sys/vfs.h> |
| 48 | #include <sys/statfs.h> | 47 | #include <sys/statfs.h> |
| 49 | #include <sys/loadavg.h> | 48 | #include <sys/loadavg.h> |
| @@ -81,7 +80,7 @@ getentropy(void *buf, size_t len) | |||
| 81 | } | 80 | } |
| 82 | 81 | ||
| 83 | /* | 82 | /* |
| 84 | * Try to get entropy with /dev/urandom... | 83 | * Try to get entropy with /dev/urandom |
| 85 | * | 84 | * |
| 86 | * Solaris provides /dev/urandom as a symbolic link to | 85 | * Solaris provides /dev/urandom as a symbolic link to |
| 87 | * /devices/pseudo/random@0:urandom which is provided by | 86 | * /devices/pseudo/random@0:urandom which is provided by |
| @@ -132,8 +131,8 @@ getentropy(void *buf, size_t len) | |||
| 132 | * providing a new failsafe API which works in a chroot or | 131 | * providing a new failsafe API which works in a chroot or |
| 133 | * when file descriptors are exhausted. | 132 | * when file descriptors are exhausted. |
| 134 | */ | 133 | */ |
| 135 | #undef FAIL_WHEN_SYSTEM_ENTROPY_FAILS | 134 | #undef FAIL_INSTEAD_OF_TRYING_FALLBACK |
| 136 | #ifdef FAIL_WHEN_SYSTEM_ENTROPY_FAILS | 135 | #ifdef FAIL_INSTEAD_OF_TRYING_FALLBACK |
| 137 | raise(SIGKILL); | 136 | raise(SIGKILL); |
| 138 | #endif | 137 | #endif |
| 139 | ret = getentropy_fallback(buf, len); | 138 | ret = getentropy_fallback(buf, len); |
| @@ -215,7 +214,7 @@ nodevrandom: | |||
| 215 | return -1; | 214 | return -1; |
| 216 | } | 215 | } |
| 217 | 216 | ||
| 218 | static int cl[] = { | 217 | static const int cl[] = { |
| 219 | CLOCK_REALTIME, | 218 | CLOCK_REALTIME, |
| 220 | #ifdef CLOCK_MONOTONIC | 219 | #ifdef CLOCK_MONOTONIC |
| 221 | CLOCK_MONOTONIC, | 220 | CLOCK_MONOTONIC, |
| @@ -279,6 +278,7 @@ getentropy_fallback(void *buf, size_t len) | |||
| 279 | 278 | ||
| 280 | for (ii = 0; ii < sizeof(cl)/sizeof(cl[0]); ii++) | 279 | for (ii = 0; ii < sizeof(cl)/sizeof(cl[0]); ii++) |
| 281 | HX(clock_gettime(cl[ii], &ts) == -1, ts); | 280 | HX(clock_gettime(cl[ii], &ts) == -1, ts); |
| 281 | |||
| 282 | HX((pid = getpid()) == -1, pid); | 282 | HX((pid = getpid()) == -1, pid); |
| 283 | HX((pid = getsid(pid)) == -1, pid); | 283 | HX((pid = getsid(pid)) == -1, pid); |
| 284 | HX((pid = getppid()) == -1, pid); | 284 | HX((pid = getppid()) == -1, pid); |
