summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2014-05-27 14:55:09 +0000
committermarius <marius@FreeBSD.org>2014-05-27 14:55:09 +0000
commitd22760cc9071ae70622e2c29141ee76e73170a16 (patch)
tree909ff1775fac00c99cee3526efbf165081c7b1f5 /sys/geom
parent3f0849d666fad6ab2729def6c52b04b889e3d20d (diff)
downloadFreeBSD-src-d22760cc9071ae70622e2c29141ee76e73170a16.zip
FreeBSD-src-d22760cc9071ae70622e2c29141ee76e73170a16.tar.gz
MFC: r259428
Clear content of keyfiles loaded by the loader after processing them. MFC: r259429 Clear some more places with potentially sensitive data.
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/eli/g_eli.c1
-rw-r--r--sys/geom/eli/g_eli_crypto.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c
index 2d21ab3b..e0d0074 100644
--- a/sys/geom/eli/g_eli.c
+++ b/sys/geom/eli/g_eli.c
@@ -990,6 +990,7 @@ g_eli_keyfiles_load(struct hmac_ctx *ctx, const char *provider)
G_ELI_DEBUG(1, "Loaded keyfile %s for %s (type: %s).", file,
provider, name);
g_eli_crypto_hmac_update(ctx, data, size);
+ bzero(data, size);
}
}
diff --git a/sys/geom/eli/g_eli_crypto.c b/sys/geom/eli/g_eli_crypto.c
index 91c36ec..9b42097 100644
--- a/sys/geom/eli/g_eli_crypto.c
+++ b/sys/geom/eli/g_eli_crypto.c
@@ -289,10 +289,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
OpenPOWER on IntegriCloud