Red Hat Bugzilla – Bug 763890
checksum computation needs to be changed
Last modified: 2015-10-22 11:46:38 EDT
checksum computation needs to change to accommodate the changing options in the new versions, so that a peer running old version can be probed.
Yes, there are multiple problems with this code.
(1) A new info file will be generated when syncing from a peer, possibly ending up with different contents than the just-fetched version (if the generating function adds more lines than before). This can cause a checksum mismatch relative to the peer you fetched from, which never had a reason to re-generate its copy and corresponding checksum.
(2) Compute_checksum is just a really weak checksum function. It amounts to a simple XOR with 1-3 bits shifted, which is inappropriate for human-readable-text input. We should use a standard checksum/hash with better mixing.
(3) Compute_checksum is always called with GF_CHECKSUM_BUF_SIZE=1024 for the size, often using more bytes than were actually read. The extra bytes will be zero, so they'll have no effect on the output (see previous point).
(4) The use of 0xbabeb00b as a checksum seed might be considered inappropriate.
There was a user in IRC today who was getting checksum mismatches, probably - but not certainly - due to issue 1 above. If you'd like to brainstorm about what a more robust checksum approach might look like, I'd be glad to help.
any action on this? taking off KP from this.
I don't think this is an issue any more. Avra to reconfirm and then we can close it.
because of the large number of bugs filed against mainline version\ is ambiguous and about to be removed as a choice.
If you believe this is still a bug, please change the status back to NEW and choose the appropriate, applicable version for it.