[linux-pam] Clear the whole MD5 context.
by Tomáš Mráz
commit 7698a76cf4983fe69944a810305183f1fe6cc031
Author: Tomas Mraz <tmraz(a)fedoraproject.org>
Date: Mon Mar 21 22:02:16 2011 +0100
Clear the whole MD5 context.
ChangeLog | 3 +++
modules/pam_unix/md5.c | 2 +-
2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2431818..04072c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2011-03-21 Tomas Mraz <tm(a)t8m.info>
+ * modules/pam_unix/md5.c (MD5Final): Clear the whole ctx.
+
2011-03-18 Tomas Mraz <tm(a)t8m.info>
* modules/pam_namespace/md5.c (MD5Final): Clear the whole ctx.
diff --git a/modules/pam_unix/md5.c b/modules/pam_unix/md5.c
index d88d681..94d1c9d 100644
--- a/modules/pam_unix/md5.c
+++ b/modules/pam_unix/md5.c
@@ -148,7 +148,7 @@ void MD5Name(MD5Final)(unsigned char digest[16], struct MD5Context *ctx)
MD5Name(MD5Transform)(ctx->buf, (uint32 *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4);
memcpy(digest, ctx->buf, 16);
- memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
+ memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
}
#ifndef ASM_MD5
13 years, 1 month