scd: APP centric approach for device management.
authorNIIBE Yutaka <gniibe@fsij.org>
Wed, 28 Dec 2016 03:29:17 +0000 (12:29 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Wed, 28 Dec 2016 03:29:17 +0000 (12:29 +0900)
commit4cc9fc5eb9bd91d943c185d59da4a2b4cb885ee6
tree35e893cdc578bbf33f3e9de350581177392f60a0
parentf9882d8336feea96e3b5e250e9093f8cca01e08b
scd: APP centric approach for device management.

* scd/app.c (lock_app): Rename from lock_reader and use internal field
of APP.
(unlock_app): Likewise.
(app_dump_state): Use APP.
(application_notify_card_reset): Remove.
(check_conflict): Change API for APP, instead of SLOT.
(check_application_conflict): Likewise.
(release_application_internal): New.
(app_reset): New.
(app_new_register): New.
(select_application): Change API for APP, instead of SLOT.
(deallocate_app, release_application): Modify for manage link.
(report_change): New.
(scd_update_reader_status_file): Moved from command.c and
use APP list, instead of VREADER.
(initialize_module_command): Moved from command.c.

* scd/command.c (TEST_CARD_REMOVAL): Remove.
(IS_LOCKED): Simplify.
(vreader_table): Remove.
(vreader_slot, update_card_removed): Remove.
(do_reset): Call app_reset.
(get_current_reader): Remove.
(open_card): Add SCAN arg.
(cmd_serialno): No retry, since retry is done in lower layer in apdu.c.
No do_reset, since it is done in lower layer.
Add clearing card_removed flag.
(cmd_disconnect): Call apdu_disconnect.
(send_client_notifications): Modify for APP.
(update_reader_status_file): Remove.

--

APP is the abstraction of the card application.  For management of
cards, it is better to focus on the APP instead of the physical reader.
This change makes support of multiple card/token easier.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
scd/app-common.h
scd/app.c
scd/command.c
scd/scdaemon.h