Fix deleting KEK when a key is present in the key domain.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-08-13 00:50:22 +02:00
parent da841b82d4
commit 2e88422c86

View File

@@ -966,7 +966,7 @@ static int cmd_key_domain() {
else if (p1 == 0x1 || p1 == 0x3 || p1 == 0x4) { //key domain setup
if (p1 == 0x1 && apdu.nc != 1)
return SW_WRONG_LENGTH();
if (p1 == 0x3 || p1 == 0x4) { //if key domain is not empty, command is denied
if (p1 == 0x3) { //if key domain is not empty, command is denied
for (int i = 0; i < dynamic_files; i++) {
if (get_key_domain(&dynamic_file[i]) == p2)
return SW_FILE_EXISTS();