From ed81f3a98bf6c5e141e84514ca7c4ccddb82bc6b Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Mon, 30 Dec 2013 15:27:34 +0000 Subject: We probably don't want to just set the first 4/8 bytes of ctx to 0 --- md5.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/md5.c b/md5.c index 999318d..3d6bbc0 100644 --- a/md5.c +++ b/md5.c @@ -134,7 +134,7 @@ void MD5Update(struct MD5Context *ctx, unsigned const char *buf, unsigned len) } /* - * Final wrapup - pad to 64-byte boundary with the bit pattern + * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ void MD5Final(unsigned char digest[16], struct MD5Context *ctx) @@ -175,7 +175,7 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx) MD5Transform(ctx->buf, (uint32_t *) 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 -- cgit v1.2.3