Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Update comment to reflect third-party software's us...
details: https://anonhg.NetBSD.org/src/rev/52afdde9cfe9
branches: trunk
changeset: 966826:52afdde9cfe9
user: nia <nia%NetBSD.org@localhost>
date: Sun Nov 17 12:32:31 2019 +0000
description:
Update comment to reflect third-party software's usage of KERN_ARND.
Changing it as the comment suggests would be a very terrible idea due to
the common usage of this variable.
Returning only 32 or 64 bits also seems to be the purpose of KERN_URND,
so that functionality is already present.
diffstat:
sys/kern/subr_cprng.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (30 lines):
diff -r 958c81f1f414 -r 52afdde9cfe9 sys/kern/subr_cprng.c
--- a/sys/kern/subr_cprng.c Sun Nov 17 11:46:38 2019 +0000
+++ b/sys/kern/subr_cprng.c Sun Nov 17 12:32:31 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_cprng.c,v 1.31 2019/09/02 20:09:30 riastradh Exp $ */
+/* $NetBSD: subr_cprng.c,v 1.32 2019/11/17 12:32:31 nia Exp $ */
/*-
* Copyright (c) 2011-2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_cprng.c,v 1.31 2019/09/02 20:09:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_cprng.c,v 1.32 2019/11/17 12:32:31 nia Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -581,8 +581,9 @@
* requested. Evidently this was used to key RC4 in userspace.
*
* In NetBSD, the libc stack-smash-protection code reads 64 bytes
- * from here at every program startup. So though it would be nice
- * to make this node return only 32 or 64 bits, we can't. Too bad!
+ * from here at every program startup. Third-party software also often
+ * uses this to obtain a key for CSPRNG, reading 32 bytes or more, while
+ * avoiding the need to open /dev/urandom.
*/
static int
sysctl_kern_arnd(SYSCTLFN_ARGS)
Home |
Main Index |
Thread Index |
Old Index