diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2016-09-21 14:06:51 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2016-09-21 14:06:51 +0000 |
commit | 367b042cec569c0db3930321d7d637b9082a5618 (patch) | |
tree | 3856228adafbe655268dabcae6dbb8fbd309a94b /sys | |
parent | 36b0de05434f1f699b36a16d726fd5e5e5f93177 (diff) |
sysctl KERN_ARND is no longer used (in ports, it only occurs in fallback
paths of libevent). This interface was the first generation of what
eventually became getentropy(2) and arc4random(3) -- june 1997!
Ports scan by sthen, general agreement guenther
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_sysctl.c | 15 | ||||
-rw-r--r-- | sys/sys/sysctl.h | 6 |
2 files changed, 4 insertions, 17 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 95e37393942..c0d9e1eabcc 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.310 2016/09/18 14:32:54 deraadt Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.311 2016/09/21 14:06:50 deraadt Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -410,19 +410,6 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, return (sysctl_int(oldp, oldlenp, newp, newlen, &somaxconn)); case KERN_SOMINCONN: return (sysctl_int(oldp, oldlenp, newp, newlen, &sominconn)); - case KERN_ARND: { - char buf[512]; - - if (*oldlenp > sizeof(buf)) - return (EINVAL); - if (oldp) { - arc4random_buf(buf, *oldlenp); - if ((error = copyout(buf, oldp, *oldlenp))) - return (error); - explicit_bzero(buf, sizeof(buf)); - } - return (0); - } case KERN_NOSUIDCOREDUMP: return (sysctl_int(oldp, oldlenp, newp, newlen, &nosuidcoredump)); case KERN_FSYNC: diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 5ed11410e38..506c6908cad 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.h,v 1.165 2016/09/07 17:30:12 natano Exp $ */ +/* $OpenBSD: sysctl.h,v 1.166 2016/09/21 14:06:50 deraadt Exp $ */ /* $NetBSD: sysctl.h,v 1.16 1996/04/09 20:55:36 cgd Exp $ */ /* @@ -137,7 +137,7 @@ struct ctlname { #define KERN_SYSVMSG 34 /* int: SysV message queue suppoprt */ #define KERN_SYSVSEM 35 /* int: SysV semaphore support */ #define KERN_SYSVSHM 36 /* int: SysV shared memory support */ -#define KERN_ARND 37 /* int: random integer from arc4rnd */ +/* was KERN_ARND 37 */ #define KERN_MSGBUFSIZE 38 /* int: size of message buffer */ #define KERN_MALLOCSTATS 39 /* node: malloc statistics */ #define KERN_CPTIME 40 /* array: cp_time */ @@ -218,7 +218,7 @@ struct ctlname { { "somaxconn", CTLTYPE_INT }, \ { "sominconn", CTLTYPE_INT }, \ { "gap", 0 }, \ - { "random", CTLTYPE_STRUCT }, \ + { "gap", 0 }, \ { "nosuidcoredump", CTLTYPE_INT }, \ { "fsync", CTLTYPE_INT }, \ { "sysvmsg", CTLTYPE_INT }, \ |