calculations for names > 32 characters to be completely
bogus. Changed MD4 calculation to match what is currently
being used in the CVS gkernel tree.
+2002-07-23 Theodore Ts'o <tytso@mit.edu>
+
+ * dirhash.c (ext2fs_dirhash): Fix bug which caused MD4
+ calculations for names > 32 characters to be completely
+ bogus. Changed MD4 calculation to match what is currently
+ being used in the CVS gkernel tree.
+
2002-07-19 Theodore Ts'o <tytso@mit.edu>
* ext2_fs.h: Add s_hash_seed and s_def_hash_version to the
buf[2] += c;
buf[3] += d;
- return (buf[1] << 1); /* "most hashed" word */
+ return ((buf[1] + b) & ~1); /* "most hashed" word */
/* Alternative: return sum of all words? */
}
{
__u32 hash;
__u32 minor_hash = 0;
- char *p;
+ const char *p;
int i;
/* Check to see if the seed is all zero's */
buf[2] = 0x98badcfe;
buf[3] = 0x10325476;
} else
- memcpy(buf, in, sizeof(buf));
+ memcpy(buf, seed, sizeof(buf));
+ p = name;
while (len) {
if (len < 32) {
- memcpy(in, name, len);
+ memcpy(in, p, len);
memset(in+len, 0, 32-len);
hash = halfMD4Transform(buf, (__u32 *) in);
break;