summaryrefslogtreecommitdiffstats
path: root/lib/md5.c
diff options
context:
space:
mode:
authorKarel Zak2011-07-26 14:41:28 +0200
committerKarel Zak2011-07-26 14:41:28 +0200
commit9ae45d23de3cb769fa272db44d9eb400d2da9534 (patch)
tree4cdb38a7d1f8e985a093f2e81cec003d95642de9 /lib/md5.c
parentlibblkid: vfat big endian fix (diff)
parentinclude: move fsck return values to exitcodes.h (diff)
downloadkernel-qcow2-util-linux-9ae45d23de3cb769fa272db44d9eb400d2da9534.tar.gz
kernel-qcow2-util-linux-9ae45d23de3cb769fa272db44d9eb400d2da9534.tar.xz
kernel-qcow2-util-linux-9ae45d23de3cb769fa272db44d9eb400d2da9534.zip
Merge branch 'cramfs' of https://github.com/kerolasa/lelux-utiliteetit
* 'cramfs' of https://github.com/kerolasa/lelux-utiliteetit: include: move fsck return values to exitcodes.h include: move disk-utils/mkfs.h -> include/exitcodes.h mkfs.cramfs: coding style mkfs.cramfs: include-what-you-use header check mkfs.cramfs: error printing fixes mkfs.cramfs: convert spaces to tabs mkfs.cramfs: validate numeric user inputs mkfs.cramfs: few symbolic exit codes where missing md5: use symbolical digest length mkfs.cramfs: use program_invocation_short_name mkfs.cramfs: use xalloc.h fsck.cramfs: add missed strings to translation fsck.cramfs: coding style fsck.cramfs: use xalloc.h fsck.cramfs: retire die function cramfs.h: coding style cramfs: use stdint.h instead of u{8,16,32} cramfs_common: coding style Conflicts: disk-utils/Makefile.am Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/md5.c')
-rw-r--r--lib/md5.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/md5.c b/lib/md5.c
index 071630f19..26ec4bbd8 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -107,7 +107,7 @@ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
* 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)
+void MD5Final(unsigned char digest[MD5LENGTH], struct MD5Context *ctx)
{
unsigned count;
unsigned char *p;
@@ -144,7 +144,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);
+ memcpy(digest, ctx->buf, MD5LENGTH);
memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
}