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
Loading
Please register or sign in to comment