aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2009-02-27 14:36:59 +0000
committerWerner Koch <[email protected]>2009-02-27 14:36:59 +0000
commitec4a3eb3c5b45321125a9b1fb2b8cd5ee20c52de (patch)
tree4ee2b19d3f5b44349fe36a40f28d0835e51d9fd8 /scd/app.c
parentFixed a nasty bug in scdaemon which led to a card reset if the card was (diff)
downloadgnupg-ec4a3eb3c5b45321125a9b1fb2b8cd5ee20c52de.tar.gz
gnupg-ec4a3eb3c5b45321125a9b1fb2b8cd5ee20c52de.zip
Fix a gpg2 problem with removed cards.
Allow runtime conf change for scdaemon. New commands for scdaemon.
Diffstat (limited to 'scd/app.c')
-rw-r--r--scd/app.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/scd/app.c b/scd/app.c
index 4034fa64c..d0b832843 100644
--- a/scd/app.c
+++ b/scd/app.c
@@ -22,7 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-# include <pth.h>
+#include <pth.h>
#include "scdaemon.h"
#include "app-common.h"
@@ -373,7 +373,7 @@ select_application (ctrl_t ctrl, int slot, const char *name, app_t *r_app)
}
app->ref_count = 1;
- log_debug ("USING application context (refcount=%u) (new)\n", app->ref_count);
+
lock_table[slot].app = app;
*r_app = app;
unlock_reader (slot);
@@ -381,6 +381,37 @@ select_application (ctrl_t ctrl, int slot, const char *name, app_t *r_app)
}
+char *
+get_supported_applications (void)
+{
+ const char *list[] = {
+ "openpgp",
+ "nks",
+ "p15",
+ "dinsig",
+ "geldkarte",
+ NULL
+ };
+ int idx;
+ size_t nbytes;
+ char *buffer, *p;
+
+ for (nbytes=1, idx=0; list[idx]; idx++)
+ nbytes += strlen (list[idx]) + 1 + 1;
+
+ buffer = xtrymalloc (nbytes);
+ if (!buffer)
+ return NULL;
+
+ for (p=buffer, idx=0; list[idx]; idx++)
+ if (is_app_allowed (list[idx]))
+ p = stpcpy (stpcpy (p, list[idx]), ":\n");
+ *p = 0;
+
+ return buffer;
+}
+
+
/* Deallocate the application. */
static void
deallocate_app (app_t app)