Hide internal files from GET DATA and SELECT.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2026-08-14 14:01:20 +02:00
parent 3293de8f31
commit b03a350330
2 changed files with 11 additions and 1 deletions
+8 -1
View File
@@ -29,7 +29,14 @@ int cmd_get_data(void) {
uint16_t requested_fid = fid;
file_t *ef;
if (!(ef = file_search_by_fid(fid, NULL, SPECIFY_EF))) {
return SW_REFERENCE_NOT_FOUND();
return SW_WRONG_P1P2();
}
if (fid == EF_RESET_CODE ||
((file_get_type(ef) & FILE_TYPE_INTERNAL_EF) &&
fid != EF_PRIV_DO_1 && fid != EF_PRIV_DO_2 &&
fid != EF_PRIV_DO_3 && fid != EF_PRIV_DO_4)) {
return SW_WRONG_P1P2();
}
if (fid == EF_PRIV_DO_3) {
if (!has_pw2) {
+3
View File
@@ -73,6 +73,9 @@ int cmd_select(void) {
}
}
}
if (p1 <= 0x02 && pe && (file_get_type(pe) & FILE_TYPE_INTERNAL_EF)) {
return SW_REFERENCE_NOT_FOUND();
}
if ((p2 & 0xfc) == 0x00 || (p2 & 0xfc) == 0x04) {
if ((p2 & 0xfc) == 0x04) {
file_process_fci(pe, 0);