summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/arc4random/getentropy_hpux.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_hpux.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_hpux.c')
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_hpux.c8
1 files changed, 4 insertions, 4 deletions
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);