mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 09:28:05 +00:00
Add sanitize check.
Only pages 0 and 1 are allowed for reading. Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
eaf3d051e3
commit
cbd9a5d296
1 changed files with 3 additions and 0 deletions
|
|
@ -261,6 +261,9 @@ int cmd_extras() {
|
|||
}
|
||||
uint16_t row = (apdu.data[0] << 8) | apdu.data[1];
|
||||
if (apdu.nc == 2) {
|
||||
if (row > 0xbf) {
|
||||
return SW_WRONG_DATA();
|
||||
}
|
||||
memcpy(res_APDU, otp_buffer(row), apdu.ne);
|
||||
res_APDU_size = apdu.ne;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue