summaryrefslogtreecommitdiff
path: root/modules/pam_unix/md5.c
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@ubuntu.com>2019-01-03 21:23:37 -0800
committerSteve Langasek <vorlon@debian.org>2019-01-08 22:11:51 -0800
commit7e6c4749370338c9af7e1b959f8ab96d089786d6 (patch)
tree2da5e702d7da7b222237ea5ac71e208dd70791a6 /modules/pam_unix/md5.c
parentfa4960114fc50965a9696f2db7406a9d792e3ff8 (diff)
parent795badba7f95e737f979917859cd32c9bd47bcad (diff)
Merge upstream version 1.1.8
Diffstat (limited to 'modules/pam_unix/md5.c')
-rw-r--r--modules/pam_unix/md5.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/pam_unix/md5.c b/modules/pam_unix/md5.c
index 1c622ecd..94f0485b 100644
--- a/modules/pam_unix/md5.c
+++ b/modules/pam_unix/md5.c
@@ -1,5 +1,5 @@
/*
- * $Id: md5.c,v 1.1.1.1 2000/06/20 22:12:03 agmorgan Exp $
+ * $Id$
*
* This code implements the MD5 message-digest algorithm.
* The algorithm is due to Ron Rivest. This code was
@@ -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);