diff options
author | NIIBE Yutaka <[email protected]> | 2017-02-17 02:50:40 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2017-02-17 02:50:40 +0000 |
commit | 99d4dfe83661d05ef3a20ed04e6cec5647536738 (patch) | |
tree | be9c8926be1a560ea3878ddf9b7e93eea44fc738 /scd/app-common.h | |
parent | dirmngr,w32: Load all system provided certificates. (diff) | |
download | gnupg-99d4dfe83661d05ef3a20ed04e6cec5647536738.tar.gz gnupg-99d4dfe83661d05ef3a20ed04e6cec5647536738.zip |
scd: Fix RESET command handling (more).
* scd/app-common.h (struct app_ctx_s): Add reset_requested.
* scd/app.c (app_reset): Locking APP, set reset_requested.
(deallocate_app): Release the lock.
(release_application): Add LOCKED_ALREADY argument.
(scd_update_reader_status_file): Hold the lock when accessing APP.
When reset_requested is set, close the reader and deallocate APP.
* scd/command.c (open_card_with_request, cmd_restart): Follow the
change of release_application.
(send_client_notifications): Here it calls release_application holding
the lock.
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'scd/app-common.h')
-rw-r--r-- | scd/app-common.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scd/app-common.h b/scd/app-common.h index c79e36b55..38e6cc609 100644 --- a/scd/app-common.h +++ b/scd/app-common.h @@ -54,6 +54,7 @@ struct app_ctx_s { const char *apptype; unsigned int card_version; unsigned int card_status; + unsigned int reset_requested:1; unsigned int periodical_check_needed:1; unsigned int did_chv1:1; unsigned int force_chv1:1; /* True if the card does not cache CHV1. */ @@ -132,7 +133,7 @@ gpg_error_t select_application (ctrl_t ctrl, const char *name, app_t *r_app, int scan, const unsigned char *serialno_bin, size_t serialno_bin_len); char *get_supported_applications (void); -void release_application (app_t app); +void release_application (app_t app, int locked_already); gpg_error_t app_munge_serialno (app_t app); gpg_error_t app_write_learn_status (app_t app, ctrl_t ctrl, unsigned int flags); |