diff options
-rw-r--r-- | src/lib/libcrypto/arc4random/getentropy_aix.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/arc4random/getentropy_hpux.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/arc4random/getentropy_linux.c | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/arc4random/getentropy_osx.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/arc4random/getentropy_solaris.c | 8 |
5 files changed, 21 insertions, 21 deletions
diff --git a/src/lib/libcrypto/arc4random/getentropy_aix.c b/src/lib/libcrypto/arc4random/getentropy_aix.c index bd8818f264..422e685dd8 100644 --- a/src/lib/libcrypto/arc4random/getentropy_aix.c +++ b/src/lib/libcrypto/arc4random/getentropy_aix.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getentropy_aix.c,v 1.6 2018/11/20 08:04:28 deraadt Exp $ */ | 1 | /* $OpenBSD: getentropy_aix.c,v 1.7 2020/05/17 14:44:20 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2015 Michael Felt <aixtools@gmail.com> | 4 | * Copyright (c) 2015 Michael Felt <aixtools@gmail.com> |
@@ -44,7 +44,7 @@ | |||
44 | #include <libperfstat.h> | 44 | #include <libperfstat.h> |
45 | 45 | ||
46 | #define REPEAT 5 | 46 | #define REPEAT 5 |
47 | #define min(a, b) (((a) < (b)) ? (a) : (b)) | 47 | #define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) |
48 | 48 | ||
49 | #define HX(a, b) \ | 49 | #define HX(a, b) \ |
50 | do { \ | 50 | do { \ |
@@ -392,8 +392,8 @@ getentropy_fallback(void *buf, size_t len) | |||
392 | HD(cnt); | 392 | HD(cnt); |
393 | } | 393 | } |
394 | SHA512_Final(results, &ctx); | 394 | SHA512_Final(results, &ctx); |
395 | memcpy((char *)buf + i, results, min(sizeof(results), len - i)); | 395 | memcpy((char *)buf + i, results, MINIMUM(sizeof(results), len - i)); |
396 | i += min(sizeof(results), len - i); | 396 | i += MINIMUM(sizeof(results), len - i); |
397 | } | 397 | } |
398 | explicit_bzero(&ctx, sizeof ctx); | 398 | explicit_bzero(&ctx, sizeof ctx); |
399 | explicit_bzero(results, sizeof results); | 399 | explicit_bzero(results, sizeof results); |
diff --git a/src/lib/libcrypto/arc4random/getentropy_hpux.c b/src/lib/libcrypto/arc4random/getentropy_hpux.c index 7208aa44c4..c981880aad 100644 --- a/src/lib/libcrypto/arc4random/getentropy_hpux.c +++ b/src/lib/libcrypto/arc4random/getentropy_hpux.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getentropy_hpux.c,v 1.6 2018/11/20 08:04:28 deraadt Exp $ */ | 1 | /* $OpenBSD: getentropy_hpux.c,v 1.7 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> |
@@ -48,7 +48,7 @@ | |||
48 | #include <sys/pstat.h> | 48 | #include <sys/pstat.h> |
49 | 49 | ||
50 | #define REPEAT 5 | 50 | #define REPEAT 5 |
51 | #define min(a, b) (((a) < (b)) ? (a) : (b)) | 51 | #define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) |
52 | 52 | ||
53 | #define HX(a, b) \ | 53 | #define HX(a, b) \ |
54 | do { \ | 54 | do { \ |
@@ -386,8 +386,8 @@ getentropy_fallback(void *buf, size_t len) | |||
386 | HD(cnt); | 386 | HD(cnt); |
387 | } | 387 | } |
388 | SHA512_Final(results, &ctx); | 388 | SHA512_Final(results, &ctx); |
389 | memcpy((char *)buf + i, results, min(sizeof(results), len - i)); | 389 | memcpy((char *)buf + i, results, MINIMUM(sizeof(results), len - i)); |
390 | i += min(sizeof(results), len - i); | 390 | i += MINIMUM(sizeof(results), len - i); |
391 | } | 391 | } |
392 | explicit_bzero(&ctx, sizeof ctx); | 392 | explicit_bzero(&ctx, sizeof ctx); |
393 | explicit_bzero(results, sizeof results); | 393 | explicit_bzero(results, sizeof results); |
diff --git a/src/lib/libcrypto/arc4random/getentropy_linux.c b/src/lib/libcrypto/arc4random/getentropy_linux.c index 6b220be311..bc7a6bef7b 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.46 2018/11/20 08:04:28 deraadt Exp $ */ | 1 | /* $OpenBSD: getentropy_linux.c,v 1.47 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> |
@@ -57,7 +57,7 @@ | |||
57 | #include <sys/vfs.h> | 57 | #include <sys/vfs.h> |
58 | 58 | ||
59 | #define REPEAT 5 | 59 | #define REPEAT 5 |
60 | #define min(a, b) (((a) < (b)) ? (a) : (b)) | 60 | #define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) |
61 | 61 | ||
62 | #define HX(a, b) \ | 62 | #define HX(a, b) \ |
63 | do { \ | 63 | do { \ |
@@ -260,7 +260,7 @@ getentropy_sysctl(void *buf, size_t len) | |||
260 | int save_errno = errno; | 260 | int save_errno = errno; |
261 | 261 | ||
262 | for (i = 0; i < len; ) { | 262 | for (i = 0; i < len; ) { |
263 | size_t chunk = min(len - i, 16); | 263 | size_t chunk = MINIMUM(len - i, 16); |
264 | 264 | ||
265 | /* SYS__sysctl because some systems already removed sysctl() */ | 265 | /* SYS__sysctl because some systems already removed sysctl() */ |
266 | struct __sysctl_args args = { | 266 | struct __sysctl_args args = { |
@@ -515,8 +515,8 @@ getentropy_fallback(void *buf, size_t len) | |||
515 | #endif | 515 | #endif |
516 | 516 | ||
517 | SHA512_Final(results, &ctx); | 517 | SHA512_Final(results, &ctx); |
518 | memcpy((char *)buf + i, results, min(sizeof(results), len - i)); | 518 | memcpy((char *)buf + i, results, MINIMUM(sizeof(results), len - i)); |
519 | i += min(sizeof(results), len - i); | 519 | i += MINIMUM(sizeof(results), len - i); |
520 | } | 520 | } |
521 | explicit_bzero(&ctx, sizeof ctx); | 521 | explicit_bzero(&ctx, sizeof ctx); |
522 | explicit_bzero(results, sizeof results); | 522 | explicit_bzero(results, sizeof results); |
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); |
diff --git a/src/lib/libcrypto/arc4random/getentropy_solaris.c b/src/lib/libcrypto/arc4random/getentropy_solaris.c index b80c84de9e..cf5b9bffa6 100644 --- a/src/lib/libcrypto/arc4random/getentropy_solaris.c +++ b/src/lib/libcrypto/arc4random/getentropy_solaris.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getentropy_solaris.c,v 1.13 2018/11/20 08:04:28 deraadt Exp $ */ | 1 | /* $OpenBSD: getentropy_solaris.c,v 1.14 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> |
@@ -52,7 +52,7 @@ | |||
52 | #include <sys/loadavg.h> | 52 | #include <sys/loadavg.h> |
53 | 53 | ||
54 | #define REPEAT 5 | 54 | #define REPEAT 5 |
55 | #define min(a, b) (((a) < (b)) ? (a) : (b)) | 55 | #define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) |
56 | 56 | ||
57 | #define HX(a, b) \ | 57 | #define HX(a, b) \ |
58 | do { \ | 58 | do { \ |
@@ -412,8 +412,8 @@ getentropy_fallback(void *buf, size_t len) | |||
412 | HD(cnt); | 412 | HD(cnt); |
413 | } | 413 | } |
414 | SHA512_Final(results, &ctx); | 414 | SHA512_Final(results, &ctx); |
415 | memcpy((char *)buf + i, results, min(sizeof(results), len - i)); | 415 | memcpy((char *)buf + i, results, MINIMUM(sizeof(results), len - i)); |
416 | i += min(sizeof(results), len - i); | 416 | i += MINIMUM(sizeof(results), len - i); |
417 | } | 417 | } |
418 | explicit_bzero(&ctx, sizeof ctx); | 418 | explicit_bzero(&ctx, sizeof ctx); |
419 | explicit_bzero(results, sizeof results); | 419 | explicit_bzero(results, sizeof results); |