aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2017-01-18 06:19:38 +0000
committerNIIBE Yutaka <[email protected]>2017-01-18 06:19:38 +0000
commit8b1f24a29ebc7651437c01990215a55b1136dae0 (patch)
tree0993bc9774f78b0428143135806ec38a3004becf /scd/app.c
parentbuild: Handle packages with dashes in --find-version. (diff)
downloadgnupg-8b1f24a29ebc7651437c01990215a55b1136dae0.tar.gz
gnupg-8b1f24a29ebc7651437c01990215a55b1136dae0.zip
scd: Add "card_list" sub command for GETINFO.
* scd/app.c (app_send_card_list): New. * scd/command.c (cmd_getinfo): Fix "status" sub command. Add "card_list" sub command. Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to '')
-rw-r--r--scd/app.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/scd/app.c b/scd/app.c
index 06850d87f..681acb822 100644
--- a/scd/app.c
+++ b/scd/app.c
@@ -1103,3 +1103,21 @@ app_list_finish (void)
{
npth_mutex_unlock (&app_list_lock);
}
+
+void
+app_send_card_list (ctrl_t ctrl)
+{
+ app_t a;
+ char buf[65];
+
+ npth_mutex_lock (&app_list_lock);
+ for (a = app_top; a; a = a->next)
+ {
+ if (DIM (buf) < 2 * a->serialnolen + 1)
+ continue;
+
+ bin2hex (a->serialno, a->serialnolen, buf);
+ send_status_direct (ctrl, "SERIALNO", buf);
+ }
+ npth_mutex_unlock (&app_list_lock);
+}