gpg: factor out secret key deletion function
Needs ReviewPublic

Authored by matheusmoreira on Tue, Apr 30, 3:17 PM.
This revision needs review, but there are no reviewers specified.

Details

Summary
  • g10/delkey.c (gpg_agent_delete_secret_key): New.

(do_delete_key): Simplify.

The new key deletion function asks the gpg agent to delete
the secret key associated with the specified public key.
It returns GPG_ERR_NO_SECKEY if there is no secret key
associated with the given public key.

Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>

Test Plan

There should be no change in the behavior of --delete-secret-key following this change.

Diff Detail

Repository
rG GnuPG
Lint
Lint Skipped
Unit
Unit Tests Skipped
matheusmoreira retitled this revision from gpg: factor out function that deletes secret keys to Factor out secret key deletion function.Tue, Apr 30, 3:20 PM
matheusmoreira retitled this revision from Factor out secret key deletion function to gpg: avoid deletion of keys not specified by user.
matheusmoreira edited the summary of this revision. (Show Details)

Fix missing curly brace.

matheusmoreira retitled this revision from gpg: avoid deletion of keys not specified by user to gpg: factor out function that deletes secret keys.Thu, May 2, 3:43 AM
matheusmoreira edited the summary of this revision. (Show Details)
matheusmoreira retitled this revision from gpg: factor out function that deletes secret keys to gpg: factor out secret key deletion function.Thu, May 2, 4:09 AM

Rebased on top of master: 4c7d63cd5b02