Home GnuPG
Diffusion GnuPG 471b06e91b6a

scd:p15: Fix decrypt followed by sign problem for D-Trust cards.

Description

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.  Change the padding
indicator to 0x81.
* common/percent.c (percent_data_escape): new.  Taken from master.

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.

Backported from master. This required to add the percent_data_escape
function we introduced in master on 2018-07-02:

commit 58baf40af641f8cbf597e508a292e85ae94688f1
common: New function percent_data_escape.
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Apr 7 2020, 4:00 PM
Parents
rG4148976841d1: scd:p15: Emit MANUFACTURER, $ENCRKEYID, $SIGNKEYID.
Branches
Unknown
Tags
Unknown