Repository navigation
Conversation
With a remote configured with sign-verify-summary=true, a pull that
fetched a summary.sig but no summary did not fail: only a missing
summary.sig was an error, and the signature check itself only runs when
both are present. The pull then resolved the requested refs from the
unsigned refs/heads/ files served by the remote, so the summary
signature was never checked.
The GPG path already fails in this case ("GPG verification enabled, but
no summary found"), as does ostree_repo_remote_fetch_summary_with_options()
for both GPG and the sign API via _ostree_repo_verify_summary(). Do the
same for the sign API in ostree_repo_pull_with_options().
Extend tests/test-signed-pull-summary.sh with a remote serving
summary.sig but no summary; the pull succeeded before this change.
Signed-off-by: Colin Walters <walters@verbum.org>
ostree_repo_pull_with_options() carried its own copies of the summary signature checks for GPG and for the sign API, apart from _ostree_repo_verify_summary(), which ostree_repo_remote_fetch_summary_with_options() uses. The copies had drifted: the sign API one lacked the missing summary check (fixed in the previous commit), and the retry after a cached summary failed verification only re-checked the engine whose check had failed, so with both gpg-verify-summary and sign-verify-summary enabled, a summary refetched after a failed sign API check was never GPG verified. Neither retry handled a refetch that found no summary: the GPG one passed NULL to ostree_repo_verify_summary(), which failed on a critical warning without setting an error, and the sign API one left it to each engine to reject NULL data. Use _ostree_repo_verify_summary() for both the first check and the retry, so the pull and fetch-summary paths apply the same rules to every engine. The pull now reports a missing summary or summary.sig with the same messages as fetching the summary does (GPG error codes are unchanged; a missing summary.sig under the sign API is now G_IO_ERROR_NOT_FOUND, like a missing summary). In builds without GPGME, a remote with gpg-verify-summary=true now fails the pull, as fetching its summary already did, instead of skipping the check. Add a missing summary case to tests/test-pull-summary-sigs.sh for the GPG side. Signed-off-by: Colin Walters <walters@verbum.org>
The delta index isn't covered by the signed summary, so a mirror can serve a superblock and part whose op stream opens more objects than the part declares. open_output_target() and dispatch_open() then hit g_assert and abort the pulling process instead of failing the pull. Turn those asserts into errors so a bad delta part is rejected cleanly. Signed-off-by: Colin Walters <walters@verbum.org>
Signed-off-by: Colin Walters <walters@verbum.org>
Signed-off-by: Colin Walters <walters@verbum.org>
There was a problem hiding this comment.
🟡 Changes recommended
The broadened mode guard permits BARE_SPLIT_XATTRS deltas to publish file objects without required xattr records, causing subsequent loads with xattrs to fail.
1 open issue
What changed in this PR
This PR fixes summary signature verification for metalink pulls with an empty cache, following up on #3692. It verifies the fetched summary bytes and releases the existing summary variant before rebuilding it.
Changes:
- Add signed-metalink and missing-summary regression coverage.
- Consolidate summary verification and cached-summary retry handling.
- Include static-delta validation changes and a development version bump to 2026.8.
| File | Description |
|---|---|
tests/test-signed-pull-summary.sh |
Add missing-summary and signed-metalink tests for dummy and ed25519 engines. |
tests/test-pull-summary-sigs.sh |
Add a missing-summary test with GPG verification enabled. |
src/libostree/ostree-repo-static-delta-processing.c |
Replace assertions with errors for invalid delta state and repository modes. |
src/libostree/ostree-repo-pull.c |
Verify metalink summary bytes and consolidate verification handling. |
configure.ac |
Bump the development version to 2026.8. |
Review effort: Balanced
| g_assert (repo->mode == OSTREE_REPO_MODE_BARE || repo->mode == OSTREE_REPO_MODE_BARE_USER | ||
| || repo->mode == OSTREE_REPO_MODE_BARE_USER_ONLY); | ||
| } | ||
| if (!state->stats_only && !_ostree_repo_mode_is_bare (repo->mode)) |
A remote with a metalink gets its summary through the metalink, before the normal summary download, and on a pull with nothing cached the summary signature check used to be skipped on that path. test-signed-pull-summary.sh covers a valid signed summary via a metalink; add the matching negative case: with sign-verify-summary enabled and an invalid summary.sig, a pull through the metalink must fail.
mardgez
force-pushed
the
pull-metalink-verify-summary
branch
from
November 13, 2026 04:45
a9d30df to
b085db8
Compare
Member
|
The latest in #3693 should contains a fix for this that was done in a different way |
Member
|
Merged into that PR |
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.

Builds on #3692, whose second commit now also verifies the summary a metalink provides. The first version of this PR made that change; with it in #3692, this PR is down to the test.
#3692 checks that a pull of a valid signed summary through a metalink succeeds. This adds the negative case: with
sign-verify-summary=trueand an invalidsummary.sig, a pull through the metalink fails with "No signatures found". On the code before #3692 that pull succeeds without the signature being checked, so this covers the metalink path of the fix.It shows #3692's commits until that merges; only the last commit is new.