Browse Source

Explicitly clear temporary stack buffer in sha1_t_prf()

The local hash[] buffer may contain parts of the derived key, so clear
it explicitly to minimize number of unnecessary copies of key material
in memory.

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 10 years ago
parent
commit
940a4dbf66
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/crypto/sha1-tprf.c

+ 2 - 0
src/crypto/sha1-tprf.c

@@ -66,5 +66,7 @@ int sha1_t_prf(const u8 *key, size_t key_len, const char *label,
 		len[0] = SHA1_MAC_LEN;
 	}
 
+	os_memset(hash, 0, SHA1_MAC_LEN);
+
 	return 0;
 }