Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signed RPM failed to install using dnf on RHEL8 and RHEL9 #64

Closed
4 tasks done
ctron opened this issue Aug 16, 2022 · 8 comments
Closed
4 tasks done

Signed RPM failed to install using dnf on RHEL8 and RHEL9 #64

ctron opened this issue Aug 16, 2022 · 8 comments
Labels

Comments

@ctron
Copy link
Owner

ctron commented Aug 16, 2022

reported by: @tobias1703

A package that is signed, can be successfully verified on RHEL7, 8, 9 (using rpm -K), but when creating a YUM repository using createrepo, it fails to install on RHEL 8 and 9 with the following error:

Package test.rpm is not signed
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: GPG check FAILED

Reproducer: https://github.com/tobias1703/rpm-builder-test

Remaining tasks:

@ctron ctron added the bug label Aug 16, 2022
@ctron
Copy link
Owner Author

ctron commented Aug 16, 2022

Interestingly it can be installed successfully using dnf install test.rpm.

@ctron
Copy link
Owner Author

ctron commented Aug 16, 2022

@ctron
Copy link
Owner Author

ctron commented Aug 16, 2022

@ctron
Copy link
Owner Author

ctron commented Aug 16, 2022

The input for this comes from rpmkeys, executing the same command (with the same arguments) results in:

[root@2adb210281de myrepo]# rpmkeys --checksig --verbose '--define=_pkgverify_level signature' '--define=_pkgverify_flags 0x0' test.rpm 
test.rpm:
    Header V4 RSA/SHA256 Signature, key ID fa569ade: OK
    Header SHA256 digest: OK
    Header SHA1 digest: OK
    Payload SHA256 digest: NOTFOUND
    Payload SHA256 ALT digest: NOTFOUND
    RSA signature: NOTFOUND
    DSA signature: NOTFOUND
    MD5 digest: OK

So I guess, one of the NOTFOUNDs triggers this response.

@ctron
Copy link
Owner Author

ctron commented Aug 16, 2022

Checking with an rpm from RHEL9, this compares to:

yum-utils-4.0.24-4.el9_0.noarch.rpm:
    Header V3 RSA/SHA256 Signature, key ID fd431d51: OK
    Header SHA256 digest: OK
    Header SHA1 digest: OK
    Payload SHA256 digest: OK
    V3 RSA/SHA256 Signature, key ID fd431d51: OK
    MD5 digest: OK

@ctron
Copy link
Owner Author

ctron commented Aug 16, 2022

Comparing that to the output of rpmcheck of RHEL7:

[root@26c410b57805 myrepo]# rpmkeys --checksig --verbose '--define=_pkgverify_level signature' '--define=_pkgverify_flags 0x0' test.rpm
test.rpm:
    Header V4 RSA/SHA256 Signature, key ID fa569ade: OK
    Header SHA1 digest: OK (ed3d708091c78619c1a0f2ce0045fad5d1278feb)
    MD5 digest: OK (b68fa9e7e4b20a253d41e65abe78f26c)

@ctron
Copy link
Owner Author

ctron commented Aug 16, 2022

I think I have found out what is wrong: It seems as if RPM has a V4 signature header (which Eclipse Packager and thus the RPM builder plugin) create. Which only signs the header, but with the header also signs the header entries containing the payload digests. This is faster, but triggers the rpmkeys tool to complain about "missing" information.

The V3 signature signs both headers and payload, but is slower.

So, what needs to be done: (see first comment)

I have a working version locally. So all that needs to the done is to orchestrate a few PRs and create new versions.

@ctron
Copy link
Owner Author

ctron commented Aug 22, 2022

This is released as 1.9.0.

@ctron ctron closed this as completed Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant