Home GnuPG
Diffusion GnuPG fa4f716917e5

gpg: Make sure that we are not accidently working with the PIV app.

Description

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.

Details

Provenance
wernerAuthored on Apr 18 2023, 5:04 PM
Parents
rGf7e00dc73dd0: scd: On a Yubikey re-select the last app after the use of APDU.
Branches
Unknown
Tags
Unknown
Tasks
T6378: keytocard: invalid value