summaryrefslogtreecommitdiff
path: root/modules/pam_unix/md5.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_unix/md5.c')
-rw-r--r--modules/pam_unix/md5.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/pam_unix/md5.c b/modules/pam_unix/md5.c
index 94d1c9d..94f0485 100644
--- a/modules/pam_unix/md5.c
+++ b/modules/pam_unix/md5.c
@@ -107,7 +107,7 @@ void MD5Name(MD5Update)(struct MD5Context *ctx, unsigned const char *buf, unsign
}
/*
- * 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 MD5Name(MD5Final)(unsigned char digest[16], struct MD5Context *ctx)
@@ -142,8 +142,7 @@ void MD5Name(MD5Final)(unsigned char digest[16], struct MD5Context *ctx)
byteReverse(ctx->in, 14);
/* Append length in bits and transform */
- ((uint32 *) ctx->in)[14] = ctx->bits[0];
- ((uint32 *) ctx->in)[15] = ctx->bits[1];
+ memcpy((uint32 *)ctx->in + 14, ctx->bits, 2*sizeof(uint32));
MD5Name(MD5Transform)(ctx->buf, (uint32 *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4);