Skip to content

Commit 912c04e

Browse files
ProfFlowclaude
andauthored
fix(ci): force primary GPG key for repomd.xml signing (#566)
* fix(ci): force primary GPG key for repomd.xml signing PR #217 added --default-key for the gpg invocation that signs repomd.xml, but gpg's --default-key only chooses an identity, not which key under that identity actually signs. Without a trailing '!' on the keyid, gpg silently picks the most recent signing subkey. rpm 4.20+ and zypper verify repomd.xml only against the primary key, so the published signature fails verification with "Signature verification failed for repomd.xml" / "Signing key not found" — the exact symptom reported in #213. Append '!' to the keyid argument to force the primary key. Verified locally against zypper 1.14.96 / rpm 4.20.1 / gpg 2.x by re-signing the live repomd.xml with a test primary+subkey keypair: - Without '!': sig keyid = subkey, zypper refresh fails with "Signature verification failed for repomd.xml" (reproduces the production bug 1:1). - With '!': sig keyid = primary, zypper refresh succeeds: "Die angegebenen Repositorys wurden aktualisiert." Fixes #213 (regression of PR #217) Co-Authored-By: Claude <[email protected]> * docs(ci): tighten repomd.xml signing comment Compress the rationale block from 8 to 6 lines while preserving the load-bearing facts (gpg picks subkey by default, rpm 4.20+ / zypper reject subkey-signed repomd.xml, '!' forces the primary key, #213/#217 regression history). Adds an explicit "Do not strip it" admonition to the future reader. No functional change. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent b367f8e commit 912c04e

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,14 @@ jobs:
653653
echo "Generating repodata for $arch..."
654654
createrepo_c --update "rpm/$arch/"
655655
656-
# Sign the repository metadata (--yes to overwrite existing signature)
656+
# Sign repodata. Trailing '!' on keyid forces gpg to use
657+
# the primary key; without it gpg picks the most recent
658+
# signing subkey, and rpm 4.20+ / zypper reject repomd.xml
659+
# signed by anything other than the primary key.
660+
# Regression of #213 — PR #217 added --default-key but
661+
# dropped the '!'. Do not strip it. --yes overwrites .asc.
657662
echo "Signing repodata for $arch..."
658-
gpg --batch --yes --default-key "${{ steps.import_gpg.outputs.keyid }}" --detach-sign --armor "rpm/$arch/repodata/repomd.xml"
663+
gpg --batch --yes --default-key "${{ steps.import_gpg.outputs.keyid }}!" --detach-sign --armor "rpm/$arch/repodata/repomd.xml"
659664
fi
660665
done
661666

0 commit comments

Comments
 (0)