From f7e00dc73dd0a71e21a30e2b4393a6865ef05718 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 18 Apr 2023 12:04:15 +0200 Subject: scd: On a Yubikey re-select the last app after the use of APDU. * scd/app-common.h (struct card_ctx_s): Add maybe_check_aid flag. * scd/command.c (cmd_apdu): Set it. * scd/app.c (check_external_interference): Consult this flag. (maybe_switch_app): Do a re-select if this flag is set. -- After the gpg-card tool has issued a Yubikey specific command the current application is not anymore correctly selected. This then results in all kind of errors. We detect this now and try to re-select the last app. --- scd/command.c | 1 + 1 file changed, 1 insertion(+) (limited to 'scd/command.c') diff --git a/scd/command.c b/scd/command.c index 0f0c6c9df..635bb350e 100644 --- a/scd/command.c +++ b/scd/command.c @@ -2195,6 +2195,7 @@ cmd_apdu (assuan_context_t ctx, char *line) unsigned char *result = NULL; size_t resultlen; + card->maybe_check_aid = 1; rc = apdu_send_direct (card->slot, exlen, apdu, apdulen, handle_more, NULL, &result, &resultlen); -- cgit v1.2.3