diff options
author | Werner Koch <wk@gnupg.org> | 2004-08-05 11:24:36 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2004-08-05 11:24:36 +0200 |
commit | 818e9bad581868f8455a62fb3548b4dcc9d4cbac (patch) | |
tree | a42c59abd922f5957105fa0ce880917020fde5f6 /scd/app.c | |
parent | 2004-07-27 Moritz Schulte <moritz@g10code.com> (diff) | |
download | gnupg2-818e9bad581868f8455a62fb3548b4dcc9d4cbac.tar.xz gnupg2-818e9bad581868f8455a62fb3548b4dcc9d4cbac.zip |
* configure.ac: Changed tests for libusb to also suuport the
stable version 0.1.x.
* scdaemon.texi (Card applications): New section.
* scdaemon.c (main): New option --disable-application.
* app.c (is_app_allowed): New.
(select_application): Use it to check for disabled applications.
* ccid-driver.h (CCID_DRIVER_ERR_ABORTED): New.
* ccid-driver.c (ccid_open_reader): Support the stable 0.1 version
of libusb.
(ccid_get_atr): Handle short messages.
* apdu.c (my_rapdu_get_status): Implemented.
Diffstat (limited to 'scd/app.c')
-rw-r--r-- | scd/app.c | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -32,6 +32,19 @@ #include "tlv.h" +/* Check wether the application NAME is allowed. This does not mean + we have support for it though. */ +static int +is_app_allowed (const char *name) +{ + strlist_t l; + + for (l=opt.disabled_applications; l; l = l->next) + if (!strcmp (l->d, name)) + return 0; /* no */ + return 1; /* yes */ +} + /* If called with NAME as NULL, select the best fitting application and return a context; otherwise select the application with NAME and return a context. SLOT identifies the reader device. Returns @@ -84,11 +97,11 @@ select_application (ctrl_t ctrl, int slot, const char *name) rc = gpg_error (GPG_ERR_NOT_FOUND); - if (!name || !strcmp (name, "openpgp")) + if (rc && is_app_allowed ("openpgp") && (!name || !strcmp (name, "openpgp"))) rc = app_select_openpgp (app); - if (rc && (!name || !strcmp (name, "nks"))) + if (rc && is_app_allowed ("nks") && (!name || !strcmp (name, "nks"))) rc = app_select_nks (app); - if (rc && (!name || !strcmp (name, "dinsig"))) + if (rc && is_app_allowed ("dinsig") && (!name || !strcmp (name, "dinsig"))) rc = app_select_dinsig (app); if (rc && name) rc = gpg_error (GPG_ERR_NOT_SUPPORTED); |