From f413eb03d92cb5e119266da872de03e4c07b7f3b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 1 Aug 2015 17:40:25 +0300 Subject: [PATCH] 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 --- src/crypto/random.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/crypto/random.c b/src/crypto/random.c index bc758aa57..3a86a93a4 100644 --- a/src/crypto/random.c +++ b/src/crypto/random.c @@ -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;