summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/arc4random/getentropy_solaris.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2020-05-17 14:44:20 +0000
committerderaadt <deraadt@openbsd.org>2020-05-17 14:44:20 +0000
commit557f50bebc1500345a39cc6f8881a4b155a2959b (patch)
tree817d961ac87850a8c52d6aba28cc5d44ea122508 /lib/libcrypto/arc4random/getentropy_solaris.c
parentin order for PKG_CACHE to work, skipped entries at the end should still (diff)
downloadwireguard-openbsd-557f50bebc1500345a39cc6f8881a4b155a2959b.tar.xz
wireguard-openbsd-557f50bebc1500345a39cc6f8881a4b155a2959b.zip
As done everywhere else, use a local version of MINIMUM() and avoid
conflict against a potential define min() from some other scope.
Diffstat (limited to 'lib/libcrypto/arc4random/getentropy_solaris.c')
-rw-r--r--lib/libcrypto/arc4random/getentropy_solaris.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libcrypto/arc4random/getentropy_solaris.c b/lib/libcrypto/arc4random/getentropy_solaris.c
index b80c84de9e5..cf5b9bffa67 100644
--- a/lib/libcrypto/arc4random/getentropy_solaris.c
+++ b/lib/libcrypto/arc4random/getentropy_solaris.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getentropy_solaris.c,v 1.13 2018/11/20 08:04:28 deraadt Exp $ */
+/* $OpenBSD: getentropy_solaris.c,v 1.14 2020/05/17 14:44:20 deraadt Exp $ */
/*
* Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
@@ -52,7 +52,7 @@
#include <sys/loadavg.h>
#define REPEAT 5
-#define min(a, b) (((a) < (b)) ? (a) : (b))
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
#define HX(a, b) \
do { \
@@ -412,8 +412,8 @@ getentropy_fallback(void *buf, size_t len)
HD(cnt);
}
SHA512_Final(results, &ctx);
- memcpy((char *)buf + i, results, min(sizeof(results), len - i));
- i += min(sizeof(results), len - i);
+ memcpy((char *)buf + i, results, MINIMUM(sizeof(results), len - i));
+ i += MINIMUM(sizeof(results), len - i);
}
explicit_bzero(&ctx, sizeof ctx);
explicit_bzero(results, sizeof results);