Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 33a48fca authored by Preeti Ahuja's avatar Preeti Ahuja
Browse files

Stk: Ensure that APDU input length does NOT exceed 255 Bytes.

- Depending on the encoding , the number of characters that
can be stored in 255 bytes varies. See details below.
- detect the current encoding used and enforce max length

Details:
As per TS 102.223 Annex C, Structure of CAT communications,
the APDU length can be max 255 bytes. This leaves only 239 bytes for
user input string. CMD details TLV + Device IDs TLV + Result TLV + Other
details of TextString TLV not including user input take 16 bytes.

If UCS2 encoding is used, maximum 118 UCS2 chars can be encoded in 238
bytes.Each UCS2 char takes 2 bytes. Byte Order Mask(BOM), 0xFEFF takes
2 bytes.

If GSM 7 bit default(use 8 bits to represent a 7 bit char) format is
used,maximum 239 chars can be encoded in 239 bytes since each char takes
1 byte.

No issues for GSM 7 bit packed format encoding.

Change-Id: If5ead7ffa742d67718986b9bce1db05f615c1db4
parent d20afc9b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment