Skip to content

Update deprecated key editing functions#207

Merged
ueno merged 6 commits intoueno:masterfrom
djberg96:op_card_deprecations
Feb 5, 2026
Merged

Update deprecated key editing functions#207
ueno merged 6 commits intoueno:masterfrom
djberg96:op_card_deprecations

Conversation

@djberg96
Copy link
Contributor

@djberg96 djberg96 commented Feb 5, 2026

Updates the deprecated GPGME key editing functions with modern equivalents while maintaining backward compatibility.

Basically, use the various interact functions on GPGME 2.0+ under the hood where possible.

Fixed a few test warnings regarding unused variables while I was here.

Copy link
Owner

@ueno ueno left a comment

Choose a reason for hiding this comment

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

Looks great, I only have a couple of nitpicks.

* The shim callback converts keyword strings to status codes.
*/

/* Mapping table from keyword strings to status codes */
Copy link
Owner

Choose a reason for hiding this comment

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

I might define a macro to help define the entries and avoid copy and paste error, e.g.,:

#define S(x) { #x, GPGME_STATUS_##x }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, added a macro helper.

int i;
if (!keyword)
return GPGME_STATUS_EOF;
for (i = 0; keyword_to_status[i].keyword != NULL; i++) {
Copy link
Owner

Choose a reason for hiding this comment

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

nit: please follow the GNU coding style https://www.gnu.org/prep/standards/standards.html#Formatting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. :)

static gpgme_status_code_t
keyword_to_status_code (const char *keyword)
{
int i;
Copy link
Owner

Choose a reason for hiding this comment

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

nit: use size_t.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

Copy link
Owner

@ueno ueno left a comment

Choose a reason for hiding this comment

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

Thank you, LGTM!

@ueno ueno merged commit e8afd53 into ueno:master Feb 5, 2026
12 checks passed
@djberg96 djberg96 mentioned this pull request Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants