diff options
author | beck <> | 2014-07-08 09:30:33 +0000 |
---|---|---|
committer | beck <> | 2014-07-08 09:30:33 +0000 |
commit | e2a83e54c743c528a062afe53b135babd1c61473 (patch) | |
tree | 992ce9e45993c354141e13410699745d5f1f00bb | |
parent | 100d51416eeb76c9a7b601ab46f0919cf6408315 (diff) | |
download | openbsd-e2a83e54c743c528a062afe53b135babd1c61473.tar.gz openbsd-e2a83e54c743c528a062afe53b135babd1c61473.tar.bz2 openbsd-e2a83e54c743c528a062afe53b135babd1c61473.zip |
j should be an int, like repeat
-rw-r--r-- | src/lib/libcrypto/arc4random/getentropy_linux.c | 7 | ||||
-rw-r--r-- | src/lib/libcrypto/crypto/getentropy_linux.c | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/libcrypto/arc4random/getentropy_linux.c b/src/lib/libcrypto/arc4random/getentropy_linux.c index a76604fe77..578c65bbe4 100644 --- a/src/lib/libcrypto/arc4random/getentropy_linux.c +++ b/src/lib/libcrypto/arc4random/getentropy_linux.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getentropy_linux.c,v 1.16 2014/07/08 09:24:27 beck Exp $ */ | 1 | /* $OpenBSD: getentropy_linux.c,v 1.17 2014/07/08 09:30:33 beck 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> |
@@ -298,7 +298,7 @@ getentropy_fallback(void *buf, size_t len) | |||
298 | SHA512_CTX ctx; | 298 | SHA512_CTX ctx; |
299 | static pid_t lastpid; | 299 | static pid_t lastpid; |
300 | pid_t pid; | 300 | pid_t pid; |
301 | size_t i, j, ii; | 301 | size_t i, ii; |
302 | char *p; | 302 | char *p; |
303 | 303 | ||
304 | pid = getpid(); | 304 | pid = getpid(); |
@@ -311,12 +311,13 @@ getentropy_fallback(void *buf, size_t len) | |||
311 | repeat = REPEAT; | 311 | repeat = REPEAT; |
312 | } | 312 | } |
313 | for (i = 0; i < len; ) { | 313 | for (i = 0; i < len; ) { |
314 | int j; | ||
314 | SHA512_Init(&ctx); | 315 | SHA512_Init(&ctx); |
315 | for (j = 0; j < repeat; j++) { | 316 | for (j = 0; j < repeat; j++) { |
316 | HX((e = gettimeofday(&tv, NULL)) == -1, tv); | 317 | HX((e = gettimeofday(&tv, NULL)) == -1, tv); |
317 | if (e != -1) { | 318 | if (e != -1) { |
318 | cnt += (int)tv.tv_sec; | 319 | cnt += (int)tv.tv_sec; |
319 | cnt += (int)tv.tv_usec; | 320 | nt += (int)tv.tv_usec; |
320 | } | 321 | } |
321 | 322 | ||
322 | for (ii = 0; ii < sizeof(cl)/sizeof(cl[0]); ii++) | 323 | for (ii = 0; ii < sizeof(cl)/sizeof(cl[0]); ii++) |
diff --git a/src/lib/libcrypto/crypto/getentropy_linux.c b/src/lib/libcrypto/crypto/getentropy_linux.c index a76604fe77..578c65bbe4 100644 --- a/src/lib/libcrypto/crypto/getentropy_linux.c +++ b/src/lib/libcrypto/crypto/getentropy_linux.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getentropy_linux.c,v 1.16 2014/07/08 09:24:27 beck Exp $ */ | 1 | /* $OpenBSD: getentropy_linux.c,v 1.17 2014/07/08 09:30:33 beck 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> |
@@ -298,7 +298,7 @@ getentropy_fallback(void *buf, size_t len) | |||
298 | SHA512_CTX ctx; | 298 | SHA512_CTX ctx; |
299 | static pid_t lastpid; | 299 | static pid_t lastpid; |
300 | pid_t pid; | 300 | pid_t pid; |
301 | size_t i, j, ii; | 301 | size_t i, ii; |
302 | char *p; | 302 | char *p; |
303 | 303 | ||
304 | pid = getpid(); | 304 | pid = getpid(); |
@@ -311,12 +311,13 @@ getentropy_fallback(void *buf, size_t len) | |||
311 | repeat = REPEAT; | 311 | repeat = REPEAT; |
312 | } | 312 | } |
313 | for (i = 0; i < len; ) { | 313 | for (i = 0; i < len; ) { |
314 | int j; | ||
314 | SHA512_Init(&ctx); | 315 | SHA512_Init(&ctx); |
315 | for (j = 0; j < repeat; j++) { | 316 | for (j = 0; j < repeat; j++) { |
316 | HX((e = gettimeofday(&tv, NULL)) == -1, tv); | 317 | HX((e = gettimeofday(&tv, NULL)) == -1, tv); |
317 | if (e != -1) { | 318 | if (e != -1) { |
318 | cnt += (int)tv.tv_sec; | 319 | cnt += (int)tv.tv_sec; |
319 | cnt += (int)tv.tv_usec; | 320 | nt += (int)tv.tv_usec; |
320 | } | 321 | } |
321 | 322 | ||
322 | for (ii = 0; ii < sizeof(cl)/sizeof(cl[0]); ii++) | 323 | for (ii = 0; ii < sizeof(cl)/sizeof(cl[0]); ii++) |