random: Fix random_get_bytes() with CONFIG_FIPS=y

The bytes pointer was not reset back to the beginning of the buffer when
mixing in additional entropy from the crypto module. This resulted in
writing beyond the return buffer and not getting the required mixing of
the extra entropy for the actual return buffer.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-08-01 17:40:25 +03:00
parent 3b86d77bae
commit f413eb03d9

View File

@ -181,6 +181,7 @@ int random_get_bytes(void *buf, size_t len)
#ifdef CONFIG_FIPS
/* Mix in additional entropy from the crypto module */
bytes = buf;
left = len;
while (left) {
size_t siz, i;