{
unsigned char buf[128];
uint32 M[16];
- extern int remote_version;
+ extern int protocol_version;
/*
* Count total number of bits, modulo 2^64
* of bits modulo 2^64, which was fixed starting with
* protocol version 27.
*/
- if (remote_version >= 27) {
+ if (protocol_version >= 27) {
copy4(buf+60, m->totalN2);
}
copy64(M, buf);
* of bits modulo 2^64, which was fixed starting with
* protocol version 27.
*/
- if (remote_version >= 27) {
+ if (protocol_version >= 27) {
copy4(buf+124, m->totalN2);
}
copy64(M, buf);
}
#ifdef TEST_MDFOUR
+int protocol_version = 28;
+
static void file_checksum1(char *fname)
{
- int fd, i;
+ int fd, i, was_multiple_of_64 = 1;
struct mdfour md;
unsigned char buf[64*1024], sum[16];
while (1) {
int n = read(fd, buf, sizeof(buf));
- if (n <= 0) break;
+ if (n <= 0)
+ break;
+ was_multiple_of_64 = !(n % 64);
mdfour_update(&md, buf, n);
}
+ if (was_multiple_of_64 && protocol_version >= 27)
+ mdfour_update(&md, buf, 0);
close(fd);