summaryrefslogtreecommitdiffstats
path: root/cpukit/libmd/sha256c.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2018-07-20 07:01:28 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-09-08 16:14:56 +0200
commitf5ee9a0e0bdd2e8831c7d5dfeb2bdf890d76a18c (patch)
tree994c69c57a21c91ccc70abc6f6777b989dbc2705 /cpukit/libmd/sha256c.c
parentImplement SHA2-224 submode of SHA2-256 (diff)
downloadrtems-f5ee9a0e0bdd2e8831c7d5dfeb2bdf890d76a18c.tar.bz2
libmd: Always erase context in _Final method,
and when doing it, consistently use explicit_bzero(). Update manual pages to match the behavior. Reviewed by: pfg, allanjude, jmg MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D16316
Diffstat (limited to 'cpukit/libmd/sha256c.c')
-rw-r--r--cpukit/libmd/sha256c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpukit/libmd/sha256c.c b/cpukit/libmd/sha256c.c
index 7fd568a2ab..563f9e2099 100644
--- a/cpukit/libmd/sha256c.c
+++ b/cpukit/libmd/sha256c.c
@@ -295,7 +295,7 @@ SHA256_Final(unsigned char digest[static SHA256_DIGEST_LENGTH], SHA256_CTX *ctx)
be32enc_vect(digest, ctx->state, SHA256_DIGEST_LENGTH);
/* Clear the context state */
- memset(ctx, 0, sizeof(*ctx));
+ explicit_bzero(ctx, sizeof(*ctx));
}
/*** SHA-224: *********************************************************/