1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-02 12:01:32 +01:00

scd: Serialize CARD access for send_card_and_app_list.

* scd/app.c (send_card_and_app_list): Lock the CARD.

--

GnuPG-bug-id: 7323
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2024-11-06 11:34:01 +09:00 committed by Werner Koch
parent b30e0164de
commit 394a6feb22
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -2762,9 +2762,14 @@ send_card_and_app_list (ctrl_t ctrl, card_t wantcard, int with_apps)
for (n=0; n < ncardlist; n++) for (n=0; n < ncardlist; n++)
{ {
if (wantcard && wantcard != cardlist[n]) card_t card = cardlist[n];
if (wantcard && wantcard != card)
continue; continue;
err = send_serialno_and_app_status (cardlist[n], with_apps, ctrl);
lock_card (card, ctrl);
err = send_serialno_and_app_status (card, with_apps, ctrl);
unlock_card (card);
if (err) if (err)
goto leave; goto leave;
} }