Fix particular case where an EF has masked types.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2023-04-27 11:43:20 +02:00
parent 46e7d3a181
commit 38283f588d
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -74,15 +74,18 @@ void process_fci(const file_t *pe, int fmd) {
res_APDU[res_APDU_size++] = 0x82;
res_APDU[res_APDU_size++] = 1;
res_APDU[res_APDU_size] = 0;
if (pe->type == FILE_TYPE_INTERNAL_EF) {
if (pe->type & FILE_TYPE_INTERNAL_EF) {
res_APDU[res_APDU_size++] |= 0x08;
}
else if (pe->type == FILE_TYPE_WORKING_EF) {
else if (pe->type & FILE_TYPE_WORKING_EF) {
res_APDU[res_APDU_size++] |= pe->ef_structure & 0x7;
}
else if (pe->type == FILE_TYPE_DF) {
else if (pe->type & FILE_TYPE_DF) {
res_APDU[res_APDU_size++] |= 0x38;
}
else {
res_APDU_size++;
}
res_APDU[res_APDU_size++] = 0x83;
res_APDU[res_APDU_size++] = 2;