-
Notifications
You must be signed in to change notification settings - Fork 92
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
If librepo is built with -DUSE_GPGME and RPM with -DWITH_INTERNAL_OPENPGP=ON -DWITH_OPENSSL=ON, test_gpg_check_signature fails: Assertion 'ret' failed #281
Comments
I cannot reproduce it on current x86_64 Fedora 40. What RPM and rpm-sequoia do you have? I have rpm-4.18.99-1.fc40.x86_64 and rpm-sequoia-1.5.0-1.fc40.x86_64. |
This patch should make the test failure more verbose:
|
Just FTR: I'm building librepo with Here is the result with instrumentation patch: + cd librepo-1.16.0
+ /usr/bin/ctest --test-dir x86_64-redhat-linux-gnu --output-on-failure --force-new-ctest-process -j48 ' '
Internal ctest changing into directory: /home/tkloczko/rpmbuild/BUILD/librepo-1.16.0/x86_64-redhat-linux-gnu
Test project /home/tkloczko/rpmbuild/BUILD/librepo-1.16.0/x86_64-redhat-linux-gnu
Start 1: test_main
Start 2: test_python
1/2 Test #1: test_main ........................***Failed 0.12 sec
Tests using directory: /tmp/librepoKNQszg
Running suite(s): checksum
gpg
handle
(process:1112696): librepo-WARNING **: 19:27:57.446: WARNING! Deprecated LRO_MIRRORLIST used
(process:1112696): librepo-WARNING **: 19:27:57.446: WARNING! Deprecated LRO_MIRRORLIST used
internal_mirrorlist
metalink
mirrorlist
package_downloader
repoconf
repomd
url_substitution
util
version
95%: Checks: 47, Failures: 2, Errors: 0
/home/tkloczko/rpmbuild/BUILD/librepo-1.16.0/tests/test_gpg.c:51:F:Main:test_gpg_check_signature:0: Checking valid key and data failed with "check_signature: Error during parsing OpenPGP pa
cket(s)"
/home/tkloczko/rpmbuild/BUILD/librepo-1.16.0/tests/test_gpg.c:169:F:Main:test_gpg_check_key_export:0: Assertion 'subkeys != NULL' failed: subkeys == 0
2/2 Test #2: test_python ...................... Passed 12.30 sec
50% tests passed, 1 tests failed out of 2
Total Test time (real) = 12.31 sec
The following tests FAILED:
1 - test_main (Failed)
Errors while running CTest |
That's why I asked what RPM and Sequoia you have. I suspect the root is lies there. Can you tell me which system you run the tests in? |
You can also enable tracing RPM with RPM_TRACE=1 environemnt variable:
|
What you mean "which?" 🤔 |
What packages you use as build dependencies? I gave you exact package versions I use and where the failure does not occur. Without knowing your build environment to reproduce the failure I cannot help you. |
Mostly latest versions (except openssl): In your case you listed rpm-4.18.99-1.fc40.x86_64. Fedora uses sequoia (not openssl + internal gpg like it is in my case) |
Thanks for the specification. Now I can reproduce it (configuring RPM with -DWITH_INTERNAL_OPENPGP=ON -DWITH_OPENSSL=ON CMake options). This is a bug in RPM's internal OpenPGP parser rpm-software-management/rpm#2414, probably introduced on purpose in rpm-software-management/rpm#2278 because RPM wants to remove the internal OpenPGP parser rpm-software-management/rpm#2414. |
test_main
unit
OK 👍 |
I pasted a wrong RPM issue number. The correct one is rpm-software-management/rpm#2512. |
When debugging a test failure with RPM using internal OpenPGP+OpenSSL implementation (that's a bug in RPM, not in librepo), I discovered that librepo tests did not print error messages and that lr_gpg_check_signature() did not forwarded an error message from RPM. RPM before rpm-4.19.0-alpha2 did not provided provided any error messages. That has changed with new functions pgpPrtParams2() and pgpVerifySignature2(). This patch enhances librepo code to use the new RPM functions if available and to propagate the RPM error messages via an already existing GError argument. This patch also enhances librepo tests to actually print the unexpected error messages. Both enhancements should help people to debug their failures. Nonetheless, internal OpenPGP implementation in RPM does not set any error messages and that will probably not change because RPM is going to remove that implementation. On the other hand, Sequoia implementation in RPM forwards the messages from Sequoia library. Yet I was unbable to obtain any message. Sequoia promissed to improve their error messaging, especially with a demise of SHA-1. So I believe this librepo enhancement is useful. Implementation details: I wrapped pgpPrtParams2() into a function because it's called at multiple places. Contrary I did not wrap pgpVerifySignature2() because it's called only at one place. rpm-software-management#281
Also explain that RPM internal OpenPGP parser is buggy. rpm-software-management#281
OK 👍 |
It's plausible. The "repomd.xml GPG signature verification error" error comes from librepo's lr_check_repomd_xml_asc_availability() which calls lr_gpg_check_signature() function which is exactly the same function investigated in this issue. |
Also explain that RPM internal OpenPGP parser is buggy. #281
When debugging a test failure with RPM using internal OpenPGP+OpenSSL implementation (that's a bug in RPM, not in librepo), I discovered that librepo tests did not print error messages and that lr_gpg_check_signature() did not forwarded an error message from RPM. RPM before rpm-4.19.0-alpha2 did not provided provided any error messages. That has changed with new functions pgpPrtParams2() and pgpVerifySignature2(). This patch enhances librepo code to use the new RPM functions if available and to propagate the RPM error messages via an already existing GError argument. This patch also enhances librepo tests to actually print the unexpected error messages. Both enhancements should help people to debug their failures. Nonetheless, internal OpenPGP implementation in RPM does not set any error messages and that will probably not change because RPM is going to remove that implementation. On the other hand, Sequoia implementation in RPM forwards the messages from Sequoia library. Yet I was unbable to obtain any message. Sequoia promissed to improve their error messaging, especially with a demise of SHA-1. So I believe this librepo enhancement is useful. Implementation details: I wrapped pgpPrtParams2() into a function because it's called at multiple places. Contrary I did not wrap pgpVerifySignature2() because it's called only at one place. rpm-software-management#281
When debugging a test failure with RPM using internal OpenPGP+OpenSSL implementation (that's a bug in RPM, not in librepo), I discovered that librepo tests did not print error messages and that lr_gpg_check_signature() did not forwarded an error message from RPM. RPM before rpm-4.19.0-alpha2 did not provided provided any error messages. That has changed with new functions pgpPrtParams2() and pgpVerifySignature2(). This patch enhances librepo code to use the new RPM functions if available and to propagate the RPM error messages via an already existing GError argument. This patch also enhances librepo tests to actually print the unexpected error messages. Both enhancements should help people to debug their failures. Nonetheless, internal OpenPGP implementation in RPM does not set any error messages and that will probably not change because RPM is going to remove that implementation. On the other hand, Sequoia implementation in RPM forwards the messages from Sequoia library. Yet I was unbable to obtain any message. Sequoia promissed to improve their error messaging, especially with a demise of SHA-1. So I believe this librepo enhancement is useful. Implementation details: I wrapped pgpPrtParams2() into a function because it's called at multiple places. Contrary I did not wrap pgpVerifySignature2() because it's called only at one place. #281
cmake setup
and test suite is failing with:
The text was updated successfully, but these errors were encountered: