summaryrefslogtreecommitdiffstats
path: root/g10/mainproc.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2018-01-25 16:48:07 +0100
committerWerner Koch <wk@gnupg.org>2018-01-25 16:58:29 +0100
commit149369a92b447d06863e79dfe5589321eaf1f237 (patch)
tree7fccbc08e642eca25f8d0327a3d2e3ecc5086e4e /g10/mainproc.c
parentgpg: New maintainer option --debug-set-iobuf-size. (diff)
parentdoc: Note --quick-gen-key as an alias for --quick-generate-key (diff)
downloadgnupg2-149369a92b447d06863e79dfe5589321eaf1f237.tar.xz
gnupg2-149369a92b447d06863e79dfe5589321eaf1f237.zip
Merge branch 'STABLE-BRANCH-2-2' into master
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/mainproc.c')
-rw-r--r--g10/mainproc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c
index accf25ed6..f2a28df74 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -495,7 +495,7 @@ proc_pubkey_enc (ctrl_t ctrl, CTX c, PACKET *pkt)
|| have_secret_key_with_kid (enc->keyid)))
{
if(opt.list_only)
- result = -1;
+ result = GPG_ERR_MISSING_ACTION; /* fixme: Use better error code. */
else
{
c->dek = xmalloc_secure_clear (sizeof *c->dek);
@@ -513,9 +513,7 @@ proc_pubkey_enc (ctrl_t ctrl, CTX c, PACKET *pkt)
else
result = GPG_ERR_PUBKEY_ALGO;
- if (result == -1)
- ;
- else
+ if (1)
{
/* Store it for later display. */
struct kidlist_item *x = xmalloc (sizeof *x);
@@ -583,6 +581,10 @@ print_pkenc_list (ctrl_t ctrl, struct kidlist_item *list, int failed)
write_status_text (STATUS_NO_SECKEY, buf);
}
}
+ else if (gpg_err_code (list->reason) == GPG_ERR_MISSING_ACTION)
+ {
+ /* Not tested for secret key due to --list-only mode. */
+ }
else if (list->reason)
{
log_info (_("public key decryption failed: %s\n"),