diff options
author | NIIBE Yutaka <[email protected]> | 2019-08-21 02:16:12 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2019-08-21 03:01:21 +0000 |
commit | 4781c4a86608b57f9d1daf55b9b2970130fe6120 (patch) | |
tree | 5a8f6b04dbead3858ab6aebf7739194ad2dc671c | |
parent | scd: Fix resetting CARD_CTX. (diff) | |
download | gnupg-4781c4a86608b57f9d1daf55b9b2970130fe6120.tar.gz gnupg-4781c4a86608b57f9d1daf55b9b2970130fe6120.zip |
scd: Fix how select_additional_application is called.
* scd/app.c (check_application_conflict): Check against current APP.
(select_additional_application): Update current_apptype of CTRL.
Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r-- | scd/app.c | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -270,8 +270,6 @@ check_application_conflict (card_t card, const char *name, const unsigned char *serialno_bin, size_t serialno_bin_len) { - app_t app; - if (!card || !name) return 0; if (!card->app) @@ -284,12 +282,6 @@ check_application_conflict (card_t card, const char *name, return 0; /* The card does not match the requested S/N. */ } - /* Check whether the requested NAME matches any already selected - * application. */ - for (app = card->app; app; app = app->next) - if (!ascii_strcasecmp (strapptype (app->apptype), name)) - return 0; - if (card->app->apptype == APPTYPE_UNDEFINED) return 0; @@ -664,7 +656,7 @@ select_application (ctrl_t ctrl, const char *name, card_t *r_card, card_top = card; } - ctrl->current_apptype = card->app ? card->app->apptype : 0; + ctrl->current_apptype = card->app ? card->app->apptype : APPTYPE_NONE; } unlock_card (card); } @@ -712,9 +704,10 @@ select_additional_application (ctrl_t ctrl, const char *name) * maybe_switch_app will do that anyway. */ err = 0; app = NULL; + ctrl->current_apptype = req_apptype; + log_debug ("current_apptype is set to %s\n", name); goto leave; } - app = NULL; /* Allocate a new app object. */ app = xtrycalloc (1, sizeof *app); |