opensc-explorer get: prevent sc_read_binary applied on record-based files

This commit is contained in:
carblue 2019-10-14 17:35:17 +02:00 committed by Frank Morgner
parent c1fb5b130e
commit f14043aad6
1 changed files with 2 additions and 2 deletions

View File

@ -1413,8 +1413,8 @@ static int do_get(int argc, char **argv)
check_ret(r, SC_AC_OP_SELECT, "unable to select file", current_file);
goto err;
}
if (file->type != SC_FILE_TYPE_WORKING_EF) {
fprintf(stderr, "only working EFs may be read\n");
if (file->type != SC_FILE_TYPE_WORKING_EF || file->ef_structure != SC_FILE_EF_TRANSPARENT) {
fprintf(stderr, "only transparent working EFs may be read\n");
goto err;
}
count = file->size;