mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-05-07 12:43:06 +00:00
Fix: FPI containing wrong file length.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
2a770ee7c9
commit
1688ea540e
1 changed files with 7 additions and 4 deletions
11
file.c
11
file.c
|
|
@ -29,11 +29,14 @@ void process_fci(const file_t *pe) {
|
|||
|
||||
res_APDU[res_APDU_size++] = 0x81;
|
||||
res_APDU[res_APDU_size++] = 2;
|
||||
if (pe->data)
|
||||
memcpy(res_APDU+res_APDU_size, pe->data, 2);
|
||||
else
|
||||
if (pe->data) {
|
||||
res_APDU[res_APDU_size++] = pe->data[1];
|
||||
res_APDU[res_APDU_size++] = pe->data[0];
|
||||
}
|
||||
else {
|
||||
memset(res_APDU+res_APDU_size, 0, 2);
|
||||
res_APDU_size += 2;
|
||||
res_APDU_size += 2;
|
||||
}
|
||||
|
||||
res_APDU[res_APDU_size++] = 0x82;
|
||||
res_APDU[res_APDU_size++] = 1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue