summaryrefslogtreecommitdiffstats
path: root/libblkid
diff options
context:
space:
mode:
authorSami Kerola2011-07-20 22:13:32 +0200
committerSami Kerola2011-07-21 23:56:48 +0200
commite429d141061d47c567b6790f3c7d9e51e8a356a7 (patch)
tree673b8cb4880f208a2152e327249fa3622ef01eae /libblkid
parentmkfs.cramfs: use program_invocation_short_name (diff)
downloadkernel-qcow2-util-linux-e429d141061d47c567b6790f3c7d9e51e8a356a7.tar.gz
kernel-qcow2-util-linux-e429d141061d47c567b6790f3c7d9e51e8a356a7.tar.xz
kernel-qcow2-util-linux-e429d141061d47c567b6790f3c7d9e51e8a356a7.zip
md5: use symbolical digest length
Magic hash lenght number 16 is turned to a definition MD5LENGTH, and put into use everywhere where md5 checksum is in use. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'libblkid')
-rw-r--r--libblkid/src/superblocks/hfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libblkid/src/superblocks/hfs.c b/libblkid/src/superblocks/hfs.c
index e043994e3..6d960e9e7 100644
--- a/libblkid/src/superblocks/hfs.c
+++ b/libblkid/src/superblocks/hfs.c
@@ -130,17 +130,17 @@ struct hfsplus_vol_header {
static int hfs_set_uuid(blkid_probe pr, unsigned char const *hfs_info, size_t len)
{
- static unsigned char const hash_init[16] = {
+ static unsigned char const hash_init[MD5LENGTH] = {
0xb3, 0xe2, 0x0f, 0x39, 0xf2, 0x92, 0x11, 0xd6,
0x97, 0xa4, 0x00, 0x30, 0x65, 0x43, 0xec, 0xac
};
- unsigned char uuid[16];
+ unsigned char uuid[MD5LENGTH];
struct MD5Context md5c;
if (memcmp(hfs_info, "\0\0\0\0\0\0\0\0", len) == 0)
return -1;
MD5Init(&md5c);
- MD5Update(&md5c, hash_init, 16);
+ MD5Update(&md5c, hash_init, MD5LENGTH);
MD5Update(&md5c, hfs_info, len);
MD5Final(uuid, &md5c);
uuid[6] = 0x30 | (uuid[6] & 0x0f);