summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/arc4random/getentropy_solaris.c
diff options
context:
space:
mode:
authorderaadt <>2020-05-17 14:44:20 +0000
committerderaadt <>2020-05-17 14:44:20 +0000
commit032a35a73bdeb0ea0007bfc5219e6c96db991681 (patch)
treef1c45f2a3256214176ebde26c9d04964fae745f8 /src/lib/libcrypto/arc4random/getentropy_solaris.c
parentce127c177d706b882344b219271b26080aea2efe (diff)
downloadopenbsd-032a35a73bdeb0ea0007bfc5219e6c96db991681.tar.gz
openbsd-032a35a73bdeb0ea0007bfc5219e6c96db991681.tar.bz2
openbsd-032a35a73bdeb0ea0007bfc5219e6c96db991681.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 'src/lib/libcrypto/arc4random/getentropy_solaris.c')
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_solaris.c8
1 files changed, 4 insertions, 4 deletions
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);