diff options
| author | 2014-07-16 14:26:47 +0000 | |
|---|---|---|
| committer | 2014-07-16 14:26:47 +0000 | |
| commit | 912a9ab18d01975be4672a32e257dd6d67a025dd (patch) | |
| tree | 81bcd60cef85ffa11fdebe9a5983077c8b404482 /lib/libcrypto/crypto/getentropy_linux.c | |
| parent | no more html/milter; (diff) | |
| download | wireguard-openbsd-912a9ab18d01975be4672a32e257dd6d67a025dd.tar.xz wireguard-openbsd-912a9ab18d01975be4672a32e257dd6d67a025dd.zip | |
Only call getauxval(3) if HAVE_GETAUXVAL is defined. Fixes build on older
Linux (such as Ubuntu 12.04LTS) that don't have it yet. Seems the AT_XXX
defines are pulled in by <link.h> now.
ok beck@
Diffstat (limited to 'lib/libcrypto/crypto/getentropy_linux.c')
| -rw-r--r-- | lib/libcrypto/crypto/getentropy_linux.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libcrypto/crypto/getentropy_linux.c b/lib/libcrypto/crypto/getentropy_linux.c index 40ea8a14adb..d5d36da1c5f 100644 --- a/lib/libcrypto/crypto/getentropy_linux.c +++ b/lib/libcrypto/crypto/getentropy_linux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getentropy_linux.c,v 1.24 2014/07/13 13:37:38 deraadt Exp $ */ +/* $OpenBSD: getentropy_linux.c,v 1.25 2014/07/16 14:26:47 kettenis Exp $ */ /* * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> @@ -486,6 +486,7 @@ getentropy_fallback(void *buf, size_t len) HD(cnt); } +#ifdef HAVE_GETAUXVAL #ifdef AT_RANDOM /* Not as random as you think but we take what we are given */ p = (char *) getauxval(AT_RANDOM); @@ -502,6 +503,7 @@ getentropy_fallback(void *buf, size_t len) if (p) HD(p); #endif +#endif SHA512_Final(results, &ctx); memcpy((char *)buf + i, results, min(sizeof(results), len - i)); |
