aboutsummaryrefslogtreecommitdiff
path: root/lib/libmd/md5c.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2018-07-20 07:01:28 +0000
committerXin LI <delphij@FreeBSD.org>2018-07-20 07:01:28 +0000
commit66bdf50face2485fdb7164cf563cbc595370cd3e (patch)
tree1a749aadcb9dcb133d74ca9804f43846d81d5056 /lib/libmd/md5c.c
parente8177648bbac282633fa9c4f68d99da24058362c (diff)
downloadsrc-66bdf50face2485fdb7164cf563cbc595370cd3e.tar.gz
src-66bdf50face2485fdb7164cf563cbc595370cd3e.zip
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
Notes
Notes: svn path=/head/; revision=336539
Diffstat (limited to 'lib/libmd/md5c.c')
-rw-r--r--lib/libmd/md5c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libmd/md5c.c b/lib/libmd/md5c.c
index a2c71b6a6960..fc852b913464 100644
--- a/lib/libmd/md5c.c
+++ b/lib/libmd/md5c.c
@@ -220,7 +220,7 @@ MD5Final (unsigned char digest[16], MD5_CTX *context)
Encode (digest, context->state, 16);
/* Zeroize sensitive information. */
- memset ((void *)context, 0, sizeof (*context));
+ explicit_bzero(context, sizeof(*context));
}
/* MD5 basic transformation. Transforms state based on block. */