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

Implement OpenPGP using librpm API #275

Merged

Conversation

jrohel
Copy link
Contributor

@jrohel jrohel commented May 5, 2023

Implements the original librepo OpenPGP API using librpm API instead of GpgMe. It implements its own keyring for public keys. Each key with its subkeys is stored in its own file.
The original GpgMe based implementation was moved to the "gpg_gpgme.c" file. So it is still present and can be activated by the USE_GPGME option in "CMakeList.txt".
This PR leaves the original GpgMe implementation enabled by default in CMakeList.txt. In the .spec file it switches to the librpm API for Fedora >= 39.

Requirement:
A new rpm library is needed that supports OpenPGP ASCII Armored signature parsing. Tested with sequoia based rpm OpenPGP backend.

Missing (requires support in the rpm library):

  • Setting the can_sign property. It now always returns TRUE.
  • Fingerprint for subkeys. An empty string is now returned.
  • Return all user IDs. Now only one returns

Notes:
In the Python tests, pgp tests that should succeed were disabled. This is because librepo lacks a Python API for working with OpenGPG keys. The Python tests manipulate the keyring directly using GpgMe. Of course, this only works if the librepo library uses the original GpgMe backend.

librepo/CMakeLists.txt Outdated Show resolved Hide resolved
librepo/gpg_rpm.c Outdated Show resolved Hide resolved
librepo/gpg_rpm.c Outdated Show resolved Hide resolved
@kontura
Copy link
Contributor

kontura commented Jul 3, 2023

I think the CI should be fixed by a rebase.

It implements the original librepo OpenPGP API using librpm API instead
of GpgMe. It implements its own keyring for public keys. Each key with
its subkeys is stored in its own file.

The original GpgMe based implementation was moved to the "gpg_gpgme.c"
file. So it is still present and can be activated by the USE_GPGME option
in "CMakeList.txt".
This commit will leave the original GpgMe implementation enabled by default
in CMakeList.txt. In the .spec file it switches to the librpm API for
Fedora >= 39.

Requirement:
A new rpm library is needed that supports OpenPGP ASCII Armored signature
parsing. Tested with sequoia based rpm OpenPGP backend.

Missing (requires support in the rpm library):
- Setting the `can_sign` property. It now always returns TRUE.
- Fingerprint for subkeys. An empty string is now returned.
- Return all user IDs. Now only one returns

Notes:
In the Python tests, pgp tests that should succeed were disabled. This is
because librepo lacks a Python API for working with OpenGPG keys.
The Python tests manipulate the keyring directly using GpgMe. Of course,
this only works if the librepo library uses the original GpgMe backend.
Copy link
Member

@jan-kolarik jan-kolarik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jan-kolarik jan-kolarik merged commit bc32add into rpm-software-management:master Aug 14, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants