opnsense-src/lib/libxo
Conrad Meyer c62ff2800b Deprecate sranddev(3) API
It serves no useful purpose and wasn't as popular as its equally meritless
cousin, srandomdev(3).

Setting aside the problems with rand(3) in general, the problem with this
interface is that the seed isn't shared with the caller (other than by
attacking the output of the generator, which is trivial, but not a hallmark of
pleasant API design).  The (arguable) utility of rand(3) or random(3) is as a
semi-fast simulation generator which produces consistent results from a given
seed.  These are mutually at odd.  Furthermore, sometimes people got the
mistaken impression that a high quality random seed meant a weak generator like
rand(3) or random(3) could be used for things like cryptographic key
generation.  This is absolutely not so.

The API was never part of a standard and was not widely used in tree.  Existing
in-tree uses have all been removed.

Possible replacement in out of tree codebases:

	char buf[3];
	time_t t;

	time(t);
	strftime(buf, sizeof(buf), "%S", gmtime(&t));
	srand(atoi(buf));

Relnotes:	yes
2019-12-14 08:28:10 +00:00
..
encoder Import libxo-1.3.1: 2019-11-07 18:06:44 +00:00
tests DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
add.man Import libxo-1.3.1: 2019-11-07 18:06:44 +00:00
Makefile Back out encoder compilation to unbreak HEAD. 2019-11-07 07:09:28 +00:00
Makefile.depend Update Makefile.depend files 2019-12-11 17:37:53 +00:00
xo_config.h Deprecate sranddev(3) API 2019-12-14 08:28:10 +00:00