From owner-svn-src-all@FreeBSD.ORG Sat Sep 7 22:07:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C3A3FEFB; Sat, 7 Sep 2013 22:07:37 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A25EC27CA; Sat, 7 Sep 2013 22:07:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r87M7b7f020356; Sat, 7 Sep 2013 22:07:37 GMT (envelope-from markm@svn.freebsd.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r87M7aEI020346; Sat, 7 Sep 2013 22:07:36 GMT (envelope-from markm@svn.freebsd.org) Message-Id: <201309072207.r87M7aEI020346@svn.freebsd.org> From: Mark Murray Date: Sat, 7 Sep 2013 22:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255379 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Sep 2013 22:07:37 -0000 Author: markm Date: Sat Sep 7 22:07:36 2013 New Revision: 255379 URL: http://svnweb.freebsd.org/changeset/base/255379 Log: Fix the build; Certain linkable symbols need to always be present. Pass the pointy hat please. Also unblock the software (Yarrow) generator for now. This will be reverted; Yarrow needs to block until secure, not this behaviour of serving as soon as asked. Folks with specific requiremnts will be able to (can!) unblock this device with any write, and are encouraged to do so in /etc/rc.d/* scripting. ("Any" in this case could be "echo '' > /dev/random" as root). Modified: head/sys/dev/random/pseudo_rng.c head/sys/dev/random/random_adaptors.c head/sys/dev/random/random_adaptors.h head/sys/dev/random/randomdev.c head/sys/dev/random/randomdev.h head/sys/dev/random/randomdev_soft.c Modified: head/sys/dev/random/pseudo_rng.c ============================================================================== --- head/sys/dev/random/pseudo_rng.c Sat Sep 7 20:52:31 2013 (r255378) +++ head/sys/dev/random/pseudo_rng.c Sat Sep 7 22:07:36 2013 (r255379) @@ -39,6 +39,12 @@ __FBSDID("$FreeBSD$"); static struct mtx pseudo_random_block_mtx; +/* Used to fake out unused random calls in random_adaptor */ +void +random_null_func(void) +{ +} + static int pseudo_random_block_read(void *buf __unused, int c __unused) { Modified: head/sys/dev/random/random_adaptors.c ============================================================================== --- head/sys/dev/random/random_adaptors.c Sat Sep 7 20:52:31 2013 (r255378) +++ head/sys/dev/random/random_adaptors.c Sat Sep 7 22:07:36 2013 (r255379) @@ -53,6 +53,8 @@ static struct sx adaptors_lock; /* need /* List for the dynamic sysctls */ static struct sysctl_ctx_list random_clist; +struct random_adaptor *random_adaptor; + MALLOC_DEFINE(M_RANDOM_ADAPTORS, "random_adaptors", "Random adaptors buffers"); int @@ -230,7 +232,7 @@ random_sysctl_active_adaptor_handler(SYS int error; name = NULL; - rsp = random_get_active_adaptor(); + rsp = random_adaptor; if (rsp != NULL) { sx_slock(&adaptors_lock); Modified: head/sys/dev/random/random_adaptors.h ============================================================================== --- head/sys/dev/random/random_adaptors.h Sat Sep 7 20:52:31 2013 (r255378) +++ head/sys/dev/random/random_adaptors.h Sat Sep 7 22:07:36 2013 (r255379) @@ -41,6 +41,8 @@ struct random_adaptor *random_adaptor_ge int random_adaptor_register(const char *, struct random_adaptor *); void random_adaptor_choose(struct random_adaptor **); +extern struct random_adaptor *random_adaptor; + /* * random_adaptor's should be registered prior to * random module (SI_SUB_DRIVERS/SI_ORDER_MIDDLE) Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Sat Sep 7 20:52:31 2013 (r255378) +++ head/sys/dev/random/randomdev.c Sat Sep 7 22:07:36 2013 (r255379) @@ -72,27 +72,12 @@ static struct cdevsw random_cdevsw = { .d_name = "random", }; -static struct random_adaptor *random_adaptor; static eventhandler_tag attach_tag; static int random_inited; - /* For use with make_dev(9)/destroy_dev(9). */ static struct cdev *random_dev; -/* Used to fake out unused random calls in random_adaptor */ -void -random_null_func(void) -{ -} - -struct random_adaptor * -random_get_active_adaptor(void) -{ - - return (random_adaptor); -} - /* ARGSUSED */ static int random_close(struct cdev *dev __unused, int flags, int fmt __unused, Modified: head/sys/dev/random/randomdev.h ============================================================================== --- head/sys/dev/random/randomdev.h Sat Sep 7 20:52:31 2013 (r255378) +++ head/sys/dev/random/randomdev.h Sat Sep 7 22:07:36 2013 (r255379) @@ -53,4 +53,3 @@ struct random_adaptor { extern void random_ident_hardware(struct random_adaptor **); extern void random_null_func(void); -struct random_adaptor *random_get_active_adaptor(void); Modified: head/sys/dev/random/randomdev_soft.c ============================================================================== --- head/sys/dev/random/randomdev_soft.c Sat Sep 7 20:52:31 2013 (r255378) +++ head/sys/dev/random/randomdev_soft.c Sat Sep 7 22:07:36 2013 (r255379) @@ -79,7 +79,7 @@ static struct random_adaptor random_cont .write = randomdev_write, .poll = randomdev_poll, .reseed = randomdev_flush_reseed, - .seeded = 0, + .seeded = 1, }; #define RANDOM_MODULE_NAME yarrow #define RANDOM_CSPRNG_NAME "yarrow" @@ -95,7 +95,7 @@ static struct random_adaptor random_cont .write = randomdev_write, .poll = randomdev_poll, .reseed = randomdev_flush_reseed, - .seeded = 0, + .seeded = 1, }; #define RANDOM_MODULE_NAME fortuna #define RANDOM_CSPRNG_NAME "fortuna"