scd: allow to query FCP when selecting an application
* scd/iso7816.c (iso7816_select_application_ext): Add flag die query FCP * scd/iso7816.h: define new response type flags * scd/app.c: apply new flags * scd/app-piv.c: ditto * scd/app-p15.c: query FCI during application selection and fallback to FCP if file ID tag 0x83 is not found.
Some cards (for example STARCOS 3.7 based D-Trust Cards 6.1/6.4) don't
return the file ID of the application in the FCI response of the SELECT
command (P2=0x00). Instead the file ID is only returned if the FCP is
queried in the SELECT command (P2=0x04).
If the file ID is not returned in the FCI, we will fall back to the FCP
and then to the default home file ID if the FCP also fails.
Patch was garbled and thus manually applied by wk@gnupg.org. Blame me
for any faults.
- Signed-off-by: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>