diff options
| author | Werner Koch <[email protected]> | 2019-06-19 06:50:40 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2019-06-19 06:50:40 +0000 |
| commit | 5a5288d051a551a1a8f169225e62572f6ee8cb10 (patch) | |
| tree | a6e668abb9f5b8674df607244b54afde4902a9bd /scd/scdaemon.h | |
| parent | scd: KEYINFO: Send LF for --data. (diff) | |
| download | gnupg-5a5288d051a551a1a8f169225e62572f6ee8cb10.tar.gz gnupg-5a5288d051a551a1a8f169225e62572f6ee8cb10.zip | |
scd: Split data structures into app and card related objects.
* scd/app-common.h (struct card_ctx_s): New.
(struct app_ctx_s): Factor card specific fields out to card_ctx_s.
(app_get_slot): New.
* scd/scdaemon.h (card_t): New.
(struct server_control_s): Rename field app_ctx to card_ctx and change
all users.
* scd/app-dinsig.c: Use app_get_slot and adjust for chang in card
related fields.
* scd/app-geldkarte.c: Ditto.
* scd/app-nks.c: Ditto.
* scd/app-openpgp.c: Ditto.
* scd/app-p15.c: Ditto.
* scd/app-sc-hsm.c: Ditto.
* scd/app.c: Lost of changes to adjust for the changed data
structures. Change all callers.
(app_list_lock): Rename to card_list_lock.
(app_top): Remove.
(card_top): New.
(lock_app): Rename to lock_card and change arg type.
(unlock_app): Rename to unlock_card.
(app_dump_state): Print card and app info.
(app_reset): Rename to card_reset.
(app_new_register): Change for the new data structure.
(deallocate_card): Dealloc card and all apps.
(app_ref): Rename to card_ref.
(app_unref): Rename to card_unref.
(app_unref_locked): Rename to card_unref_locked.
(card_get_serialno): New.
* scd/command.c (cmd_pkdecrypt): Actually use the looked up card and
former app object and not the standard one from the context.
--
Although quite large, this is a straightforward change to separate
card/token related data from card application related data. Before
this change there was a one-to-one relation between card and
application and no way to represent several applications on a card.
The new data structure will allow for such a representation.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'scd/scdaemon.h')
| -rw-r--r-- | scd/scdaemon.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scd/scdaemon.h b/scd/scdaemon.h index 7eb08a904..f4a243703 100644 --- a/scd/scdaemon.h +++ b/scd/scdaemon.h @@ -84,6 +84,7 @@ struct #define DBG_READER (opt.debug & DBG_READER_VALUE) struct server_local_s; +struct card_ctx_s; struct app_ctx_s; struct server_control_s @@ -101,7 +102,7 @@ struct server_control_s associated. Note that this is shared with the other connections: All connections accessing the same reader are using the same application context. */ - struct app_ctx_s *app_ctx; + struct card_ctx_s *card_ctx; /* Helper to store the value we are going to sign */ struct @@ -111,6 +112,7 @@ struct server_control_s } in_data; }; +typedef struct card_ctx_s *card_t; typedef struct app_ctx_s *app_t; /*-- scdaemon.c --*/ @@ -130,8 +132,8 @@ void send_keyinfo (ctrl_t ctrl, int data, const char *keygrip_str, void popup_prompt (void *opaque, int on); -/* Take care: this function assumes that APP is locked. */ -void send_client_notifications (app_t app, int removal); +/* Take care: this function assumes that CARD is locked. */ +void send_client_notifications (card_t card, int removal); void scd_kick_the_loop (void); int get_active_connection_count (void); |
