Fix importing dkek twice.

It is not allowed anymore.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2022-12-06 20:04:18 +01:00
parent 202c8a4b22
commit 6a57e67629
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -51,6 +51,9 @@ int cmd_key_domain() {
return SW_MEMORY_FAILURE();
if (apdu.nc < 32)
return SW_WRONG_LENGTH();
if (current_dkeks == dkeks) {
return SW_COMMAND_NOT_ALLOWED();
}
import_dkek_share(p2, apdu.data);
if (++current_dkeks >= dkeks) {
if (save_dkek_key(p2, NULL) != CCID_OK)