From: deraadt Date: Mon, 21 Jul 2014 23:34:54 +0000 (+0000) Subject: protect sysctl path with SYS__sysctl instead; from enh@google, ok bcook X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6cb1baa1bbafe993ca483ba31c2485a6fcd3dd05;p=openbsd protect sysctl path with SYS__sysctl instead; from enh@google, ok bcook --- diff --git a/lib/libcrypto/arc4random/getentropy_linux.c b/lib/libcrypto/arc4random/getentropy_linux.c index eeaf9a4ef98..539a71af176 100644 --- a/lib/libcrypto/arc4random/getentropy_linux.c +++ b/lib/libcrypto/arc4random/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 @@ -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, 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 @@ -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,