From 96f9b11cf2f355d163dcf43d5135219008dfb5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Sun, 4 Apr 2021 23:17:49 +0300 Subject: [PATCH] Clear hash state object once hash is finalized --- puer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/puer.c b/puer.c index 6667953..5bec086 100644 --- a/puer.c +++ b/puer.c @@ -211,4 +211,8 @@ void finalize_hash(struct hashstate *state, unsigned char hash[32]) { for (size_t i = 0; i < 4; i++) { word2bytes(&hash[i*4 + 16], state->b[i]); } + + // Clear all of the hash state, in case there was sth important + // there + explicit_bzero(state, sizeof(struct hashstate)); }