summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-07-21 23:34:55 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-07-21 23:34:55 +0000
commit2d011926f2c09f86ef7718fc422a486c0432a45b (patch)
treee595ac2bfe51c2e1a2308c7cf30106f0abd6a21b
parent8bb3b6f7be8cde63d3a06aeed6108d53b536ef02 (diff)
protect sysctl path with SYS__sysctl instead; from enh@google, ok bcook
-rw-r--r--lib/libcrypto/crypto/getentropy_linux.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libcrypto/crypto/getentropy_linux.c b/lib/libcrypto/crypto/getentropy_linux.c
index eeaf9a4ef98..539a71af176 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.30 2014/07/21 20:19:47 guenther Exp $ */
+/* $OpenBSD: getentropy_linux.c,v 1.31 2014/07/21 23:34:54 deraadt Exp $ */
/*
* Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
@@ -76,7 +76,7 @@ int getentropy(void *buf, size_t len);
static int gotdata(char *buf, size_t len);
static int getentropy_getrandom(void *buf, size_t len);
static int getentropy_urandom(void *buf, size_t len);
-#ifdef CTL_MAXNAME
+#ifdef SYS__sysctl
static int getentropy_sysctl(void *buf, size_t len);
#endif
static int getentropy_fallback(void *buf, size_t len);
@@ -109,7 +109,7 @@ getentropy(void *buf, size_t len)
if (ret != -1)
return (ret);
-#ifdef CTL_MAXNAME
+#ifdef SYS__sysctl
/*
* Try to use sysctl CTL_KERN, KERN_RANDOM, RANDOM_UUID.
* sysctl is a failsafe API, so it guarantees a result. This
@@ -131,7 +131,7 @@ getentropy(void *buf, size_t len)
ret = getentropy_sysctl(buf, len);
if (ret != -1)
return (ret);
-#endif /* CTL_MAXNAME */
+#endif /* SYS__sysctl */
/*
* Entropy collection via /dev/urandom and sysctl have failed.
@@ -270,7 +270,7 @@ nodevrandom:
return -1;
}
-#ifdef CTL_MAXNAME
+#ifdef SYS__sysctl
static int
getentropy_sysctl(void *buf, size_t len)
{
@@ -300,7 +300,7 @@ sysctlfailed:
errno = EIO;
return -1;
}
-#endif /* CTL_MAXNAME */
+#endif /* SYS__sysctl */
static int cl[] = {
CLOCK_REALTIME,