summaryrefslogtreecommitdiffstats
path: root/src/core/random.c
Commit message (Collapse)AuthorAgeFilesLines
* [libc] Use wall clock time as seed for the (non-cryptographic) RNGMichael Brown2023-10-061-3/+5
| | | | | | | | | | | | | | | | | | | | We currently use the number of timer ticks since power-on as a seed for the non-cryptographic RNG implemented by random(). Since iPXE is often executed directly after power-on, and since the timer tick resolution is generally low, this can often result in identical seed values being used on each cold boot attempt. As of commit 41f786c ("[settings] Add "unixtime" builtin setting to expose the current time"), the current wall-clock time is always available within the default build of iPXE. Use this time instead, to introduce variability between cold boot attempts on the same host. (Note that variability between different hosts is obtained by using the MAC address as an additional seed value.) This has no effect on the separate DRBG used by cryptographic code. Suggested-by: Heiko <heik0@xs4all.nl> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Always use a non-zero seed for the (non-crypto) RNGMichael Brown2016-06-091-0/+2
| | | | | | | | | | | | | | The non-cryptographic RNG implemented by random() has the property that a seed value of zero will result in a generated sequence of all-zero values. This situation can arise if currticks() returns zero at start of day. Work around this problem by falling back to a fixed non-zero seed if necessary. This has no effect on the separate DRBG used by cryptographic code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+1
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-1/+1
| | | | | | | | | | | Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-181-0/+2
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* Modify gPXE core and drivers to work with the new timer subsystemAlexey Zaytsev2008-03-021-1/+1
| | | | Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
* Dead code removal.Michael Brown2007-07-141-1/+1
| | | | Kill off use of etherboot.h outside drivers/net.
* Warnings purge of src/coreMarty Connor2007-07-021-0/+1
|
* Split random number generation out into core/random.c, and create theMichael Brown2007-01-191-0/+38
correct prototypes for srandom(), rand() and srand().