1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00

gpg: Return ERROR status for --quick-sign-key.

* g10/keyedit.c (keyedit_quick_sign): Return an error status line.
--
This commit is contained in:
Werner Koch 2023-05-24 16:02:39 +02:00
parent a6dad932f4
commit 944479e21d
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -2758,7 +2758,7 @@ void
keyedit_quick_sign (ctrl_t ctrl, const char *fpr, strlist_t uids, keyedit_quick_sign (ctrl_t ctrl, const char *fpr, strlist_t uids,
strlist_t locusr, int local) strlist_t locusr, int local)
{ {
gpg_error_t err; gpg_error_t err = 0;
kbnode_t keyblock = NULL; kbnode_t keyblock = NULL;
KEYDB_HANDLE kdbhd = NULL; KEYDB_HANDLE kdbhd = NULL;
int modified = 0; int modified = 0;
@ -2796,6 +2796,7 @@ keyedit_quick_sign (ctrl_t ctrl, const char *fpr, strlist_t uids,
if (!opt.verbose) if (!opt.verbose)
show_key_with_all_names (ctrl, es_stdout, keyblock, 0, 0, 0, 0, 0, 1); show_key_with_all_names (ctrl, es_stdout, keyblock, 0, 0, 0, 0, 0, 1);
log_error ("%s%s", _("Key is revoked."), _(" Unable to sign.\n")); log_error ("%s%s", _("Key is revoked."), _(" Unable to sign.\n"));
err = gpg_error (GPG_ERR_CERT_REVOKED);
goto leave; goto leave;
} }
@ -2873,6 +2874,7 @@ keyedit_quick_sign (ctrl_t ctrl, const char *fpr, strlist_t uids,
sl->d, gpg_strerror (GPG_ERR_NOT_FOUND)); sl->d, gpg_strerror (GPG_ERR_NOT_FOUND));
} }
log_error ("%s %s", _("No matching user IDs."), _("Nothing to sign.\n")); log_error ("%s %s", _("No matching user IDs."), _("Nothing to sign.\n"));
err = gpg_error (GPG_ERR_NO_USER_ID);
goto leave; goto leave;
} }
@ -2895,8 +2897,9 @@ keyedit_quick_sign (ctrl_t ctrl, const char *fpr, strlist_t uids,
if (update_trust) if (update_trust)
revalidation_mark (ctrl); revalidation_mark (ctrl);
leave: leave:
if (err)
write_status_error ("keyedit.sign-key", err);
release_kbnode (keyblock); release_kbnode (keyblock);
keydb_release (kdbhd); keydb_release (kdbhd);
} }
@ -2912,7 +2915,7 @@ void
keyedit_quick_revsig (ctrl_t ctrl, const char *username, const char *sigtorev, keyedit_quick_revsig (ctrl_t ctrl, const char *username, const char *sigtorev,
strlist_t affected_uids) strlist_t affected_uids)
{ {
gpg_error_t err; gpg_error_t err = 0;
int no_signing_key = 0; int no_signing_key = 0;
KEYDB_HANDLE kdbhd = NULL; KEYDB_HANDLE kdbhd = NULL;
kbnode_t keyblock = NULL; kbnode_t keyblock = NULL;