diff options
author | Werner Koch <[email protected]> | 2020-04-07 14:00:11 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2020-04-07 14:03:11 +0000 |
commit | 42ddcc87f4bca40d605d133b6cdb4e761a49a1c9 (patch) | |
tree | 7b4f9db3961f8f9616cde3d01e6971c09acaa6c4 /scd/iso7816.c | |
parent | tools: Use internal regexp routines. (diff) | |
download | gnupg-42ddcc87f4bca40d605d133b6cdb4e761a49a1c9.tar.gz gnupg-42ddcc87f4bca40d605d133b6cdb4e761a49a1c9.zip |
scd:p15: Fix decrypt followed by sign problem for D-Trust cards.
* scd/iso7816.c (iso7816_select_mf): New.
* scd/app-p15.c (card_product_t): New.
(struct app_local_s): Add field 'card_product'.
(read_ef_tokeninfo): Detect D-Trust card.
(prepare_verify_pin): Switch to D-Trust AID.
(do_decipher): Restore a SE for D-TRust cards. Chnage the passing
indicator to 0x81.
--
Using what I learned from a USB trace running the Governikus Signer
Software on Windows this fixes the left over problem with the new
D-Trust card support.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'scd/iso7816.c')
-rw-r--r-- | scd/iso7816.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scd/iso7816.c b/scd/iso7816.c index 9d9ee2d66..96d016a26 100644 --- a/scd/iso7816.c +++ b/scd/iso7816.c @@ -145,6 +145,17 @@ iso7816_select_application_ext (int slot, const char *aid, size_t aidlen, } +/* Simple MF selection as supported by some cards. */ +gpg_error_t +iso7816_select_mf (int slot) +{ + int sw; + + sw = apdu_send_simple (slot, 0, 0x00, CMD_SELECT_FILE, 0x000, 0x0c, -1, NULL); + return map_sw (sw); +} + + gpg_error_t iso7816_select_file (int slot, int tag, int is_dir) { |