openEuler repository signature verification — the gpgcheck default state, key inventory management, and the self-healing path for a missing import (container-measured)
Verification scope
Section titled “Verification scope”Evidence on this page is the container track (E2, reversible operations) — openeuler/openeuler:latest (online repositories, 2026-11-05): wipe the rpm database’s imported keys → install a sample package (tree) → observe the automatic recovery path. Raw log: evidence/logs/openeuler-gpg-verify.log.
The default state: signature verification is on
Section titled “The default state: signature verification is on”Three layers of defaults (measured):
$ grep gpgcheck /etc/dnf/dnf.confgpgcheck=1 # global default on (full line measured)$ ls /etc/pki/rpm-gpg/RPM-GPG-KEY-openEuler # key file ships with the system$ rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\n'package gpg-pubkey is not installed # a minimal container has no import records by defaultVM host cross-check (openeuler-p6-supplement2.log, hardware follow-up 2026-11-12)
Section titled “VM host cross-check (openeuler-p6-supplement2.log, hardware follow-up 2026-11-12)”$ rpm -q gpg-pubkeygpg-pubkey-b675600b-63913a47gpgcheck=1 plus each repo section’s gpgkey= declaration form the complete chain: dnf imports the key per the declaration the first time a repo is used, then verifies package signatures on every install. Don’t flip gpgcheck to 0 for troubleshooting — that dismantles the whole supply-chain verification.
Measured: the self-healing path when keys are missing (and the TOFU caveat)
Section titled “Measured: the self-healing path when keys are missing (and the TOFU caveat)”The experiment: delete all gpg-pubkey entries from the rpm database, then install a new package (reversible inside the container):
$ rpm -e --allmatches gpg-pubkey$ dnf -y install treeretrieving repo key for OS unencrypted from http://repo.openeuler.org/.../RPM-GPG-KEY-openEulerImporting GPG key 0xB675600B: From : http://repo.openeuler.org/.../RPM-GPG-KEY-openEuler…$ rpm -q tree && rpm -q gpg-pubkey # install finished, key back in the databasetree-… gpg-pubkey-…Two readings:
- Self-healing holds: as long as the repo section’s
gpgkey=declaration is present, dnf pulls and imports the key automatically when it’s missing, and the install never gets stuck; - TOFU caveat: the automatic pull goes over plaintext HTTP (
retrieving repo key unencrypted) — first trust rests on a key received over the network (trust on first use). Production hardening: distribute the key file offline into/etc/pki/rpm-gpg/and pre-import it withrpm --import, and point the repo gpgkey at afile:///local path (that’s exactly the form of the dvd-os repo on this site’s euler lab machine; see local mirrors); by the same logic, https key URLs on official sources beat http.
The classic failure mode this contrasts with (the hard error Public key … is not installed) appears in scenarios with no gpgkey declaration — running rpm -ivh directly on a foreign .rpm, or a repo section missing gpgkey. The handling order: first establish where the package came from (an official-tree package → add the gpgkey declaration / import the official key; a foreign package → look for an official equivalent via the package name map, and if you really must install it, explicitly rpm --import the matching key instead of disabling verification).
The command surface for key management
Section titled “The command surface for key management”rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE} %{SUMMARY}\n' # inventory (whose keys)rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-openEuler # pre-importrpm -e gpg-pubkey-<id> # remove (rotation / mistaken import)rpm -K <pkg.rpm> # verify one package (offline check)Unverified
Section titled “Unverified”- The BAD signature branch for corrupt signatures not tested in this environment (it requires tampering with package bodies — no risk samples; behavior follows generic rpm semantics);
- Key rotation (cleaning up old gpg-pubkey entries and distributing new keys after an official rekey) was not exercised;
- No logged output sample for
rpm -Koffline verification (generic rpm capability).