Adding acl and pin checks.

If pin is blocked, is always blocked despite correct login.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-02-24 20:00:37 +01:00
parent fce1a30f56
commit 8657758cf2
3 changed files with 30 additions and 12 deletions

4
file.c
View File

@@ -157,6 +157,10 @@ bool is_parent(const file_t *child, const file_t *parent) {
return is_parent(&file_entries[child->parent], parent);
}
file_t *get_parent(file_t *f) {
return &file_entries[f->parent];
}
file_t *search_by_name(uint8_t *name, uint16_t namelen) {
for (file_t *p = file_entries; p != file_last; p++) {
if (p->name && *p->name == apdu.cmd_apdu_data_len && memcmp(p->name+1, name, namelen) == 0) {