1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Fix a gpg2 problem with removed cards.

Allow runtime conf change for scdaemon.
New commands for scdaemon.
This commit is contained in:
Werner Koch 2009-02-27 14:36:59 +00:00
parent 618afc4231
commit ec4a3eb3c5
9 changed files with 143 additions and 16 deletions

View file

@ -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)