diff --git a/scd/app.c b/scd/app.c index 7d4518024..d09b931e6 100644 --- a/scd/app.c +++ b/scd/app.c @@ -2749,16 +2749,13 @@ send_serialno_and_app_status (card_t card, int with_apps, ctrl_t ctrl) /* Common code for app_send_card_list and app_send_active_apps. */ static gpg_error_t -send_card_and_app_list (ctrl_t ctrl, card_t wantcard, int with_apps) +send_card_and_app_list (ctrl_t ctrl, int with_apps) { gpg_error_t err; card_t c; card_t *cardlist = NULL; int n, ncardlist; - if (wantcard) - return send_serialno_and_app_status (wantcard, with_apps, ctrl); - card_list_r_lock (); for (n=0, c = card_top; c; c = c->next) n++; @@ -2781,8 +2778,6 @@ send_card_and_app_list (ctrl_t ctrl, card_t wantcard, int with_apps) { card_t card = cardlist[n]; - if (wantcard && wantcard != card) - continue; lock_card (card, ctrl); err = send_serialno_and_app_status (card, with_apps, ctrl); unlock_card (card); @@ -2803,7 +2798,7 @@ send_card_and_app_list (ctrl_t ctrl, card_t wantcard, int with_apps) gpg_error_t app_send_card_list (ctrl_t ctrl) { - return send_card_and_app_list (ctrl, NULL, 0); + return send_card_and_app_list (ctrl, 0); } @@ -2812,7 +2807,10 @@ app_send_card_list (ctrl_t ctrl) gpg_error_t app_send_active_apps (card_t card, ctrl_t ctrl) { - return send_card_and_app_list (ctrl, card, 1); + if (!card) + return send_card_and_app_list (ctrl, 1); + else + return send_serialno_and_app_status (card, 1, ctrl); }