mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 09:28:05 +00:00
Fix checking key domain set.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
09724d95db
commit
4e73723747
1 changed files with 2 additions and 2 deletions
|
|
@ -103,14 +103,14 @@ int cmd_key_domain() {
|
|||
uint8_t t[MAX_KEY_DOMAINS * 2];
|
||||
memcpy(t, kdata, tf_kd_size);
|
||||
if (p1 == 0x1) {
|
||||
if (t[2 * p2] != 0xff && t[2 * p2 + 1] != 0xff) {
|
||||
if (t[2 * p2] != 0xff || t[2 * p2 + 1] != 0xff) {
|
||||
return SW_INCORRECT_P1P2();
|
||||
}
|
||||
t[2 * p2] = dkeks = apdu.data[0];
|
||||
t[2 * p2 + 1] = current_dkeks = 0;
|
||||
}
|
||||
else if (p1 == 0x3) {
|
||||
if (t[2 * p2] == 0xff || t[2 * p2 + 1] == 0xff) {
|
||||
if (t[2 * p2] == 0xff && t[2 * p2 + 1] == 0xff) {
|
||||
return SW_INCORRECT_P1P2();
|
||||
}
|
||||
t[2 * p2] = dkeks = 0xff;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue