Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netkey warn about the arc4 generator if no NRND, but sti...
details: https://anonhg.NetBSD.org/src/rev/922caf04c38f
branches: trunk
changeset: 537867:922caf04c38f
user: dan <dan%NetBSD.org@localhost>
date: Mon Oct 07 00:40:15 2002 +0000
description:
warn about the arc4 generator if no NRND, but still use it
diffstat:
sys/netkey/key.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diffs (36 lines):
diff -r 900e4233f9fa -r 922caf04c38f sys/netkey/key.c
--- a/sys/netkey/key.c Mon Oct 07 00:12:40 2002 +0000
+++ b/sys/netkey/key.c Mon Oct 07 00:40:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: key.c,v 1.78 2002/10/06 08:51:46 tls Exp $ */
+/* $NetBSD: key.c,v 1.79 2002/10/07 00:40:15 dan Exp $ */
/* $KAME: key.c,v 1.249 2002/06/14 14:46:22 itojun Exp $ */
/*
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.78 2002/10/06 08:51:46 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.79 2002/10/07 00:40:15 dan Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -4251,12 +4251,13 @@
void *p;
size_t l;
{
+#if NRND == 0
static int warn = 1;
-
-#if NRND > 0
+#endif
+
arc4randbytes(p, l);
- warn = 0;
-#else
+
+#if NRND == 0
/* the arc4 generator is keyed with junk. */
if (warn) {
printf("WARNING: pseudo-random number generator "
Home |
Main Index |
Thread Index |
Old Index