diff options
| author | Werner Koch <[email protected]> | 2021-01-26 16:42:55 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2021-01-26 16:42:55 +0000 |
| commit | fc287c0552b0fe489c66bb493879f4330c34f287 (patch) | |
| tree | 70353302f713b1e1b9d3924e79c9b543865c6c04 /scd/iso7816.c | |
| parent | agent: Support ssh-agent extensions for environment variables. (diff) | |
| download | gnupg-fc287c0552b0fe489c66bb493879f4330c34f287.tar.gz gnupg-fc287c0552b0fe489c66bb493879f4330c34f287.zip | |
scd:p15: First step towards real CardOS 5 support.
* scd/iso7816.c (iso7816_select_path): Add arg from_cdf.
* scd/app-nks.c (do_readkey): Adjust for this change.
* scd/app-p15.c (CARD_TYPE_CARDOS_53): New.
(IS_CARDOS_5): New.
(card_atr_list): Add standard ATR for CardOS 5.3.
(select_and_read_binary): Remove the fallback to record read hack.
(select_and_read_record): New.
(select_ef_by_path): Rework and support CardOS feature.
(read_ef_prkdf): Use read record for CardOS.
(read_ef_cdf): Ditto.
(read_ef_aodf): Ditto. Also fix bug in the detection of other
unsupported attribute types.
(verify_pin): Use IS_CARDOS_5 macro.
(app_select_p15): Force direct method for CardOS.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'scd/iso7816.c')
| -rw-r--r-- | scd/iso7816.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scd/iso7816.c b/scd/iso7816.c index f14c14f69..c68aab075 100644 --- a/scd/iso7816.c +++ b/scd/iso7816.c @@ -185,9 +185,12 @@ iso7816_select_file (int slot, int tag, int is_dir) } -/* Do a select file command with a direct path. */ +/* Do a select file command with a direct path. If FROM_CDF is set + * the starting point is the current direcory file (feature depends on + * the card). */ gpg_error_t -iso7816_select_path (int slot, const unsigned short *path, size_t pathlen) +iso7816_select_path (int slot, const unsigned short *path, size_t pathlen, + int from_cdf) { int sw, p0, p1; unsigned char buffer[100]; @@ -202,7 +205,7 @@ iso7816_select_path (int slot, const unsigned short *path, size_t pathlen) buffer[buflen++] = *path; } - p0 = 0x08; + p0 = from_cdf? 0x09 : 0x08; p1 = 0x0c; /* No FC return. */ sw = apdu_send_simple (slot, 0, 0x00, CMD_SELECT_FILE, p0, p1, buflen, (char*)buffer ); |
