From fa4f716917e545a98e7c22469c51e980aa79443d Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 18 Apr 2023 17:04:58 +0200 Subject: gpg: Make sure that we are not accidently working with the PIV app. * g10/call-agent.c (agent_scd_switchapp): New. * g10/card-util.c (get_info_for_key_operation): Call it. -- It may happen that the active card was last used for PIV and in that case certain commands will fail because they assume the OpenPGP app. Fortunately we have a pretty central place to assure that the right app has been selected. The bug can be easily noticed on Windows. GnuPG-bug-id: 6378 --- g10/call-agent.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'g10/call-agent.h') diff --git a/g10/call-agent.h b/g10/call-agent.h index a3f234ade..80595cacc 100644 --- a/g10/call-agent.h +++ b/g10/call-agent.h @@ -108,6 +108,9 @@ gpg_error_t agent_scd_keypairinfo (ctrl_t ctrl, const char *keyref, /* Return list of cards. */ int agent_scd_cardlist (strlist_t *result); +/* Switch/assure a certain application. */ +gpg_error_t agent_scd_switchapp (const char *appname); + /* Free a keypair info list. */ void free_keypair_info (keypair_info_t l); -- cgit v1.2.3