mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 09:28:05 +00:00
Better check for XKEK content.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
35d5d5e94e
commit
001d076fdf
1 changed files with 2 additions and 2 deletions
|
|
@ -93,7 +93,7 @@ int cmd_key_domain() {
|
|||
if (2 * p2 >= tf_kd_size) {
|
||||
return SW_INCORRECT_P1P2();
|
||||
}
|
||||
if (current_dkeks == 0xff && !tf) { //XKEK have always 0xff
|
||||
if (current_dkeks == 0xff && !file_has_data(tf)) { //XKEK have always 0xff
|
||||
return SW_REFERENCE_NOT_FOUND();
|
||||
}
|
||||
}
|
||||
|
|
@ -204,7 +204,7 @@ int cmd_key_domain() {
|
|||
dkek_kcv(p2, res_APDU + 2);
|
||||
res_APDU_size = 2 + 8;
|
||||
file_t *tf = search_file(EF_XKEK + p2);
|
||||
if (tf) {
|
||||
if (file_has_data(tf)) {
|
||||
memcpy(res_APDU + 10, file_get_data(tf), file_get_size(tf));
|
||||
res_APDU_size += file_get_size(tf);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue