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 (cherry picked from commit fe8b1820ef9fdddb29754677549b38ae1e84dc0d) (cherry picked from commit dccb5d460f71d44b2fab524e829224867a263b1d) (cherry picked from commit 2a80a4e485739b764ce3908538353344588f88ec)
Loading
Please register or sign in to comment