Description of problem:
dnf is not checking gpg signature for local packages or packages specified by URL
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. dnf install http://rpm.livna.org/livna-release.rpm
#this should fail as I did not install the livna gpg key
2. dnf install --downloadonly patch
#dnf downloads patch-2.7.5-2.fc23.x86_64.rpm
3. echo hello >> /var/cache/dnf/fedora-fe3d2f0c91e9b65c/packages/patch-2.7.5-2.fc23.x86_64.rpm
#this will corrupt the package making the signature bad
4. rpm -K /var/cache/dnf/fedora-fe3d2f0c91e9b65c/packages/patch-2.7.5-2.fc23.x86_64.rpm
#/var/cache/dnf/fedora-fe3d2f0c91e9b65c/packages/patch-2.7.5-2.fc23.x86_64.rpm: #rsa sha1 (MD5) PGP MD5 NOT OK
5. dnf install /var/cache/dnf/fedora-fe3d2f0c91e9b65c/packages/patch-2.7.5-2.fc23.x86_64.rpm
#dnf installs the package without realizing the package has been corrupted.
dnf installed both the livna package and the corrupted patch package without complaint
dnf should find the GPG signatures to be invalid and refuse to install the package without a --nogpgcheck flag
Fedora documentation states that local packages should also be checked when gpgcheck=1 in dnf.conf:
We'll take a look.
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
How can a security bug, which also is a regression to yum AFAIK, have low severity and low priority?
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.
According to my investigation, the behavior of DNF with gpgcheck of local messages is identical to YUM. Please let me know if I overlooked something.
Thank you very much for report of documentation difference from preset dnf behavior. We will change it according to current behavior.
We know that security is important part of package distribution, but there is supported way - repository with only signed rpms. Repositories also solve a problem of gpg-keys distribution and checksum of metadata. To create repository, createrepo_c package can be used and repositories can be remote as well local.
With gpgcheck for local packages or remote packages outside of repository many users can have difficulties with new behavior of DNF, therefore I think due to existing solution that this bug report I can close a notbug. If you will experience any further problem, please report it.
The yum has an option 'localpkg_gpgcheck' that provides requested behavior. It change the situation.
The option 'localpkg_gpgcheck' was already implemented in DNF, but it is not in documentation. It is going to be change by new pull-request.
If you want to use gpgcheck for local packages, you have to add "localpkg_gpgcheck=1" into /etc/dnf/dnf.conf file. Have a fun with it.