From f7553a0a75f20e24c74158a42b9d5f6ff348e5a8 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Thu, 17 Feb 2022 19:45:23 +0100 Subject: [PATCH] Fix bug of not refilling after random bytes are requested. Signed-off-by: Pol Henarejos --- random.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/random.c b/random.c index 1c37d7c..1427aaa 100644 --- a/random.c +++ b/random.c @@ -49,11 +49,13 @@ void random_fini (void) /* * Return pointer to random 32-byte */ +void random_bytes_free (const uint8_t *p); const uint8_t * random_bytes_get (void) { static uint32_t return_word[RANDOM_BYTES_LENGTH/sizeof (uint32_t)]; neug_wait_full (); memcpy(return_word, random_word, sizeof(return_word)); + random_bytes_free((const uint8_t *)random_word); return (const uint8_t *)return_word; }