aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2024-10-01 16:07:32 +0000
committerWerner Koch <[email protected]>2024-10-01 16:07:32 +0000
commit4275d5fa7a51731544d243ba16628a9958ffe3ce (patch)
treec99245e7662ab567b38620e273241c8c1450174b /agent/command.c
parentgpgsm: Possible improvement for some rare P12 files. (diff)
downloadgnupg-4275d5fa7a51731544d243ba16628a9958ffe3ce.tar.gz
gnupg-4275d5fa7a51731544d243ba16628a9958ffe3ce.zip
agent: Add option --status to the LISTRUSTED command.
* agent/trustlist.c (istrusted_internal): Add arg listmode and print new status line in this mode. Adjust callers. (agent_listtrusted): Add new args ctrl and status_mode. Get all trusted keys and then call is_trusted_internal for all of them. * agent/command.c (cmd_listtrusted): Add new option --status. -- This allows in a non-restricted connection to list all trusted keys in one go.
Diffstat (limited to 'agent/command.c')
-rw-r--r--agent/command.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/agent/command.c b/agent/command.c
index 580d1cb10..ebfffa624 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -569,22 +569,24 @@ cmd_istrusted (assuan_context_t ctx, char *line)
static const char hlp_listtrusted[] =
- "LISTTRUSTED\n"
+ "LISTTRUSTED [--status]\n"
"\n"
- "List all entries from the trustlist.";
+ "List all entries from the trustlist. With --status the\n"
+ "keys are listed using status line similar to ISTRUSTED";
static gpg_error_t
cmd_listtrusted (assuan_context_t ctx, char *line)
{
ctrl_t ctrl = assuan_get_pointer (ctx);
- int rc;
+ gpg_error_t err;
+ int opt_status;
- (void)line;
+ opt_status = has_option (line, "--status");
if (ctrl->restricted)
return leave_cmd (ctx, gpg_error (GPG_ERR_FORBIDDEN));
- rc = agent_listtrusted (ctx);
- return leave_cmd (ctx, rc);
+ err = agent_listtrusted (ctrl, ctx, opt_status);
+ return leave_cmd (ctx, err);
}