Purely technical, but it looks like lib/mdfour.c gets the MD4 checksum wrong when the block is an exact multiple of 64 - it never calls mdfour_tail, so the message length is not added to the checksummed data. Compiling mdfour.c with TEST_MDFOUR and comparing the hashes with the output of openssl md4 on a 64 byte file shows the bug easily. Since rsync doesn't require the cryptographic strength of md4 anyway, perhaps it simply doesn't matter - but it would be good for the file to carry a comment saying that it is not MD4, if that is the intention. @@ -166,8 +166,6 @@ m = md; - if (n == 0) mdfour_tail(in, n); - while (n >= 64) { copy64(M, in); mdfour64(M); @@ -179,7 +177,7 @@ } } - if (n) mdfour_tail(in, n); + mdfour_tail(in, n); } (except obviously you need to be backward compatible!)
The bug with 64-byte-multiple files was fixed for protocol 27 and beyond, which is testable by putting some debug code into checksum.c directly. However, the test function in mdfour.c was not updated to reflect this fix, so it continued to output the bogus MD4 checksums that were sent for older protocol versions. I checked-in a fix for the debug function in mdfour.c so that it will output the right values when TEST_MDFOUR is defined.
Test ようこそ