svn commit: r339480 - head/sys/dev/random

Conrad Meyer cem at FreeBSD.org
Sat Oct 20 20:12:58 UTC 2018


Author: cem
Date: Sat Oct 20 20:12:57 2018
New Revision: 339480
URL: https://svnweb.freebsd.org/changeset/base/339480

Log:
  Fortuna: Add trivial assert to match FS&K definition
  
  FS&K GenerateBlocks function asserts C (counter) != 0.  This should also
  be true in our implementation.
  
  Reviewed by:	delphij, markm
  Approved by:	secteam (delphij)
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D16936

Modified:
  head/sys/dev/random/fortuna.c

Modified: head/sys/dev/random/fortuna.c
==============================================================================
--- head/sys/dev/random/fortuna.c	Sat Oct 20 19:44:59 2018	(r339479)
+++ head/sys/dev/random/fortuna.c	Sat Oct 20 20:12:57 2018	(r339480)
@@ -310,6 +310,8 @@ random_fortuna_genblocks(uint8_t *buf, u_int blockcoun
 	u_int i;
 
 	RANDOM_RESEED_ASSERT_LOCK_OWNED();
+	KASSERT(!uint128_is_zero(fortuna_state.fs_counter), ("FS&K: C != 0"));
+
 	for (i = 0; i < blockcount; i++) {
 		/*-
 		 * FS&K - r = r|E(K,C)


More information about the svn-src-head mailing list