aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2019-05-15 06:44:32 +0000
committerNIIBE Yutaka <[email protected]>2019-05-15 06:44:32 +0000
commit62c29af63203400947569c5965a8cf05a22fcd4c (patch)
tree4cda0753dc3907e6ef38f6b9daa470a311290360
parentkbx: Fix deadlock in gpgsm on Windows due to a sharing violation. (diff)
downloadgnupg-62c29af63203400947569c5965a8cf05a22fcd4c.tar.gz
gnupg-62c29af63203400947569c5965a8cf05a22fcd4c.zip
scd: Fix return value for KEYINFO command.
* scd/command.c (cmd_keyinfo): Return GPG_ERR_NOT_FOUND if none. Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--scd/command.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/scd/command.c b/scd/command.c
index 3bfc1a5db..6b80341e4 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -1851,6 +1851,7 @@ cmd_keyinfo (assuan_context_t ctx, char *line)
int action;
char *keygrip_str;
ctrl_t ctrl = assuan_get_pointer (ctx);
+ app_t a;
list_mode = has_option (line, "--list");
opt_data = has_option (line, "--data");
@@ -1866,8 +1867,10 @@ cmd_keyinfo (assuan_context_t ctx, char *line)
else
action = KEYGRIP_ACTION_WRITE_STATUS;
- app_do_with_keygrip (ctrl, action, keygrip_str);
+ a = app_do_with_keygrip (ctrl, action, keygrip_str);
+ if (!list_mode && !a)
+ return gpg_error (GPG_ERR_NOT_FOUND);
return 0;
}