Andrey Chernov writes:
> > The usual way round this is with a flag. Set a static, volatile
> > flag, defaulting "off", and set it to "on" when the seeding has
> > happened. Then arc4random() can do the right thing, depending on
> > this flag.
>
> Ok, what about this version, is it right? libkern/arc4rand.c is not a
> module but always present in the kernel, so "arc4rand_iniseed_state"
> will be always accessible.
>
> --- dev/random/randomdev_soft.c.old   2011-09-26 07:35:48.000000000 +0400
> +++ dev/random/randomdev_soft.c       2012-01-21 01:41:37.000000000 +0400
> @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD: src/sys/dev/random/r
>  
>  #define RANDOM_FIFO_MAX      256     /* How many events to queue up */
>  
> +extern int arc4rand_iniseed_state;
> +

Should be in a header file, nad _possibly_ should be volatile. If it
works without being volatile, then OK.

The rest is OK. I've not tested it, so this is not a review, simply an
"OK" :-)

M
--
Mark R V Murray
Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open)
Pi: 132511160

_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to