diff options
Diffstat (limited to 'src/lib/libcrypto/arc4random/getentropy_osx.c')
-rw-r--r-- | src/lib/libcrypto/arc4random/getentropy_osx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/arc4random/getentropy_osx.c b/src/lib/libcrypto/arc4random/getentropy_osx.c index 26dcc824de..5d4067bb8e 100644 --- a/src/lib/libcrypto/arc4random/getentropy_osx.c +++ b/src/lib/libcrypto/arc4random/getentropy_osx.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getentropy_osx.c,v 1.12 2018/11/20 08:04:28 deraadt Exp $ */ | 1 | /* $OpenBSD: getentropy_osx.c,v 1.13 2020/05/17 14:44:20 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> |
@@ -66,7 +66,7 @@ | |||
66 | #define SHA512_DIGEST_LENGTH CC_SHA512_DIGEST_LENGTH | 66 | #define SHA512_DIGEST_LENGTH CC_SHA512_DIGEST_LENGTH |
67 | 67 | ||
68 | #define REPEAT 5 | 68 | #define REPEAT 5 |
69 | #define min(a, b) (((a) < (b)) ? (a) : (b)) | 69 | #define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) |
70 | 70 | ||
71 | #define HX(a, b) \ | 71 | #define HX(a, b) \ |
72 | do { \ | 72 | do { \ |
@@ -407,8 +407,8 @@ getentropy_fallback(void *buf, size_t len) | |||
407 | } | 407 | } |
408 | 408 | ||
409 | SHA512_Final(results, &ctx); | 409 | SHA512_Final(results, &ctx); |
410 | memcpy((char *)buf + i, results, min(sizeof(results), len - i)); | 410 | memcpy((char *)buf + i, results, MINIMUM(sizeof(results), len - i)); |
411 | i += min(sizeof(results), len - i); | 411 | i += MINIMUM(sizeof(results), len - i); |
412 | } | 412 | } |
413 | explicit_bzero(&ctx, sizeof ctx); | 413 | explicit_bzero(&ctx, sizeof ctx); |
414 | explicit_bzero(results, sizeof results); | 414 | explicit_bzero(results, sizeof results); |