-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Labels
Description
Describe the bug
If your .repo file has specified repo_gpgcheck=1 to check the gpg signature of repo metadata, synchronizing the repo cache fails if the gpg key is not already imported. What it should do instead is install the gpg keys from gpgkey and try again, like gpgcheck does.
Reproduction steps
- mkdir /tmp/myrepo
- cd /tmp/myrepo
- wget some-rpm.rpm
- createrepo .
- cd repodata
- gpg --no-default-keyring --keyring isolated.keyring --full-generate-key # I chose "RSA and RSA" and defaults and "asdf" as the name.
- gpg --no-default-keyring --keyring isolated.keyring --armor --export asdf > repomd.xml.key
- gpg --no-default-keyring --keyring isolated.keyring --output repomd.xml.asc --armor --detach-sign repomd.xml
-
cat <<EOF > /etc/yum.repos.d/myrepo.repo [myrepo] baseurl=file:///tmp/myrepo/ enabled=0 repo_gpgcheck=1 gpgkey=file:///tmp/myrepo/repodata/repomd.xml.key EOF - tdnf install -y --disablerepo=* --enablerepo myrepo some-rpm
Loaded plugin: tdnfrepogpgcheck
Refreshing metadata for: 'myrepo'
repo md signature check: No public key 659 100%
Error: TDNFVerifySignature 2004
Plugin error: repogpgcheck plugin error: failed to verify signature
Error(2004) : Unknown error 404
Error: Failed to synchronize cache for repo 'myrepo'
Error(2004) : Unknown error 404
Expected behavior
The installation should succeed. The gpgkey should be read and imported from the gpgkey option, and then checking the metadata signature should work.
Additional context
Tested on tdnf: 3.5.2
JLunda and sardobi