summaryrefslogtreecommitdiff
path: root/md5.c
diff options
context:
space:
mode:
authorTimo Weingärtner <timo@tiwe.de>2013-05-11 19:34:44 +0200
committerTimo Weingärtner <timo@tiwe.de>2013-05-12 18:44:18 +0200
commit495461432ca4034d49ee37cb398c6bd253d6f66d (patch)
tree64c1842a9ec7ba47859213cefb6957c4b72ee31b /md5.c
parentbe53f76279d158aa3e5fb2960f9ae4da52201857 (diff)
downloadlibpam-pwdfile-495461432ca4034d49ee37cb398c6bd253d6f66d.tar.gz
md5.c: fix compiler warnings
Diffstat (limited to 'md5.c')
-rw-r--r--md5.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/md5.c b/md5.c
index 2bc558e..3565e55 100644
--- a/md5.c
+++ b/md5.c
@@ -130,13 +130,12 @@ void MD5Name(MD5Final)(unsigned char digest[16], struct MD5Context *ctx)
byteReverse(ctx->in, 14);
/* Append length in bits and transform */
- ((uint32_t *) ctx->in)[14] = ctx->bits[0];
- ((uint32_t *) ctx->in)[15] = ctx->bits[1];
+ memcpy(ctx->in + 56, ctx->bits, 8);
MD5Name(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 */
}
/* The four core functions - F1 is optimized somewhat */