Added the more modern sha256 option for the --checksum algorithms. - #1007
Open
hugo-hur wants to merge 3 commits into
Open
Added the more modern sha256 option for the --checksum algorithms.#1007hugo-hur wants to merge 3 commits into
hugo-hur wants to merge 3 commits into
Conversation
steadytao
requested changes
Jun 17, 2026
Author
|
Added to the list of algorithms and something to the NEWS.md (feel free to edit or leave the NEWS.md unmerged). |
Member
|
NEWS would be updated pre-release nonetheless, thank you for the PR. |
steadytao
approved these changes
Jun 18, 2026
Author
|
@tridge can this be merged? |
Member
|
Looking back at this one. Could you rebase and add focused coverage for a SHA-256 transfer, checksum negotiation with an older peer and the compiled algorithm list when OpenSSL SHA-256 support is absent? |
Focused coverage for the sha256 entry added to valid_checksums_items[], in three parts. checksum-sha256 drives what is specific to sha256 rather than repeating what compress-options already does for every advertised algorithm. The sha256 digest is 32 bytes -- longer than SUM_LENGTH (16), the legacy MD4/MD5 size the block-checksum paths were written around -- so the test engages the delta algorithm with --no-whole-file (a local transfer defaults to --whole-file and would never compute a block checksum at all) and the --append-verify redo path. That is the long-digest counterpart of the short-digest case append-shortsum guards, where an 8-byte xxh64 sum used to make the sender die on an over-stated s2length. It also asserts the stealth-change detection -c exists for: a same-size, same-mtime edit must be re-sent, which only happens if the digest is really compared. checksum-sha256-negotiate-old checks that a new entry in the list both sides advertise leaves older peers undisturbed. Against the in-tree old_versions binaries, 3.4.1 and 3.2.7 (negotiation-capable, no sha256) must still settle on a mutually supported algorithm, 3.1.3 (older than checksum negotiation) must still fall back to md5, and asking a peer without sha256 for it must fail closed with "unknown checksum name" rather than hang or downgrade silently. Those binaries are static Linux builds; where they cannot run the portable control still runs and the old-peer cases report themselves unexercised instead of skipping, since an unexpected skip fails the platforms that enforce testsuite/skiplist. checksum-sha256-absent covers the other build shape. One #ifdef SHA256_DIGEST_LENGTH governs the sha256 entry in both valid_checksums_items[] and valid_auth_checksums_items[], and -VV exposes both lists, so the test asserts they agree and uses daemon_auth_list as its probe for whether this build's OpenSSL has SHA-256 at all. It never skips: where sha256 is advertised it must work, and where it is not -- --disable-openssl, or the FreeBSD and Solaris jobs, which install no openssl -- asking for it must be refused cleanly while ordinary negotiation still succeeds. The rejection path itself is proven on every build with a name no rsync can have.
hugo-hur
force-pushed
the
checksum-sha256
branch
from
August 20, 2026 19:45
b26642a to
e4c9b4e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added modern algorithm for the checksum. Works out of the box with builds that have OpenSSL libs enabled.