mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2024-09-20 11:20:08 +00:00
Added key domain deletion.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
ce410dae65
commit
bf70a08c9f
@ -775,12 +775,15 @@ static int cmd_key_domain() {
|
||||
return SW_REFERENCE_NOT_FOUND();
|
||||
}
|
||||
}
|
||||
else if (p1 == 0x1) { //key domain setup
|
||||
if (apdu.nc != 1)
|
||||
else if (p1 == 0x1 || p1 == 0x3) { //key domain setup
|
||||
if (p1 == 0x1 && apdu.nc != 1)
|
||||
return SW_WRONG_LENGTH();
|
||||
uint8_t t[MAX_KEY_DOMAINS*2];
|
||||
memcpy(t, kdata, tf_kd_size);
|
||||
t[2*p2] = dkeks = apdu.data[0];
|
||||
if (p1 == 0x1)
|
||||
t[2*p2] = dkeks = apdu.data[0];
|
||||
else
|
||||
t[2*p2] = dkeks = 0;
|
||||
t[2*p2+1] = current_dkeks = 0;
|
||||
if (flash_write_data_to_file(tf_kd, t, tf_kd_size) != CCID_OK)
|
||||
return SW_EXEC_ERROR();
|
||||
|
Loading…
Reference in New Issue
Block a user