aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2017-11-21 02:52:54 +0000
committerNIIBE Yutaka <[email protected]>2017-11-21 03:19:15 +0000
commit0bb7fd0cab2d53cd0d44b21301b23edfe817e66b (patch)
tree0ae3b8ebc88c4a790abad40cb0cfcdb14f77b658 /scd/app.c
parentPost release updates (diff)
downloadgnupg-0bb7fd0cab2d53cd0d44b21301b23edfe817e66b.tar.gz
gnupg-0bb7fd0cab2d53cd0d44b21301b23edfe817e66b.zip
scd: Enable card removal check after select_application.
* scd/apdu.c (open_ccid_reader): Fix error handling of ccid_get_atr. * scd/app.c (select_application): Always kick the loop if new APP. * scd/ccid-driver.c (ccid_open_usb_reader): Don't setup at open. (ccid_slot_status): Setup interrupt transfer when !ON_WIRE. -- We can use the interrupt transfer to be notified about card status change. In this case, we don't need to issue PC_to_RDR_GetSlotStatus command. This change improve the setup the notification; it should be done after registration of APP. When the setup is done just after opening the USB connection (before issuing PC_to_RDR_IccPowerOn), a reader might notifies about no card availability (because of not yet powered on), even though the card is ready to be powered on. GnuPG-bug-id: 3508 Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'scd/app.c')
-rw-r--r--scd/app.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/scd/app.c b/scd/app.c
index ec04b404f..f3f1205f8 100644
--- a/scd/app.c
+++ b/scd/app.c
@@ -323,7 +323,7 @@ select_application (ctrl_t ctrl, const char *name, app_t *r_app,
if (scan || !app_top)
{
struct dev_list *l;
- int periodical_check_needed = 0;
+ int new_app = 0;
/* Scan the devices to find new device(s). */
err = apdu_dev_list_start (opt.reader_port, &l);
@@ -349,8 +349,7 @@ select_application (ctrl_t ctrl, const char *name, app_t *r_app,
{
err = app_new_register (slot, ctrl, name,
periodical_check_needed_this);
- if (periodical_check_needed_this)
- periodical_check_needed = 1;
+ new_app++;
}
if (err)
@@ -359,9 +358,8 @@ select_application (ctrl_t ctrl, const char *name, app_t *r_app,
apdu_dev_list_finish (l);
- /* If periodical check is needed for new device(s), kick the
- scdaemon loop. */
- if (periodical_check_needed)
+ /* If new device(s), kick the scdaemon loop. */
+ if (new_app)
scd_kick_the_loop ();
}