From 396b29c74e54981f16df7b5f069c4833779c4461 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 22:52:18 +0000 Subject: [PATCH] Clear some more places with potentially sensitive data. MFC after: 1 week --- sys/geom/eli/g_eli_crypto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/geom/eli/g_eli_crypto.c b/sys/geom/eli/g_eli_crypto.c index 8cf9ec10c508..e7217a1342a8 100644 --- a/sys/geom/eli/g_eli_crypto.c +++ b/sys/geom/eli/g_eli_crypto.c @@ -288,10 +288,12 @@ g_eli_crypto_hmac_final(struct hmac_ctx *ctx, uint8_t *md, size_t mdsize) bzero(ctx, sizeof(*ctx)); SHA512_Update(&lctx, digest, sizeof(digest)); SHA512_Final(digest, &lctx); + bzero(&lctx, sizeof(lctx)); /* mdsize == 0 means "Give me the whole hash!" */ if (mdsize == 0) mdsize = SHA512_MDLEN; bcopy(digest, md, mdsize); + bzero(digest, sizeof(digest)); } void