Change debug to diagnostic so that more people see the lossage with bad

random streams, so we can debug it.
This commit is contained in:
christos 2014-11-19 14:25:00 +00:00
parent 971d420649
commit cced78ddd9
1 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_cprng.c,v 1.25 2014/08/14 16:28:30 riastradh Exp $ */
/* $NetBSD: subr_cprng.c,v 1.26 2014/11/19 14:25:00 christos 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.25 2014/08/14 16:28:30 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: subr_cprng.c,v 1.26 2014/11/19 14:25:00 christos Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -50,7 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: subr_cprng.c,v 1.25 2014/08/14 16:28:30 riastradh Ex
#include <sys/sysctl.h>
#include <sys/rnd.h>
#include <sys/rndsink.h>
#if DEBUG
#if DIAGNOSTIC
#include <sys/rngtest.h>
#endif
@ -67,7 +67,7 @@ static void cprng_strong_generate(struct cprng_strong *, void *, size_t);
static void cprng_strong_reseed(struct cprng_strong *);
static void cprng_strong_reseed_from(struct cprng_strong *, const void *,
size_t, bool);
#if DEBUG
#if DIAGNOSTIC
static void cprng_strong_rngtest(struct cprng_strong *);
#endif
@ -447,12 +447,12 @@ cprng_strong_reseed_from(struct cprng_strong *cprng,
/* XXX Fix nist_ctr_drbg API so this can't happen. */
panic("cprng %s: NIST CTR_DRBG reseed failed", cprng->cs_name);
#if DEBUG
#if DIAGNOSTIC
cprng_strong_rngtest(cprng);
#endif
}
#if DEBUG
#if DIAGNOSTIC
/*
* Generate some output and apply a statistical RNG test to it.
*/