diff options
Diffstat (limited to 'scd')
-rw-r--r-- | scd/command.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scd/command.c b/scd/command.c index 6e1a6e223..b607523dd 100644 --- a/scd/command.c +++ b/scd/command.c @@ -1877,11 +1877,13 @@ static const char hlp_getinfo[] = " - Return a list of active apps on all inserted cards.\n" " cmd_has_option CMD OPT\n" " - Returns OK if command CMD has option OPT.\n" + " dump_state - Dump internal infos to the log stream.\n" " apdu_strerror NUMBER\n" " - Return a string for a status word.\n"; static gpg_error_t cmd_getinfo (assuan_context_t ctx, char *line) { + ctrl_t ctrl = assuan_get_pointer (ctx); int rc = 0; const char *s; @@ -1901,6 +1903,7 @@ cmd_getinfo (assuan_context_t ctx, char *line) && (line[14] == ' ' || line[14] == '\t' || !line[14])) { char *cmd, *cmdopt; + line += 14; while (*line == ' ' || *line == '\t') line++; @@ -1946,7 +1949,6 @@ cmd_getinfo (assuan_context_t ctx, char *line) } else if (!strcmp (line, "status")) { - ctrl_t ctrl = assuan_get_pointer (ctx); char flag; if (open_card (ctrl)) @@ -1983,13 +1985,11 @@ cmd_getinfo (assuan_context_t ctx, char *line) } else if (!strcmp (line, "card_list")) { - ctrl_t ctrl = assuan_get_pointer (ctx); rc = app_send_card_list (ctrl); } else if (!strcmp (line, "active_apps")) { - ctrl_t ctrl = assuan_get_pointer (ctx); card_t card = card_get (ctrl, NULL); if (!card) @@ -2002,7 +2002,6 @@ cmd_getinfo (assuan_context_t ctx, char *line) } else if (!strcmp (line, "all_active_apps")) { - ctrl_t ctrl = assuan_get_pointer (ctx); rc = app_send_active_apps (NULL, ctrl); } else if ((s=has_leading_keyword (line, "apdu_strerror"))) @@ -2011,6 +2010,10 @@ cmd_getinfo (assuan_context_t ctx, char *line) s = apdu_strerror (ul); rc = assuan_send_data (ctx, s, strlen (s)); } + else if (!strcmp (line, "dump_state")) + { + app_dump_state (); + } else rc = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT"); return rc; |