Closed xavo95 closed 3 years ago
Things to consider:
So encoding all lengths "properly" as default is OK. Just need to check the specs if there are fancy corner cases, because GPC 2.2.1 11.1.5 tells:
All length fields of GlobalPlatform messages and data objects defined in this specification, except for Lc and Le, are coded as defined for ASN.1 BER-TLV (see ISO 8825-1): 1 byte for a length up to 127, 2 bytes for a length up to 255, and 3 bytes for a length up to 65535, except where otherwise stated.
and there were corner cases for one byte encoding with keys at least.
eg gpc 2.2.1 11.5.2.3.1
"The length field for a Load Token is as defined for ASN.1 BER-TLV (see ISO 8825-1) except that the length 128 may also be coded on one byte as '80'."
Okay I cant today but I will try to look at it too during this week, if its okay with you
Sure, a PR is welcome, but I'd anyway fix it when working on GP at some point, thus keeipng it open.
The issue is fixed by #246 whereas the UX to warn nicely will happen at a later time.
Fix #241