diff options
author | 2014-07-21 23:34:54 +0000 | |
---|---|---|
committer | 2014-07-21 23:34:54 +0000 | |
commit | 6cb1baa1bbafe993ca483ba31c2485a6fcd3dd05 (patch) | |
tree | 387750ecf822c3c6f97a70d02b3b3d4da5c44c05 | |
parent | Add pthread_sigmask() and raise() to the list of async signal safe (diff) | |
download | wireguard-openbsd-6cb1baa1bbafe993ca483ba31c2485a6fcd3dd05.tar.xz wireguard-openbsd-6cb1baa1bbafe993ca483ba31c2485a6fcd3dd05.zip |
protect sysctl path with SYS__sysctl instead; from enh@google, ok bcook
-rw-r--r-- | lib/libcrypto/arc4random/getentropy_linux.c | 12 | ||||
-rw-r--r-- | lib/libcrypto/crypto/getentropy_linux.c | 12 |
2 files changed, 12 insertions, 12 deletions
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 <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, 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, |