Use gpgv instead of gpg for Release signature verification in install-debs.py#17024
Open
richlander wants to merge 1 commit into
Open
Use gpgv instead of gpg for Release signature verification in install-debs.py#17024richlander wants to merge 1 commit into
richlander wants to merge 1 commit into
Conversation
install-debs.py verified the APT Release signature with "gpg --keyring <keyring> --verify". On hosts running GnuPG 2.4+ with keyboxd (e.g. Azure Linux 4.0), routing verification through gpg's agent/keyboxd machinery is fragile and can fail, forcing downstream consumers to patch the cloned arcade script. gpgv is the purpose-built detached-signature verifier: it checks a signature against a fixed keyring with no agent, no keyboxd, and no mutation of any keyring. It is available wherever gpg is used for this path (same gnupg2 package on Azure Linux; an Essential package on Debian/Ubuntu), and the debootstrap rootfs path already relies on it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Arcade’s cross rootfs package installer to verify APT Release signatures using gpgv (detached-signature verifier) instead of gpg, avoiding GnuPG 2.4+ keyboxd/agent involvement that can make gpg --keyring ... --verify ... fragile on some hosts.
Changes:
- Switch
Release.gpgverification command fromgpg --verifytogpgvwith the same keyring input. - Add inline rationale explaining why
gpgvis preferred for this use case.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
CC @akoeplinger — this follows up on the Note This comment was created with the assistance of GitHub Copilot. |
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.
Summary
Switch the APT
Releasesignature verification ineng/common/cross/install-debs.pyfromgpgtogpgv.Today the script runs
gpg --keyring <keyring> --verify Release.gpg Release. On hosts running GnuPG 2.4+ withkeyboxd(e.g. Azure Linux 4.0),gpg --keyringroutes verification through the agent/keyboxdmachinery rather than doing a simple, self-contained check against the supplied keyring, which is fragile and can fail.gpgvis the purpose-built detached-signature verifier: it checks a signature against a fixed keyring with no agent, nokeyboxd, and no mutation of any keyring.This is the only signature-verification call site in
eng/common/cross(build-rootfs.shmerely selects the keyring and passes--keyring/--force-check-gpg).Change
gpgvtakes the same--keyringargument and thesig/dataoperands; it has no--verifyflag because verifying is all it does.Why this is safe
gpgvis available wherevergpgis used for this path. On Azure Linux it is the samegnupg2package asgpg(verified onazurelinux/base/core:3.0and the realazurelinux-3.0-net11.0-crossdeps-builderimage: bothgpgandgpgv→gnupg2-2.4.9). On Debian/Ubuntu hostsgpgvis an Essential package (APT depends on it).debootstraprootfs path already usesgpgvinternally, so this aligns the two paths.Validation
Validated end-to-end inside the real
azurelinux-3.0-net11.0-crossdeps-builder-amd64image against a live UbuntujammyRelease/Release.gpgand the baked-inubuntu-archive-keyring.gpg:gpg --verify(before)gpgv(after)Good signature from "Ubuntu Archive Automatic Signing Key")ReleaseAlso ran the patched
install-debs.pyfetch_release_filedirectly in that image — it downloads and verifies the real UbuntuReleaseviagpgvand printsSignature verified successfully.Context
This removes the need for downstream consumers to
sed-patch the cloned arcade script, e.g. dotnet/dotnet-buildtools-prereqs-docker#1674. Tracked by #17023.Note
This PR was created with the assistance of GitHub Copilot.