mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-27 22:09:18 +00:00
Fix saving imported DKEK.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
f022c3235d
commit
64cf9097e3
1 changed files with 2 additions and 0 deletions
2
sc_hsm.c
2
sc_hsm.c
|
|
@ -466,6 +466,7 @@ static int cmd_initialize() {
|
|||
encrypt(session_pin, tmp_dkek, tmp_dkek+IV_SIZE, 32);
|
||||
file_t *tf = search_by_fid(EF_DKEK, NULL, SPECIFY_EF);
|
||||
flash_write_data_to_file(tf, tmp_dkek, sizeof(tmp_dkek));
|
||||
low_flash_available();
|
||||
}
|
||||
return SW_OK();
|
||||
}
|
||||
|
|
@ -528,6 +529,7 @@ static int cmd_import_dkek() {
|
|||
encrypt(session_pin, tmp_dkek, tmp_dkek+IV_SIZE, 32);
|
||||
flash_write_data_to_file(tf, tmp_dkek, sizeof(tmp_dkek));
|
||||
memset(tmp_dkek, 0, sizeof(tmp_dkek));
|
||||
low_flash_available();
|
||||
}
|
||||
}
|
||||
res_APDU[0] = dkeks;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue