mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 09:28:05 +00:00
Added kek deletion in a particular key domain.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
23da8047bc
commit
73fb61070f
1 changed files with 4 additions and 1 deletions
|
|
@ -775,7 +775,7 @@ static int cmd_key_domain() {
|
|||
return SW_REFERENCE_NOT_FOUND();
|
||||
}
|
||||
}
|
||||
else if (p1 == 0x1 || p1 == 0x3) { //key domain setup
|
||||
else if (p1 == 0x1 || p1 == 0x3 || p1 == 0x4) { //key domain setup
|
||||
if (p1 == 0x1 && apdu.nc != 1)
|
||||
return SW_WRONG_LENGTH();
|
||||
uint8_t t[MAX_KEY_DOMAINS*2];
|
||||
|
|
@ -788,6 +788,9 @@ static int cmd_key_domain() {
|
|||
t[2*p2] = dkeks = 0xff;
|
||||
t[2*p2+1] = 0xff;
|
||||
}
|
||||
else if (p1 == 0x4) {
|
||||
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();
|
||||
file_t *tf = file_new(EF_DKEK+p2);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue