mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
scd: Small clean up for card access.
* scd/app.c (app_get_challenge): Remove the check to ref_count. * scd/command.c (send_client_notifications): Update comments. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
50ad29f9a7
commit
5c8124b8b9
@ -2204,18 +2204,11 @@ gpg_error_t
|
|||||||
app_get_challenge (card_t card, ctrl_t ctrl,
|
app_get_challenge (card_t card, ctrl_t ctrl,
|
||||||
size_t nbytes, unsigned char *buffer)
|
size_t nbytes, unsigned char *buffer)
|
||||||
{
|
{
|
||||||
gpg_error_t err;
|
|
||||||
|
|
||||||
(void)ctrl;
|
(void)ctrl;
|
||||||
if (!nbytes || !buffer)
|
if (!nbytes || !buffer)
|
||||||
return gpg_error (GPG_ERR_INV_VALUE);
|
return gpg_error (GPG_ERR_INV_VALUE);
|
||||||
|
|
||||||
if (!card->ref_count)
|
return iso7816_get_challenge (card->slot, nbytes, buffer);
|
||||||
err = gpg_error (GPG_ERR_CARD_NOT_INITIALIZED);
|
|
||||||
else
|
|
||||||
err = iso7816_get_challenge (card->slot, nbytes, buffer);
|
|
||||||
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2851,8 +2851,16 @@ popup_prompt (void *opaque, int on)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Helper to send the clients a status change notification. Note that
|
/*
|
||||||
* this function assumes that APP is already locked. */
|
* Helper to send the clients a status change notification.
|
||||||
|
*
|
||||||
|
* When it's removal of card, this function also clean up all
|
||||||
|
* references by ctrl->card_ctx of all sessions.
|
||||||
|
*
|
||||||
|
* Note that this function assumes that all accesses to cards and
|
||||||
|
* applications are locked. By the mrsw-lock, it is guaranteed that
|
||||||
|
* no card/app is accessed, when this function is called..
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
send_client_notifications (card_t card, int removal)
|
send_client_notifications (card_t card, int removal)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user