mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 09:28:05 +00:00
Fix when importing a dkek and it fails.
Now the dkek state is returned to the previous one. Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
6a57e67629
commit
691aa3308c
1 changed files with 4 additions and 1 deletions
|
|
@ -56,8 +56,11 @@ int cmd_key_domain() {
|
|||
}
|
||||
import_dkek_share(p2, apdu.data);
|
||||
if (++current_dkeks >= dkeks) {
|
||||
if (save_dkek_key(p2, NULL) != CCID_OK)
|
||||
if (save_dkek_key(p2, NULL) != CCID_OK) {
|
||||
/* On fail, it will return to previous dkek state. */
|
||||
import_dkek_share(p2, apdu.data);
|
||||
return SW_FILE_NOT_FOUND();
|
||||
}
|
||||
}
|
||||
uint8_t t[MAX_KEY_DOMAINS*2];
|
||||
memcpy(t, kdata, tf_kd_size);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue