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

Skip to content
Commit d24bed2f authored by Pawan Kumar Nimmagadda's avatar Pawan Kumar Nimmagadda Committed by Steve Kondik
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: I6a12b9a9c8f8b6b44c0164fc4e038c92c05284ce
parent a370fc43
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment