mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 09:28:05 +00:00
Fix with reading dynamic files.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
1918a5769c
commit
44b3792166
1 changed files with 1 additions and 2 deletions
3
sc_hsm.c
3
sc_hsm.c
|
|
@ -1024,7 +1024,6 @@ static int cmd_update_ef() {
|
|||
uint16_t offset = 0;
|
||||
uint16_t data_len = 0;
|
||||
file_t *ef = NULL;
|
||||
printf("%x %x %x\r\n",p1,p2,fid);
|
||||
if (!isUserAuthenticated)
|
||||
return SW_SECURITY_STATUS_NOT_SATISFIED();
|
||||
if (fid == 0x0)
|
||||
|
|
@ -1065,7 +1064,7 @@ static int cmd_update_ef() {
|
|||
else {
|
||||
if (fid == 0x0 && !ef)
|
||||
return SW_FILE_NOT_FOUND();
|
||||
if (!(ef = search_by_fid(fid, NULL, SPECIFY_EF)) && !(ef = search_dynamic_file(fid)))
|
||||
else if (fid != 0x0 && !(ef = search_by_fid(fid, NULL, SPECIFY_EF)) && !(ef = search_dynamic_file(fid)))
|
||||
return SW_FILE_NOT_FOUND();
|
||||
if (offset == 0) {
|
||||
int r = flash_write_data_to_file(ef, data, data_len);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue