Skip to content

Commit 67939b1

Browse files
committed
Secure-clear GMAC key schedule on free
1 parent 6fbd327 commit 67939b1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/wp_gmac.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,11 @@ static wp_GmacCtx* wp_gmac_new(WOLFPROV_CTX* provCtx)
9393
static void wp_gmac_free(wp_GmacCtx* macCtx)
9494
{
9595
if (macCtx != NULL) {
96+
wc_AesFree(&macCtx->gmac.aes);
9697
OPENSSL_cleanse(macCtx->key, macCtx->keyLen);
9798
OPENSSL_cleanse(macCtx->iv, macCtx->ivLen);
9899
OPENSSL_clear_free(macCtx->data, macCtx->dataLen);
99-
OPENSSL_free(macCtx);
100+
OPENSSL_clear_free(macCtx, sizeof(*macCtx));
100101
}
101102
}
102103

0 commit comments

Comments
 (0)