C4 rejects payloads longer than four bytes, preventing retry-counter corruption.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2026-07-12 22:47:06 +02:00
parent a83561c597
commit 6e7bb818ae
+3
View File
@@ -46,6 +46,9 @@ int cmd_put_data(void) {
return SW_SECURITY_STATUS_NOT_SATISFIED();
}
if (fid == EF_PW_STATUS) {
if (apdu.nc > 4) {
return SW_WRONG_DATA();
}
fid = EF_PW_PRIV;
if (apdu.nc == 0) {
return SW_WRONG_LENGTH();