Module Name: src
Committed By: nia
Date: Sun Nov 17 12:32:31 UTC 2019
Modified Files:
src/sys/kern: subr_cprng.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/kern/subr_cprng.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/subr_cprng.c
diff -u src/sys/kern/subr_cprng.c:1.31 src/sys/kern/subr_cprng.c:1.32
--- src/sys/kern/subr_cprng.c:1.31 Mon Sep 2 20:09:30 2019
+++ src/sys/kern/subr_cprng.c Sun Nov 17 12:32:31 2019
@@ -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 @@ sysctl_kern_urnd(SYSCTLFN_ARGS)
* 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)