Maintain internal entropy pool for augmenting random number generation
authorJouni Malinen <j@w1.fi>
Tue, 23 Nov 2010 23:29:40 +0000 (01:29 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 23 Nov 2010 23:29:40 +0000 (01:29 +0200)
commitbbb921daaacccfac0e5e7085143b83fe5bf49294
treebc49f6cce1d4666cda5b35f1fb2e9cc55212a264
parente5851439e30a63e10ac98f3c32fc1c00448a22d9
Maintain internal entropy pool for augmenting random number generation

By default, make hostapd and wpa_supplicant maintain an internal
entropy pool that is fed with following information:

hostapd:
- Probe Request frames (timing, RSSI)
- Association events (timing)
- SNonce from Supplicants

wpa_supplicant:
- Scan results (timing, signal/noise)
- Association events (timing)

The internal pool is used to augment the random numbers generated
with the OS mechanism (os_get_random()). While the internal
implementation is not expected to be very strong due to limited
amount of generic (non-platform specific) information to feed the
pool, this may strengthen key derivation on some devices that are
not configured to provide strong random numbers through
os_get_random() (e.g., /dev/urandom on Linux/BSD).

This new mechanism is not supposed to replace proper OS provided
random number generation mechanism. The OS mechanism needs to be
initialized properly (e.g., hw random number generator,
maintaining entropy pool over reboots, etc.) for any of the
security assumptions to hold.

If the os_get_random() is known to provide strong ramdom data (e.g., on
Linux/BSD, the board in question is known to have reliable source of
random data from /dev/urandom), the internal hostapd random pool can be
disabled. This will save some in binary size and CPU use. However, this
should only be considered for builds that are known to be used on
devices that meet the requirements described above. The internal pool
is disabled by adding CONFIG_NO_RANDOM_POOL=y to the .config file.
hostapd/Makefile
hostapd/defconfig
src/ap/drv_callbacks.c
src/ap/wpa_auth.c
src/crypto/random.c [new file with mode: 0644]
src/crypto/random.h
wpa_supplicant/Makefile
wpa_supplicant/defconfig
wpa_supplicant/events.c