diff --git a/src/libopensc/iso7816.c b/src/libopensc/iso7816.c index c37bbf04..5ed0f17d 100644 --- a/src/libopensc/iso7816.c +++ b/src/libopensc/iso7816.c @@ -430,6 +430,10 @@ iso7816_process_fci(struct sc_card *card, struct sc_file *file, if (tag != NULL && taglen) sc_file_set_sec_attr(file, tag, taglen); + tag = sc_asn1_find_tag(ctx, p, len, 0x88, &taglen); + if (tag != NULL && taglen == 1) + file->sid = *tag; + tag = sc_asn1_find_tag(ctx, p, len, 0x8A, &taglen); if (tag != NULL && taglen==1) { if (tag[0] == 0x01) diff --git a/src/libopensc/types.h b/src/libopensc/types.h index 0bf0c29b..38f4c4bf 100644 --- a/src/libopensc/types.h +++ b/src/libopensc/types.h @@ -225,7 +225,8 @@ typedef struct sc_file { unsigned int type, ef_structure, status; /* See constant values defined above */ unsigned int shareable; /* true(1), false(0) according to ISO 7816-4:2005 Table 14 */ size_t size; /* Size of file (in bytes) */ - int id; /* Short file id (2 bytes) */ + int id; /* file identifier (2 bytes) */ + int sid; /* short EF identifier (1 byte) */ struct sc_acl_entry *acl[SC_MAX_AC_OPS]; /* Access Control List */ int record_length; /* In case of fixed-length or cyclic EF */ diff --git a/src/tools/opensc-explorer.c b/src/tools/opensc-explorer.c index cefc3e16..fa2581bb 100644 --- a/src/tools/opensc-explorer.c +++ b/src/tools/opensc-explorer.c @@ -786,8 +786,10 @@ static int do_info(int argc, char **argv) st = "Unknown File"; break; } - printf("\n%s ID %04X\n\n", st, file->id); - printf("%-15s%s\n", "File path:", path_to_filename(&path, '/')); + printf("\n%s ID %04X", st, file->id); + if (file->sid) + printf(", SFI %02X", file->sid); + printf("\n\n%-15s%s\n", "File path:", path_to_filename(&path, '/')); printf("%-15s%lu bytes\n", "File size:", (unsigned long) file->size); if (file->type == SC_FILE_TYPE_DF) {