]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
random: Fix random_get_bytes() with CONFIG_FIPS=y
authorJouni Malinen <j@w1.fi>
Sat, 1 Aug 2015 14:40:25 +0000 (17:40 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 1 Aug 2015 18:08:11 +0000 (21:08 +0300)
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>
src/crypto/random.c

index bc758aa572327eda561749224abe0bf4d00438fe..3a86a93a46a8bbe56fbc0fd5681fe1827af0fd2f 100644 (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;