Skip to content

aurora-repos: refresh the Aurora repository without a key prompt - #134

Merged
DjDeveloperr merged 1 commit into
mainfrom
fix/repo-metadata-key
Nov 2, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
fix/repo-metadata-key

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

On a fresh Aurora Fedora 44 install, every refresh that can't answer a key prompt drops the Aurora repository, and every Aurora update with it, kernels included. This PR makes every update path see the repository with no prompt. Packages are still signature-checked; the repository metadata signature is no longer checked.

Root cause

aurora.repo (aurora-repos 44-1 and the image's copy) set repo_gpgcheck=1. Fedora 44's dnf5 5.4.6 only trusts a metadata key through its confirmation callback (RepoPgp::import_key). It keeps the key in <repo cachedir>/pubring, a directory of librepo <keyid>.pub files. The release has no option and no key location that skips the question. The CLI's callback declines on --assumeno or EOF. Fedora sets skip_if_unavailable=True, so the repository is then skipped, and dnf still prints "Metadata cache created".

Measured on fresh fedora:44 containers (dnf5 5.4.6, librepo 1.21.2, PackageKit 1.4.0) against the live testing feed. "Before" is 44-1. "After" is this PR. The key is in the rpmdb, as in the image.

Path Before After
dnf makecache </dev/null key prompt declined, 0 of 167 Aurora packages 167, no prompt
dnf5-makecache.service (/usr/bin/dnf5 makecache) same, then dnf upgrade --assumeno sees no Aurora update 167; Aurora fastfetch update offered
dnf upgrade --refresh --assumeno repository skipped update offered
dnf upgrade on a tty "Importing OpenPGP key 0xC6A77AC1 … Is this ok" only the transaction prompt
dnf5 offline-upgrade download repository skipped (works only with -y) update offered
PackageKit (KDE Discover): pkcon refresh force, get-updates works: its dnf5 backend sets no key callback, so libdnf5 imports into /var/cache/PackageKit/44/metadata/aurora-*/pubring without asking works, no key needed
dnf5daemon (GNOME Software 50 uses it on F44) works for root and for an active local wheel user (polkit rule). A wheel user outside an active session gets no Aurora packages. It caches in /var/cache/dnf5daemon-server, so its key never helps the CLI works for both
First package install, key not in rpmdb asks to import the package key; on EOF the Aurora update is declined n/a: the image now guarantees the key
First package install, key in rpmdb no prompt no prompt

Options considered

  • A supported option, or a key location dnf5 trusts. Not in 5.4.6. Upstream added exactly this as auto_import_local_keys (keys under /usr/share/pki/rpm-gpg or /etc/pki/rpm-gpg import without asking): rpm-software-management/dnf5 e2e9b94 (2026-10-05) and 04683e7 (2026-10-14). No release has it yet. 5.4.6 ignores the option silently (checked: no output, nothing in dnf5.log).
  • Pre-seeding the keyring. Not supported. It's undocumented, sits under each cache directory, and the directory name is <id>-sha256(baseurl)[:16]. Each consumer has its own: the CLI, ~/.cache for users, PackageKit, dnf5daemon. The file format belongs to librepo's OpenPGP backend (a gpgme keybox before, .pub files now). dnf clean all does keep it. It would have to be redone after every baseurl change (channel switch, release upgrade), and an rpm scriptlet can't run dnf.
  • A patched dnf5. Aurora's repository has priority=1 and forks here aren't tracked automatically, so an Aurora dnf5 would hide Fedora's dnf5 updates.
  • Signing differently. Every scheme still needs a key in the same keyring. A metalink only adds TLS-authenticated hashes from the same single origin.

That leaves repo_gpgcheck=0 with gpgcheck=1, as Fedora's own repositories and COPR do. The cost is the check against forged metadata from a compromised origin or CDN. Such metadata can't get an unsigned or foreign package installed, but it could, for example, add obsoletes or dependencies among signed packages. The check never guarded against replay: libdnf5 and librepo don't compare metadata age or revision, so a replayed older signed repomd passes today too. Transport stays HTTPS to a single origin. The feed keeps signing repomd.xml, so the check can come back as a one-file change once Fedora ships auto_import_local_keys. Meanwhile the old setting caused the very freeze the metadata signature is meant to resist, silently, on the timer.

Changes

  • aurora-repos 44-2: repo_gpgcheck=0 and auto_import_local_keys=1 live in a dnf5 distribution override, /usr/share/dnf5/repos.override.d/50-aurora.repo. The CLI, PackageKit and dnf5daemon all call create_repos_from_system_configuration(), which applies it. It also takes effect where aurora.repo was changed locally, as in an image built for another channel. An admin can still mask it from /etc/dnf/repos.override.d/. aurora.repo itself keeps gpgcheck=1, the key and the priority.
  • images/configure.py:
    • The image's aurora.repo is now aurora-repos's own file, with only the baseurl replaced. A testing image therefore keeps a file rpm treats as unmodified and replaces on update.
    • config.sh runs rpm --import on the Aurora key and fails unless rpmkeys --list <fingerprint> finds it.
    • The KIWI Aurora repository gets package_gpgcheck="true". Without it, KIWI writes gpgcheck=0 into its build repo files, and a minimal kiwi-ng system prepare reported "skipped OpenPGP checks for 104 packages from repositories: aurora, fedora". With it, Aurora packages are checked, and a wrong <signing> key fails the build ("OpenPGP check for package aurora-release … has failed").
  • Tests:
    • tests/test_specs.py and images/test_configure.py cover the override, the repo file, the key check and the KIWI attribute.
    • scripts/test-repo-trust is a new CI job on Fedora 44 and 45. Probe packages and metadata are signed with a throwaway key and served through the shipped files. It checks dnf5 makecache with no answer (with the shipped file and with a changed file still saying repo_gpgcheck=1), upgrade --assumeno, offline-upgrade download, pkcon refresh and get-updates, and an interactive upgrade. It also checks that unsigned and foreign packages are refused. It fails against 44-1's file, and against an empty override with a changed file.
  • Docs: docs/updates.md, images/README.md.

Verification (oracle, aarch64 containers, live feed)

  • All paths in the table above.
  • Tamper, on a copy of the live feed served over file://:
    • A modified signed repomd and an unsigned repomd: 44-1 refuses them ("Bad PGP signature" and "GPG signature is not available"); 44-2 accepts both (the cost).
    • aurora-repos with its signature removed: refused by both ("The package is not signed").
    • The same package signed by another key: refused by both ("Import of the key didn't help, wrong key?").
  • Existing install: aurora-repos 44-1 from the feed plus the old image file, upgraded to a locally built 44-2.
    • Testing image: the old file differs only in mtime, so rpm replaces it. No .rpmnew, rpm -V clean, effective repo_gpgcheck = 0. makecache </dev/null goes from a prompt and 0 packages to 167 with no prompt.
    • Image with another baseurl: the file stays (.rpmnew written), and the override still makes repo_gpgcheck = 0. 167 packages, no prompt.
  • KIWI (minimal prepare, kiwi 11.1.1): KIWI already imports the <signing> key (rpm --root … --import …/RPM-GPG-KEY-aurora). rpmkeys --root lists D6C97493… in the image rpmdb.
  • Unit tests: python3 -m unittest discover -s tests passes (249, in Ubuntu 24.04). images/test_configure.py (16), compileall, bash -n and git diff --check pass too.

Existing installs: the chicken-and-egg

A system whose refreshes skip the repository can't get 44-2 from the timer or from a non-interactive dnf. It gets it from:

  • Discover (PackageKit),
  • GNOME Software as an admin,
  • sudo dnf -y upgrade,
  • one sudo dnf upgrade where the key prompt is accepted.

After that no path asks. A system where someone already accepted the prompt keeps working throughout.

Follow-ups (not in this PR)

  • When Fedora's dnf5 ships auto_import_local_keys, set repo_gpgcheck=1 in the override and require that libdnf5.
  • KIWI also skips signature checks for upstream's Fedora repositories. package_gpgcheck="true" there would need a change to the pinned upstream description.
  • aurora.repo hard-codes 44 in the baseurl, so a system-upgrade to 45 keeps using the 44 feed until aurora-repos 45 replaces the file.

🤖 Generated with Claude Code

aurora-repos 44-1 and the images set repo_gpgcheck=1. Fedora 44's dnf5
(5.4.6) trusts a repository metadata key only through its confirmation
callback, and only keeps it in <repo cachedir>/pubring. Nothing in the
release pre-trusts a key: no option, and no key location it reads
without asking. A run that cannot answer the prompt declines it; with
Fedora's skip_if_unavailable=True the repository is then skipped, and
"Metadata cache created" is printed anyway. On a fresh fedora:44 with
the testing feed:

- dnf makecache </dev/null, dnf5-makecache.service, dnf upgrade
  --assumeno and dnf5 offline-upgrade download: 0 Aurora packages, so
  every Aurora update (kernels included) silently stops;
- dnf on a terminal: asks to import the key on the first refresh;
- PackageKit (KDE Discover): works, because its dnf5 backend registers
  no key callback and libdnf5 then imports without asking;
- dnf5daemon (GNOME Software): works for root and for an active local
  wheel user (polkit rule); a wheel user outside an active session gets
  no Aurora packages. It keeps its own cache, so its key does not help
  the command line.

Upstream dnf5 added auto_import_local_keys for this (e2e9b94, 04683e7,
October 2026); no release has it yet. Seeding the pubring depends on
libdnf5 and librepo internals and needs redoing for every cache
directory and baseurl. A dnf5 fork would shadow Fedora's dnf5 under
priority=1.

So the repository checks package signatures only, as Fedora's own
repositories and COPR do. The feed still signs repomd.xml. What is lost
is the check against forged metadata from a compromised origin.
Transport stays HTTPS to a single origin, and an unsigned or wrongly
signed package is still refused. libdnf5 never checked metadata
freshness, so a replayed older signed repomd was accepted before too.

- aurora-repos 44-2 sets repo_gpgcheck=0 and auto_import_local_keys=1
  in a dnf5 repository override, /usr/share/dnf5/repos.override.d/
  50-aurora.repo. dnf5, PackageKit and dnf5daemon all read it, and it
  applies where aurora.repo was changed locally, as in an image built
  for another channel. Once Fedora's dnf5 has auto_import_local_keys,
  the metadata check can return there.
- images/configure.py writes aurora-repos's own repo file (only the
  baseurl differs), so testing images keep a file rpm can replace.
- config.sh imports the Aurora key into the image rpm database and
  fails the build without it. KIWI already imports <signing> keys, but
  without the key the first Aurora install asks again.
- The KIWI Aurora repository sets package_gpgcheck. KIWI writes
  gpgcheck=0 into its own repo files otherwise, and image builds
  skipped the check for every package.
- scripts/test-repo-trust exercises the shipped files with probe
  packages and signed metadata from a throwaway key, on Fedora 44 and
  45 in CI.

Existing installs whose refreshes skip the repository get 44-2 from
Discover, GNOME Software, dnf -y, or one interactive dnf where the
prompt is accepted. After that no path asks.

Assisted-by: Claude Opus 5.5
@DjDeveloperr
DjDeveloperr merged commit b8bc4e6 into main Nov 2, 2026
15 checks passed
@DjDeveloperr
DjDeveloperr deleted the fix/repo-metadata-key branch November 2, 2026 16:50
RyanTheTide added a commit that referenced this pull request Nov 9, 2026
…C8.2

The switch-on now requires speakerguardd-v2 RC8.2 or later (same-boot
switch grants, #134) and the matching aurora-speaker-upgrade.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant