1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

scd: Track the currently selected app.

* scd/scdaemon.h (struct server_control_s): Add 'current_apptype'.
* scd/command.c (scd_clear_current_app): New.
* scd/app.c (app_new_register): Set it.
(deallocate_card): Clear it.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2019-06-21 10:47:45 +02:00
parent 43dcf93407
commit 91e2931caa
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 29 additions and 3 deletions

View file

@ -519,9 +519,13 @@ app_new_register (int slot, ctrl_t ctrl, const char *name,
}
card->periodical_check_needed = periodical_check_needed;
card->next = card_top;
card_top = card;
/* If no current apptype is known for this session, set it now. */
if (!ctrl->current_apptype)
ctrl->current_apptype = app->apptype;
unlock_card (card);
return 0;
}
@ -684,8 +688,9 @@ deallocate_card (card_t card)
xfree (a);
}
xfree (card->serialno);
scd_clear_current_app (card);
xfree (card->serialno);
unlock_card (card);
xfree (card);
}