Do not fail if we found unknown tag or the count does not match

* The HID tokens present such undocumented tags
This commit is contained in:
Jakub Jelen 2018-06-18 13:57:29 +02:00 committed by Frank Morgner
parent bf3382d4d9
commit 3a7a1ba31f
1 changed files with 6 additions and 3 deletions

View File

@ -1254,15 +1254,18 @@ static int cac_get_properties(sc_card_t *card, cac_properties_t *prop)
default:
/* ignore tags we don't understand */
sc_debug(card->ctx, SC_LOG_DEBUG_VERBOSE,
"TAG: Unknown (0x%02x)",tag );
sc_log(card->ctx, "TAG: Unknown (0x%02x), len=%"
SC_FORMAT_LEN_SIZE_T"u", tag, len);
break;
}
}
free(rbuf);
/* sanity */
if (i != prop->num_objects)
return SC_ERROR_INVALID_DATA;
sc_log(card->ctx, "The announced number of objects (%u) "
"did not match reality (%"SC_FORMAT_LEN_SIZE_T"u)",
prop->num_objects, i);
prop->num_objects = i;
return SC_SUCCESS;
}