mirror of
https://github.com/polhenarejos/pico-openpgp.git
synced 2026-08-27 07:05:07 +01:00
Hide internal files from GET DATA and SELECT.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user