You are on page 1of 81

Implementation Specification SmartTrust WIB, version 1.

2002-2003 SmartTrust AB. All rights reserved. No use of the contents of this document is permitted without written authorization of SmartTrust. SmartTrust endeavors to ensure that the information in this document is correct and fairly stated, but does not accept liability for any error or omission. The development of SmartTrust products and services is continuous and published information may not be up to date. It is important to check the current position with SmartTrust. This document is not part of a contract or license save insofar as may be expressly agreed.
Document number: MPM02:0111 Revision:PA29

SmartTrust is a trademark of SmartTrust AB.

Document number: MPM02:0111 Revision:PA29

Contents
1 References______________________________________________________ 5 2 Introduction_____________________________________________________ 6 3 Terminology and Abbreviations _____________________________________ 7 3.1 Abbreviations..............................................................................................7 3.2 Terminology ...............................................................................................7 3.3 Stylistic Conventions ..................................................................................8 4 WIB implementation, GSM 03.48 over SMS___________________________ 9 4.1 Concatenated Short Messages ....................................................................9 4.2 Retransmission of failed MO SM ...............................................................9 4.3 Reply packet ...............................................................................................9 4.4 Toolkit Application Reference ...................................................................9 4.4.1 TAR type ........................................................................................10 4.4.2 TAR selection for outgoing 03.48 messages ..................................10 4.5 SMS header parameters ............................................................................11 4.6 Access control for administrative WIB commands ..................................11 4.7 Security configuration ..............................................................................11 4.8 03.48 message security .............................................................................12 4.8.1 Supported security levels................................................................12 4.8.2 Incoming 03.48 message validation ...............................................12 4.8.3 Outgoing 03.48 message protection ...............................................13 4.8.4 Replay protection............................................................................14 4.8.5 Authentication ................................................................................14 4.8.6 Ciphering ........................................................................................17 5 WIB Commands ________________________________________________ 19 5.1 Operational WIB Commands ...................................................................19 5.1.1 Submit.............................................................................................19 5.1.2 Get Input .........................................................................................19 5.1.3 Skip .................................................................................................20 5.1.4 Plug-in ............................................................................................20 5.1.5 Provide Local Information..............................................................21 5.1.6 Play Tone ........................................................................................21 5.1.7 Set Return TAR value.....................................................................21 5.1.8 Send USSD .....................................................................................22 5.1.9 Check Terminal Profile ..................................................................22 5.1.10 Execute Local Script.....................................................................22 5.1.11 Submit Extended...........................................................................23 5.1.12 Group/Ungroup Variable ..............................................................26 5.1.13 Set Up Call Extended ...................................................................26 5.1.14 Send SM Extended .......................................................................27

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

5.1.15 Timer management .......................................................................28 5.1.16 Display Text Extended .................................................................28 5.1.17 Add/Subtract .................................................................................29 5.1.18 BCD to GSM 7bit Default Alphabet Conversion .........................29 5.2 Administrative WIB Commands ..............................................................29 5.2.1 Install Plug-In .................................................................................29 5.2.2 Remove Plug-In..............................................................................30 5.2.3 Set Script Trigger Mode .................................................................31 5.2.4 Get Script Trigger Mode.................................................................32 5.2.5 Get Menu ........................................................................................32 5.2.6 Get Script Info ................................................................................32 6 Proactive SIM Command Parameters________________________________ 33 6.1 Display Text following Display Text or Check Terminal Profile WIB command .......................................................................33 6.2 Display text following Display Text Clear after Delay WIB command.........................................................................................33 6.3 Display text following Display Text Extended WIB command .................................................................................................33 6.4 Get Input ...................................................................................................33 6.5 Select Item ................................................................................................34 6.6 Send Short Message following Submit and Submit Extended WIB commands .......................................................................................34 6.7 Send Short Message following Send SM or Send SM Extended WIB command.........................................................................................34 6.8 Provide Local Information........................................................................35 6.9 Play Tone ..................................................................................................35 6.10 Set Up Idle Mode Text ...........................................................................36 6.11 Refresh ....................................................................................................36 6.12 Set Up Call..............................................................................................36 6.13 Send USSD .............................................................................................37 6.14 Timer Management.................................................................................37 6.15 Launch Browser......................................................................................37
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

7 Capabilities and Behavior_________________________________________ 38 7.1 Menu handling ..........................................................................................38 7.2 Script Execution........................................................................................38 7.2.1 Out-of-bounds Execution Restrictions ...........................................39 7.3 Addressing of Scripts in EFBytecode ............................................................39 7.3.1 Execute local script.........................................................................40 7.3.2 Menu Selection and WIB Event .....................................................41 7.4 WIB Script Size and Script Identifier Support .........................................42 7.5 Plug-in Handling.......................................................................................43 7.6 Handling of fields in ENVELOPE and TERMINAL RESPONSE ..........43 7.7 Variable Handling.....................................................................................43
2

7.8 Character Set.............................................................................................44 7.9 Wait for Response State............................................................................44 7.9.1 Default behavior .............................................................................45 7.9.2 Forced Behaviour ...........................................................................45 7.9.3 Default Progress Information .........................................................45 7.10 Event Handling .......................................................................................46 7.10.1 Description of events ....................................................................47 7.10.2 Contents of variables at start of script ..........................................48 8 Error Handling _________________________________________________ 49 9 Optional WIB features ___________________________________________ 54 9.1 Bookmarking ............................................................................................54 9.1.1 Introduction ....................................................................................54 9.1.2 Behavior for WIB without Bookmarking .......................................54 9.1.3 Configurability................................................................................54 9.1.4 Storing of Bookmarks.....................................................................55 9.1.5 Presentation and Navigation ...........................................................56 9.1.6 Management of Bookmarks............................................................56 10 WIB Setup Files _______________________________________________ 57 10.1 EFTAR (6F1A)..........................................................................................57 10.2 EFErrorText (6F02) .....................................................................................57 10.3 EFBytecode (6F03)......................................................................................58 10.4 EFSMSHeader (6F04) ...................................................................................59 10.5 EFSC (6F1B)............................................................................................59 10.5.1 Coding of 'Counters' .....................................................................60 10.5.2 Coding of 'Outgoing SPI-KIc-KID' ..............................................61 10.5.3 Coding of 'Incoming SPI-KIc-KID list' ........................................61 10.5.4 Coding of 'KIc key set' ................................................................61 10.5.5 Coding of 'KID key set' ................................................................62 10.6 EF03.48Counter (6F06) .................................................................................63 10.7 EFVersionInformation (6F07)...........................................................................63 10.8 EFWIBConfiguration (6F08)............................................................................64 10.9 EFEventConfig (6F0B)..................................................................................65 10.10 EFText (6F1C) ........................................................................................65 10.10.1 Defined text fields ......................................................................67 10.11 EFMenu (6F18)........................................................................................67 10.12 EFScriptAddress (6F1D)..............................................................................69 10.13 EFMenuTitle (6F1E) ..................................................................................71 10.14 Reserved file identifiers ........................................................................71 Annex A. Conversions between the GSM Default Alphabet and UCS2_______ 72 A.1 GSM Default Alphabet to/from UCS2 _____________________________ 73 UCS2 (Hex) ....................................................................................................73
3

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

UCS2 (Hex) ....................................................................................................73 UCS2 (Hex) ....................................................................................................73 A.2 UCS2 to GSM Default .............................................................................74 Annex B. Error codes and behaviour versus Terminal response _____________ 75 Annex C. C-code illustrating CRC32 calculation ________________________ 80

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

1 References

Ref. [CSP] [03.48] [11.14] [03.38] [03.40] [04.11] [9797] [07.05] [10646] [UCS30] [11.11] [DEA] [TDEA]

Title Client-Server Protocol Specification, WIB 1.3 3GPP TS 03.48, SIM Toolkit Secure Messaging, version 8.8.0, Release 1999 3GPP TS 11.14, SIM Application Toolkit Interface, version 8.10.0, Release 1999 GSM 03.38, Alphabet and language-specific information, version 7.2.0, Release 1998 "GSM 03.40, Technical Realization of the SMS-PP", version 7.4.0, Release 1998 GSM 04.11, Point-to-Point short message support on mobile radio interface", version 7.0.0, Release 1998 International Standard ISO/IEC 9797-1, Information technology Security techniques Message Authentication Codes (MACs) GSM 07.05", version 7.0.1, Release 1998 ISO/IEC10646: "Universal Multiple-Octet Coded Character Set (UCS); UCS2, 16 bit coding. The Unicode Standard, Version 3.0. http://www.unicode.org/ "3GPP TS 11.11, Subscriber Identity Module Mobile Equipment (SIMME) Interface", version 8.8.0 Release 99 ANSI X3.92: 1981, Data Encryption Algorithm (DEA) ANSI X9.52: 1998, Triple Data Encryption Algorithm Modes of Operation

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

2 Introduction
This specification forms together with [CSP] a description on how to implement the SmartTrust WIB. To communicate with the server component, WIB uses the client-server protocol defined in [CSP] implemented on top of the GSM 03.48protocol defined in [03.48].The GSM 03.48 protocol is independent from bearer, but the main bearer is SMS according to GSM 03.40 as defined in [03.40]. This specification specifies how to implement WIB using SMS as a bearer. In the future, other bearers might be introduced.

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

3 Terminology and Abbreviations


3.1 Abbreviations BER CRC CBC DED DES EDE IV MAC SAT SC SPI TAR WIB Basic Encoding Rules Cyclic Redundancy Check Cipher Block Chaining Decrypt-Encrypt-Decrypt Data Encryption Standard Encrypt-Decrypt-Encrypt Initialisation Vector Message Authentication Code SIM Application Toolkit Security Configuration Security Parameter Indicator. See [03.48] for details. Toolkit Application Reference. See [03.48] for details. SmartTrust WIB implemented in accordance with the current specification and [CSP]

3.2 Terminology 03.48 message X || Y


WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Shorthand notation for a Secured Command Packet as defined in [03.48]. Concatenation of bit-strings X and Y (in that order). CRC32 cyclic redundancy check algorithm. See Annex C for details. A message as defined in [CSP] from the server component to the WIB DES encryption. K is the key and P the data to be encrypted. See [DEA] for details. As defined in [03.38] ISO/IEC 9797 padding method 1. D is the data to be padded. See [9797] for details.

CRC32 Client bound Message DES_ENCR(K,P) GSM 7 bit default alphabet ISO_9797_PAD1(D)

ISO_9797_PAD3(D) ISO_9797_ALG4(K,K',K'', D) Locally Stored WIB Script Proactive SIM Command Script Script Identifier TDES_DECR(K1,K2,K3,C)

ISO/IEC 9797 padding method 3. D is the data to be padded. See [9797] for details. ISO/IEC 9797 MAC algorithm 4. D is data to be MACed. See [9797] for details. A WIB script that resides in EFBytecode A command as defined in [11.14] Synonym to WIB script A globally unique identifier of a WIB script Triple DES decryption in outer CBC mode using three keys in DED operation. C is the data to be decrypted. See [TDEA] for details. Triple DES encryption in outer CBC mode using three keys in EDE operation. P is the data to be encrypted. See [TDEA] for details. A command as defined in [CSP] Several WIB commands that logically belong together and occur one after the other. A WIB command sequence

TDES_ENCR(K1,K2,K3,P) WIB Command WIB Command Sequence WIB Script 3.3 Stylistic Conventions

Names of WIB commands are written in courier as in Execute Local Script. Names of proactive SIM commands as defined in [11.14] are written in UPPERCASE TIMES NEW ROMAN as in DISPLAY TEXT. Data field names for WIB commands are written in italics as in Output Variable.

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

4 WIB implementation, GSM 03.48 over SMS


4.1 Concatenated Short Messages WIB supports concatenation of SMs in both directions. WIB shall be able to handle at least five concatenated SMs from the WIB to the network and WIB shall be able to receive at least seven concatenated SMs. However, the maximum number of concatenated messages supported by WIB shall be defined by the operator. 4.2 Retransmission of failed MO SM If the transmission of an SM following a Submit, Submit Extended, Send SM or Send SM Extended WIB command fails due to that the ME returns an error, the transmission shall be silently re-attempted twice before an error is displayed. 4.3 Reply packet Reply packets, as defined in [03.48], are not used by WIB. All communication between the server component and WIB uses command packets, defined in [03.48], in both directions. 4.4 Toolkit Application Reference The Toolkit Application Reference (TAR) is used by GSM 03.48 to address the receiving application on the SIM card. WIB, as a receiving application, shall be able to handle a variable number of TARs, minimum 48, and the TAR values shall be configurable.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Further, WIB shall associate with every TAR a TAR type a security configuration (SC)

The SC is described in more detail in section 4.7. The EF for storing TARs along with associated attributes is EFTAR. The file structure is specified in detail in section 10.1.

4.4.1 TAR type The TAR type is used to associate special behavior and/or capabilities to a script executing on that TAR. There are three different TAR types defined: push pull administration

The 'push' and 'pull' TAR types are associated with behavior explained in section 7.9.1 while the 'administration' TAR type is used to associate administrative capabilities as explained in section 5.2. Throughout the rest of this document the terms 'Pull TAR', 'Push TAR' and 'Administration TAR' is used as a shorthand notation to refer to the fact that a TAR is associated with a certain TAR type. 4.4.2 TAR selection for outgoing 03.48 messages When sending a 03.48 message to the network, there are three different scenarios that have to be considered: 1. The user has selected an item in the menu, or a WIB event has triggered a script execution, and as a result of running the corresponding script, a 03.48 message shall be sent. In this case WIB shall select the default Pull TAR. 2. A 03.48 message was received from the network and as a result of interpreting that message, a new 03.48 message shall be sent to the network. In this case the TAR in the received message shall be used in the returned message. 3. A Set Return TAR Value WIB command was executed prior to the Submit or Submit Extended WIB command. In this case, the TAR in the specified record of EFTAR shall be used. For further requirements regarding this WIB command, see section 5.1.7. The term "using a TAR" implies that the TAR value in question occupies the field with the same name in the 03.48 message header and that the security configuration associated with that TAR (keys, counters, etc.) is used when performing cryptographic calculations.

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

10

4.5 SMS header parameters WIB has to know to which destination address the 03.48 message shall be sent. All SMS header parameters as well as the destination address shall be fetched from the EFSMS Header file record 1. 4.6 Access control for administrative WIB commands A separate mode of operation, indicated by TAR type, is dedicated for administrative purposes. This is to enable an entity with administrator privileges to perform tasks like adding new plug-ins and perform menu management. It is the responsibility of WIB to ensure that an administrative WIB command, see ref [CSP] for details, shall only be executed if the 03.48 message containing WIB command was addressed to an Administration TAR, and the message as a whole was valid from a GSM 03.48 perspective. The Administration TAR shall not be allowed to operate with security level L0. See section 4.8.1 for further details. In the administrative mode of operation, WIB may execute both administrative and operational WIB commands, see ref. [CSP]. 4.7 Security configuration A security configuration (SC) is defined as: A counter for incoming 03.48 messages and a counter for outgoing 03.48 messages. Details covering the usage of counters are described in section 4.8.1. A key set containing up to 16 keys for the ciphering key. Keys in the key set shall be addressable using the KIc index reflected as the most significant nibble within the KIc byte in the 03.48 message header. A key set containing up to 16 keys for the integrity/authentication key. Keys in the key set shall be addressable using the KID index reflected as the most significant nibble within the KID byte in the 03.48 message header. A list of triplets (SPI KIc KID)SC-IN for validation of incoming 03.48 messages. Each triplet in the list shall consists of: 2 bytes SPISC-IN, formatted according to the SPI bytes of the 03.48 message header. 1 byte KIcSC-IN, formatted according to the least significant nibble of the KIc byte in the 03.48 message header. 1 byte KIDSC-IN, formatted according to the least significant nibble of the KID byte in the 03.48 message header.
11

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

A triplet (SPI KIc KID) SC-OUT to be used in the GSM 03.48 header of outgoing 03.48 messages. The format is identical to the (SPI KIc KID) bytes of the 03.48 message header.

EFSC is used for storing of security configurations, and the coding is specified in detail in section 10.5. 4.8 03.48 message security 4.8.1 Supported security levels The following 03.48 security levels shall be supported by the WIB:
Level L0 SPI 00 00 KIc 00 KID 00 Description Replay protection: None Authentication: None Ciphering: None This security level should be used for testing only, since it provides no protection whatsoever. Replay protection: Counter greater Authentication: MAC derived from ISO/IEC 9797 Algorithm 3, padding method 1 Ciphering: None This security level ensures protection against replay and interleaving attacks as well as message authentication. Replay protection: Counter greater Authentication: CRC32 Ciphering: Triple DES This security level ensures protection against replay and interleaving attacks as well as message authentication and message confidentiality. Replay protection: Counter greater Authentication: ISO/IEC 9797 Algorithm 4, padding method 3 Ciphering: Triple DES This security level ensures protection against replay and interleaving attacks as well as message authentication and message confidentiality.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

L1

12 00

x7

y3

L2

15 00

x5

00

L3

16 00

x5

y0

The most significant nibble of KIc, denoted x, is the KIc index and refers to a key in the ciphering key set. Similarly, the most significant nibble of KID, denoted y, is the KID index and refers to a key in the authentication key set. 4.8.2 Incoming 03.48 message validation The following steps shall be executed, in order, by the WIB when receiving a 03.48 message from the network: 1. SC selection; WIB shall use the TAR of the incoming 03.48 message to select the corresponding record in EFTAR. Based on the SC index of this record, WIB

12

shall locate the corresponding SC in EFSC. The selected SC shall serve as the base for all cryptographic operations related to GSM 03.48. 2. Validation of the security level; WIB shall check the (SPI KIc KID) bytes of the incoming 03.48 message against the entries in the (SPI KIc KID) SC-IN validation list. When validating the security level, the index part, that is the high nibble of KIc and KID, shall be ignored. If a match cannot be found, WIB shall display an error message under the conditions described in section 8 (tag '34'h), and terminate. If a match is found, decryption and/or authentication of the incoming 03.48 message shall be executed as defined by (SPI KIc KID) in the message. 3. Decryption; Depending on the security level, the WIB shall decrypt the message as described in section 4.8.6. 4. Authentication; Depending on the security level, the WIB shall verify the authenticity of the message as described in section 4.8.5. 5. Replay protection; Depending on the security level, the WIB shall check the validity of the counter value as described in section 4.8.4. If all the above steps are executed successfully, the message is valid from a 03.48 perspective, and shall be processed further by the WIB. If an error occurs, WIB shall display an error message under the conditions described in section 8 (tag '34'h), and terminate. 4.8.3 Outgoing 03.48 message protection The following steps shall be executed, in order, by the WIB before sending an 03.48 message to the network. 1. SC selection; WIB shall use the current TAR to select the corresponding record in EFTAR. Based on the SC index of this record, WIB shall locate the corresponding SC in EFSC. The selected SC shall serve as the base for all cryptographic operations related to GSM 03.48.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

2. Selection of security level; The WIB shall select the security level indicated by (SPI KIc KID) SC-OUT in the SC. 3. Replay protection; Depending on the security level, a counter value shall be included in the message as described in section 4.8.4. 4. Authentication; Depending on the security level, a message authentication code or alternatively a cyclic redundancy check shall be included in the message as described in section 4.8.5. 5. Encryption; Depending on the security level, the WIB shall encrypted the message as described in section 4.8.6.

13

If all the above steps are successfully executed, the WIB shall continue the process of sending the message to the network. If an error occurs, WIB shall display an error message under the conditions described in section 8 (tag '34'h), and terminate. 4.8.4 Replay protection Replay protection is ensured through the use of counters in the 03.48 message. The counters are stored in EF03.48 Counter, and referenced through the SC. See section 10.5 and 10.6 for details. The counter for outgoing 03.48 messages shall be incremented by the WIB every time a message containing a counter is sent. Similarly, the counter for incoming 03.48 messages shall be updated with the value in every accepted incoming message which has counter processing enabled in SPI. A message shall be accepted if and only if the counter contained in the incoming message is higher than the value of the incoming counter stored in the SC. If this is not the case, WIB shall display an error message under the conditions described in section 8 (tag '34'h), and terminate. When a counter value reaches its maximum value, the counter and all security levels associated with the counter, shall be blocked from further usage. 4.8.5 Authentication Security levels L1, L2 and L3 use different techniques for achieving message authentication. Common for all techniques is the calculation of an authentication value, called AV, combined with one of the following actions:
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

For outgoing messages, AV shall be copied into the CC/RC field in the 03.48 header. AV occupies 4 or 8 bytes depending on the security level. For incoming messages, AV shall be compared with the value in the CC/RC field of the incoming message. If the values match, the message shall be regarded as valid. Conversely, if the values do not match, WIB shall display an error message under the conditions described in section 8 (tag '34'h), and terminate.

4.8.5.1 L1 authentication

To calculate the L1 authentication value, perform the following steps:

14

1. Using the KID index, locate a single length (8 bytes) DES key in the authentication key set. Call this key K. 2. Using the KIc index, locate a double length (16 byte) DES key in the ciphering key set. Let K1 and K3 correspond to the leftmost half and K2 the rightmost half of this key. 3. Calculate the padded message PM = ISO_9797_PAD1( CPL || CHL || SPI || KIc || KID || TAR || CNTR || PCNTR || Data ) Note: Data is the application data. Other symbols not explicitly defined in this specification refer to fields in the 03.48 message header. See [03.48] for details. For outgoing messages, all field values must be resolved before the padding operation. Specifically, PCNTR (number of padding bytes added by the encryption) shall be set to zero. 4. Assuming PM consists of n 8-byte blocks, split PM into two parts, PMH and PMT, by letting PMH consist of the first n-1 blocks of PM and PMT the last block of PM. 5. Calculate C = DES_ENCR( K, PMH ) Note: IV = 0. Let Cn-1 be the last 8 bytes of C. 6. Calculate AV' = TDES_ENCR( K1, K2, K3, PMT ) Note: IV = Cn-1. 7. The authentication value AV is the four leftmost bytes of AV'.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

4.8.5.2 L2 authentication

To calculate the L2 authentication value, perform the following steps: 1. Let LD be the length of the application data. Calculate LP, the number of padding bytes required by the encryption LP = 7 - ( 10 + LD + 7 ) mod 8 Note: The number 10 comes from the concatenated length of the CNTR, PCNTR and CC/RC fields in the 03.48 message header.
15

2. Calculate the padded data, PD, by right-padding the application data with LP zero valued bytes. 3. Calculate the padded message PM = ISO_9797_PAD1( CPL || CHL || SPI || KIc || KID || TAR || CNTR || PCNTR || PD ) Note: Symbols not explicitly defined in this specification refer to fields in the 03.48 message header. See [03.48] for details. For outgoing messages, all field values must be resolved before the padding operation. Specifically, PCNTR (the number of padding bytes added by the encryption operation) shall be set to LP. 4. Calculate the 4-byte authentication value AV = CRC32( PM ) using the following polynomial:
X32+X26+X23+X22+X16+X12+X11+X10+X8+X7+X5+X4+X2+X1+X0

See Annex C for details regarding the CRC32 calculation.


4.8.5.3 L3 authentication

To calculate the L3 authentication value, perform the following steps: 1. Using the KID index, locate a double length (16 bytes) DES key in the authentication key set. Let K correspond to the leftmost half and K' the rightmost half of this key. Derive a new key K'' by complementing alternate substrings of four bits of K', commencing with the first four bits. 2. Let LD be the length of the application data. Calculate LP, the number of padding bytes required by the encryption LP = 7 - ( 14 + LD + 7 ) mod 8
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Note: The number 14 comes from the concatenated length of the CNTR, PCNTR and CC/RC fields in the 03.48 message header. 3. Calculate the padded data, PD, by right-padding the application data with LP zero valued bytes. 4. Calculate the padded message PM = ISO_9797_PAD3( CPL || CHL || SPI || KIc || KID || TAR || CNTR || PCNTR || PD )

16

Note: Symbols not explicitly defined in this specification refer to fields in the 03.48 message header. See [03.48] for details. For outgoing messages, all field values must be resolved before the padding operation. Specifically, PCNTR (the number of padding bytes added by the encryption operation) shall be set to LP. 5. Calculate the 8-byte authentication value AV = ISO_9797_ALG4( K, K', K'', PM ) 4.8.6 Ciphering Security levels L2 and L3 mandate ciphering of 03.48 messages using triple DES. The DES algorithm shall be executed in outer CBC mode, EDE (encrypt-decryptencrypt) operation using two keys.
4.8.6.1 Message encryption

To encrypt a message, perform the following steps: 1. Using the KIc index, locate a double length (16 bytes) DES key in the ciphering key set. Let K1 and K3 correspond to the leftmost half and K2 the rightmost half of this key. 2. Depending on the security level, calculate AV, PD and LP as described in 4.8.5.2 and 4.8.5.3. AV is 4 or 8 bytes, depending on the security level. 3. Calculate the padded message PM = CNTR || PCNTR || CC/RC || PD Note: Symbols not explicitly defined in this specification refer to fields in the 03.48 message header. See [03.48] for details. For outgoing messages, all field values must be resolved before the padding operation. Specifically, PCNTR (the number of padding bytes added by the encryption operation) shall be set to LP.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

4. Calculate the encrypted message EM = TDES_ENCR( K1, K2, K3, PM ) Note: IV = 0. EM now corresponds to the encrypted part of the outgoing 03.48 message.
4.8.6.2 Message decryption

17

To decrypt a message, perform the following steps: 1. Using the KIc index, locate a double length (16 bytes) DES key in the ciphering key set. Let K1 and K3 correspond to the leftmost half and K2 the rightmost half of this key. 2. Calculate the (padded) decrypted message PM = TDES_DECR( K1, K2, K3, EM ) Note: EM is the encrypted part of the incoming 03.48 message. 3. Based on the security level, split PM into field values CNTR, PCNTR and CC/RC, and calculate the application data by removing the padding bytes, indicated by PCNTR.

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

18

5 WIB Commands
This chapter provides additional specification of the behavior of WIB when executing WIB commands specified in [CSP]. 5.1 Operational WIB Commands 5.1.1 Submit The WIB command tag is '01'h. This WIB command is used to submit a server bound message. The data to be sent is supplied in the Output field. WIB shall use the value of the default text and/or icon specified in EFText with tag '01'h described in section 10.10.1 when issuing the SEND SHORT MESSAGE proactive SIM command. If the tag '01'h exists in EFText and its length is zero, WIB shall provide a null data object as the alpha identifier to the SEND SM proactive SIM command as described in [11.14] to suppress the default message of the ME. If the tag '01'h is not present, WIB shall not provide an alpha-identifier in the proactive command. This WIB command implements the wait-for-response default behaviour as described in section 7.9.1 and the progress information as described in section 7.9.3. WIB shall silently re-try the proactive SIM command as specified in Annex B. Error codes and behaviour versus Terminal response. 5.1.2 Get Input The WIB command tag is '03'h/'83'h.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

This WIB command is used to request multiple character input from user. The Text to Display is the prompt to the user. The text might contain variable references. If the MSB of the Command Tag is set, the Text to Display shall be interpreted as UCS2. If the Command Qualifier is present WIB shall use this Command Qualifier to replace the Command Qualifier of GET INPUT proactive SIM command. This shall be done irrespective of the value of MSB of the Command Tag.

19

If the Command Qualifier is not present WIB shall set bit 2 of the last byte of the Command Qualifier of proactive SIM command to the corresponding value of the MSB of the Command Tag. That is, if Command Tag is '03'h (MSB = 0) then Command Qualifier bit 2 = 0 and if Command Tag is '83'h (MSB = 1) then Command Qualifier bit 2 = 1. If Maximum Input Length is present in the WIB command, this may be used to exchange the last byte of the Response length field of the proactive SIM command. If Minimum Input Length is present in the WIB command, it may be copied into the third byte of the Response length field. The coding of Default Text, if present, is according to the Command Qualifier given in the WIB command. Many MEs support that the prompting string (text to display) is UCS2, but only GSM 7 bit default alphabet as User Input (and Default Text). This can be found out by WIB from the TERMINAL PROFILE. In this case, if the Command Qualifier is present and contains the bit 2 set (=1), WIB shall set the bit 2 of the Command Qualifier of the proactive SIM command, to GSM 7 bit default alphabet (=0). In addition, WIB shall convert the Default Text from UCS2 to GSM 7 bit default alphabet. WIB shall then accept the GSM default alphabet string as input but convert it to UCS2 before it is stored in the variable. In the case that the user enters an empty string as a response to a GET_INPUT, WIB shall be able to handle both that the Data Coding Scheme is left out and that it is included, that is the TLV for an empty string can look like both {'0D'h, '01'h, <data coding scheme>} and {'0D'h, '00'h}, to handle the incompatibility of different MEs. 5.1.3 Skip The WIB command tag is '05'h. This WIB command is used to skip a given number of WIB commands and then continue execution of the current script. If this command, at execution, results in a skip to a position after the end of the current script or to a position before the beginning of the current script, the script execution shall terminate. This also applies to other WIB commands that uses skip functionality. That is Select Item, Branch on Variable Value and Check Terminal Profile. 5.1.4 Plug-in The WIB command tag is '07'h.

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

20

A script may access a plug-in through the Plug-In WIB command. The plug-in is uniquely identified through its name. The encoding of the WIB command input and output fields are specific to each plug-in. The Parameters field may contain variable references and it is the responsibility of WIB to substitute the variable references with the content of the variables. Byte stuffing must also be removed before calling the plug-in. If a plug-in call results in any output data this data shall be addressable from the script through the variable reference provided in the Plug-In WIB command. The Group/Ungroup Variable WIB command may be used to ease the parameter handling for calling plug-ins. For further information see section 5.1.12. 5.1.5 Provide Local Information The WIB command tag is '09'h. The Command Qualifier provided in the WIB command is passed transparently to the ME and the result is stored in the Output Variable. If the ME does not support the proactive SIM command, or the command qualifier, and is therefore unable to return any data, WIB shall store an empty string in the output variable and continue execution. This facilitates making a service that gets the best possible information from the ME. 5.1.6 Play Tone The WIB command tag is '0A'h/'8A'h WIB shall convert the Text to Display to an Alpha identifier as defined for EFADN in [11.11]. The encoding of Text to Display is determined by the MSB of the command tag.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

5.1.7 Set Return TAR value The WIB command tag is '11'h. The Set Return TAR Value WIB command may be used in a script to change the TAR, and thereby also the TAR type, of the current script. This has effect on the behavior of the Submit and Submit Extended WIB command, as well as the security and TAR value of outgoing 03.48 messages. The new TAR shall be valid until WIB exits or the next Set Return TAR Value WIB command is executed. Note that Execute Local Script WIB command has no effect on the TAR value to be used.
21

If a script attempts to change TAR to an Administrative TAR using this WIB command, an error shall be generated and WIB shall exit. This is to prevent arbitrary scripts from executing administrative WIB commands. The TAR index refers to the record in EFTAR with that record number. 5.1.8 Send USSD The WIB command tag is '12'h/'92'h. This WIB command sends a USSD string to the network. If the Command Tag is '12'h, the USSD String supplied in the WIB command is encoded GSM 7 bit Default Alphabet with 8 bit set to zero. WIB shall then pack the data into USSD packed according to [03.38] and set the Data Coding Scheme to '0F'h, "language unspecified", in the proactive SIM command SEND USSD. If the Command Tag is '92'h, WIB shall set the proactive SIM command Data Coding Scheme to '48'h, "UCS2". No packing is made by WIB and the USSD String shall be supplied as is. 5.1.9 Check Terminal Profile The WIB command tag is '17'h. If several bytes of the terminal profile are to be checked, the WIB command shall behave as a logical AND. If any of the checks fail in the sense that a required bit of the terminal profile is not set, the corresponding item in the WIB command shall determine the number of WIB commands to skip. The length of the terminal profile data sent by the ME is dependent on the capabilities. When executing the Check Terminal Profile WIB command the input arguments may indicate testing of any byte in terminal profile. WIB shall consider the ME as not capable of any functionality that is not part of the terminal profile data sent by the ME. The text to display is independent of which check that fails. 5.1.10 Execute Local Script The WIB command tag is '1A'h. When WIB executes this WIB command, it shall stop execution of the current script, hereafter referred to as the calling script. Instead, execution shall continue

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

22

with the locally stored script, hereafter referred to as the called script, in EFBytecode that is indicated by the command data. The called script is identified by its script identifier. WIB shall map this script identifier to an address in EFBytecode as described in section 7.3.1 of this specification. If a Skip WIB command indicating a longer backward skip than possible, this shall be treated in the same manner as for other scripts. The Execute Local Script WIB command can be used as either a GOTO or GOSUB. If Execute Local Script WIB command is issued with Length of Script Identifier set to zero, this indicates a return to the calling script. In that case, WIB shall continue execution with the WIB command immediately following the Execute Local Script WIB command, in the original calling script, that caused execution of the current script. WIB shall perform the same handling of variables as specified for the Execute Local Script WIB command. WIB shall support at least one level of return. If the maximum number of return levels is exceeded, WIB shall issue an error and terminate execution of the WIB script. When WIB starts executing the called script, variables with variable identities in the range ['E0'h-'FF'h] shall retain their values. Other variables shall be cleared by the WIB. All variables shall be cleared when starting to execute a WIB script that is initiated in any other way than through the Execute Local Script WIB command. 5.1.11 Submit Extended The WIB command tag is '1B'h. This WIB command is used to submit a server bound message. This WIB command implements the wait-for-response behaviour as described in section 7.9. An attribute byte indicates the desired behaviour and the use of alpha identifiers/text strings and icons for displaying sending-info, intermediate-info and receiving-info to the user. The attribute byte is defined in [CSP]. An additional note on specific attributes is given in the table below. Optionally, four different alpha identifiers/text strings with icon identifiers may be included in this WIB command. The different alpha identifiers/text strings and icons are related to the sending-info, intermediate-info, receiving-info and bookmark name. The alpha identifier and/or icon identifier for the sending-info shall be used for giving information to the user when the WIB command submits a message to the

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

23

network and override their counterparts for sending-info configured in EFText. WIB shall supply the alpha identifier and/or icon identifier in the SEND SHORT MESSAGE proactive SIM command used for submitting the message. The text and/or icon identifier for intermediate-info is used for displaying information to the user while waiting for the next subsequent client bound message to be received. They are used for the progress information described in 7.9.3 and they override their counterparts for intermediate-info configured in EFText. The text and/or icon identifier for the receiving-info is used for displaying information to the user when the subsequent client bound message is received. They are used for the progress info described in 7.9.3 and they override their counterparts for receiving-info configured in EFText. Since the text string and/or icon identifier is supplied in the Submit Extended WIB command of a previous script in relation to when they are displayed WIB shall store them within the context of the wait-for-response-state until the state has been exited. The text string may contain escape sequences as described in 7.9.3. The following table shows which combinations of current TAR and attribute settings of Submit extended WIB command lead to the wait for response state (WFRS) being entered or not.
Attribute Bits b5b4 = x0 b5b4 = 01 b5b4 = 11 pull TAR WFRS on WFRS on WFRS off push/admin TAR WFRS off WFRS on WFRS off

For all alpha identifiers/text and icon identifiers the following rule applies: If no alpha identifier/text and/or icon identifier is included in the WIB command when the attribute byte indicates that an alpha identifier/text or icon shall be used, WIB shall use the default alpha identifier and/or icon according to the configuration in EFText. If this default item does not exist, no alpha identifier/icon is used in the command.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

If the command or configuration file contains a tag value for an info element, it shall be considered as present regardless of its length. If the tag is not contained in the command, or the configuration file, the info element does not exist. For the sending-info, it applies that if the sending-info field is present in the command or in the configuration file and its length is zero, WIB shall provide a null data object as the alpha identifier to the SEND SM proactive SIM command as described in [11.14] to suppress the default message of the ME. If the sendinginfo is not present, WIB shall not provide an alpha-identifier in the proactive command.

24

The following table shows which of the default or given text/icon that is displayed. The table covers the sending-info, the intermediate-info and the receiving-info. WIB shall only display intermediate-info and receiving-info when WIB is in wait-for-response-state. The handling of text and icon is independent. For example, if only the text is provided in the command, the icon information shall be fetched from the configuration file.
text/icon provided in command text/icon not provided in command default text/icon exist b1/b2/b3 = x: use provided b1/b2/b3 = 0: use no information b1/b2/b3 = 1: use default default text/icon do not exist b1/b2/b3 = x: use provided b1/b2/b3 = x: no information

The treatment of the icons/texts provided in the command in relation to the default ones and how this is controlled by the attribute bit is exemplified for b1 in the below table. The treatment for b2 and b3 is analogous to the one for b1.
Value of b1 and fields in command 0, No CT, No CI 0, CT present, No CI 0, No CT, CI present 0, Both CT and CI present 1, No CT, No CI 1, CT present, No CI 1, No CT, CI present 1, Both CT and CI present No DT, No DI CT X CT+CI CT X CT+CI DT only CT X CT+CI DT CT DT+CI CT+CI Both DT and DI CT X CT+CI DT+DI CT + DI DT+CI CT+CI

DI = Default Icon in EFText DT = Default Text in EFText CI = Command Icon provided as field in the command CT = Command Text provided as field in the command

The cases marked with X in the above table are the ones that would cause an illegal toolkit command since there is no text present.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

The text string and/or icon identifier for bookmarking is used for indicating for WIB when the data included in the SUBMIT can be bookmarked, that is, saved together with a name of the bookmark. If this text string and/or icon identifier is included in the SUBMIT, the data included in the SUBMIT is possible to bookmark according to section 9.1. The text string gives the default bookmark name, to be presented to the end-user by WIB as a default name of the bookmark. This text string and/or icon identifier shall be disregarded by WIB if bookmark handling is not supported or not active according to current configuration. WIB shall silently re-try the proactive SIM command as specified in Annex B. Error codes and behaviour versus Terminal response.

25

5.1.12 Group/Ungroup Variable The WIB command tag is '1F'h. The Group/Ungroup Variable WIB command groups the content of several variables into a single variable or ungroups the content of a variable and splits it into several variables. The intended use is to ease the handling of multiple variables in a consistent way by providing a more compact format preserving the length information of the variables. Example of usages are 1) exchanging data with server application or 2) providing parameters to/from plug-ins that requires multiple input or output. For Group functionality the WIB command shall take a list of variables. WIB shall create a structure of concatenated Length-Value pairs where each LengthValue pair reflects the content of a variable from the list. The order of the LengthValue pairs shall follow the order of the variable list. The structure created shall be stored in the output variable given as Grouped Variable. The grouped variable shall only contain data from as many input variables as the maximum variable length allows. Any additional variables shall be disregarded. For Ungroup functionality the WIB command shall parse the content of the input variable Grouped Variable as a structure of concatenated Length-Value pairs. The value part of each Length-Value pair shall be copied into a variable from the list of variables given. The Length-Value pairs shall be handled in the order they appear, that is, the value part of the first Length-Value pair is copied into the first variable in the variable list, the second pair into the second variable and so on. If there are more destination variables than the data in Grouped Variable can satisfy, the variables that do not receive data shall be set empty. If there are too few variables, the left over data shall be disregarded. If the length of any LengthValue pair is larger than allowed considering the length of the grouped variable and the position of the Length-Value pair within the structure, the corresponding output variable shall be set empty. 5.1.13 Set Up Call Extended
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

The WIB command tag is '20'h. The Set Up Call Extended WIB command sets up a call to a given destination address. In comparison with the original Set Up Call WIB command (tag '0D'h) this WIB command supports different input formats for the destination address. As specified in [CSP] the following formats shall be supported:
'01'h =Preformatted: the content of the Destination Address variable is preformatted according to TON+NPI+Dialling Number as for EFADN.

26

'02'h =GSM default alphanumeric: the Destination Address variable contains an alphanumeric string of GSM 7 bit default alphabet characters. '03'h =UCS2 alphanumeric: the Destination Address variable contains an alphanumeric string of UCS2 characters.

For the formats '02'h and '03'h no TON+NPI is provided in the destination address given. The WIB command itself shall take care of the formatting, including BCD coding, nibble swapping and padding, into a valid format of TON+NPI+Dialling Number as for EFADN [11.11]. The transformation of the destination address into BCD shall be performed as defined in the table below. Any other characters in the input shall be disregarded. Input "0"-"9" "*" "#" "a" "b" "c" BCD '0' '9' 'A' 'B' 'C' 'D' 'E'

The WIB command shall set the TON+NPI to one of the following values, also refer to [03.40]. TON+NPI value '91'h:
This is when the address is starting with a "+". The TON shall be set to "International".

TON+NPI value '81'h:


This is when the "+" is not present. The TON shall be set to "Unknown".

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

5.1.14 Send SM Extended The WIB command tag is '23'h. The Send SM Extended WIB command sends a Short Message to a given destination address. In comparison with the original Send SM WIB command (tag '13'h) this WIB command supports User Data Header and different input formats for the destination address as specified in [CSP]. The formats are further described above in section 5.1.13.

27

WIB shall silently re-try the proactive SIM command as specified in Annex B. Error codes and behaviour versus Terminal response. 5.1.15 Timer management The WIB command tag is '28'h. This WIB command is used to manage timers in the ME and associate them with scripts. The scripts are executed at timer expiration. WIB keeps track of all timers that have been started. There are three operations supported, "Start", "Deactivate" and "Get current value". With "Start" WIB allocates an available timer to the Script Identifier given. If the Script Identifier has already been assigned a timer then the current timer is reactivated with the new timer value. If there are no timers available WIB shall generate an error. With "Deactivate" WIB removes the Script Identifier-to-timer association. If the Script Identifier is not allocated a timer the normal WIB execution continues. With "Get current value" the current value of the timer allocated to the given Script Identifier is placed in the Timer Value. If the Script Identifier is not allocated a timer then the Timer Value variable shall be empty, that is, the length is zero. To implement this timer functionality WIB shall use the proactive SIM command TIMER MANAGEMENT and the 8 timers provided by the ME. Timer value shall be converted from the format used in [11.14] to a 6 bytes string of numeric GSM 7 bit default alphabet characters formatted from left to right as "hhmmss" where hh is hours, mm is minutes and ss is seconds. Scripts that are initiated by timer expiration shall behave as scripts triggered by events regarding Wait-for-response state behaviour and TAR usage.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

5.1.16 Display Text Extended The WIB command tag is '21'h/'A1'h. This WIB command is used to display a text to the user. If the Command Tag is 'A1'h, the Text to display shall be interpreted as UCS2. WIB will create the command qualifier according to the attribute in the WIB command.

28

If Immediate Response bit is set in the attribute, WIB shall include the Immediate Response data object to the DISPLAY TEXT proactive SIM command with tag 'AB'h (comprehension required). If the ME responds with "Command data not understood by ME" result value, WIB shall ignore it and continue execution with the next WIB command. 5.1.17 Add/Subtract The WIB command tag is '1D'h. This WIB command is used to perform arithmetical addition or subtraction of integer values. The processing of this command is described in [CSP]. 5.1.18 BCD to GSM 7bit Default Alphabet Conversion The WIB command tag is '25'h. This WIB command is used to convert between packed BCD (Binary Coded Decimal) data and decimal representation in GSM 7bit default alphabet, in both directions. The processing of this command is described in [CSP]. 5.2 Administrative WIB Commands This section describes administrative WIB commands. All administrative WIB commands require access control by restriction to their usage only on an administrative TAR type. The priority of the administrative TAR type is the same as for the operational TAR types. Thus, if a client-bound message is received on an administrative TAR type when WIB is in executing mode, the behavior is as defined in section 7.2.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

The administrative WIB commands Install Plug-In, Remove Plug-In and Set Script Trigger Mode shall use the Output variable for returning information on the outcome of the command rather than generating an error. The intention is to enable an administrative application to diagnose the outcome. 5.2.1 Install Plug-In The WIB command tag is '7E'h.

29

This WIB command is used to activate and possibly also download a new plug-in to the SIM card after the card has been issued. The installed plug-in may be subsequently accessed by WIB using the Plug-in WIB command, under the name indicated by Plug-in name. The implementation of the Install Plug-In WIB command is mandatory. However, the functionality of downloadable plug-ins is optional. This specification does not mandate anything about the nature of the plug-in installation procedure except for the following: 1. The installed plug-in shall not be accessible to WIB before the execution of this WIB command, even if the command is not used for the actual download of plug-in installation data. 2. Successful execution of the Install Plug-In WIB command shall cause the output of any subsequent call to Assign Version Information to Variable WIB command to contain the information of the installed plug-in. Note that Plug-ins may be accessible to WIB when issuing the card. In case the plug-in installation is intended as an upgrade of an already existing plug-in, the plug-in must first be removed using the Remove Plug-in WIB command, before it is (re) installed. If the operation is successful, WIB shall assign '00'h to the Output variable. If the operation fails, WIB shall assign the value '02'h to the Output variable if the plugin name does not exist and '03'h if the Manufacturer Specific Plug-in Version does not match any available plug-in. For any other failure, WIB shall assign '01'h to the output variable. An attempt to install an already existing plug-in is not an error and shall be regarded as a successful operation.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

5.2.2 Remove Plug-In The WIB command tag is '7D'h. This WIB command is used to de-activate an existing plug-in so that it is rendered inaccessible to the WIB. The plug-in to be de-activated is indicated by Plug-in name. If the indicated plug-in is unknown to the WIB, nothing shall be performed by this WIB command, and script execution shall carry on as normal.

30

In case a plug-in is successfully de-activated using the WIB command, the name of the de-activated plug-in shall no longer be contained in the output of any subsequent call to Assign Version Information to Variable WIB. Depending on the implementation, this command may cause WIB to free the space occupied by the plug-in. Physical removal may also depend on some other mechanism. If the operation is successful, WIB shall assign '00'h to the Output variable. If the operation fails, WIB shall assign the value '01'h to the Output variable. An attempt to remove a non-existent plug-in is not an error and shall be regarded as a successful operation. 5.2.3 Set Script Trigger Mode The WIB command tag is '7B'h/'FB'h The WIB command shall update the WIB menu and event configuration. If the WIB command indicates that the configuration update shall be persistent, the configuration files EFMenu and EFEventConfig shall be updated. Event handling is persistently disabled by setting the Event type field of the first entry in EFEventConfig to 'FF'h. When the event handling is persistently enabled, the Event type of the first entry in EFEventConfig shall be set to 'FE'h. This means that enabling and disabling of event handling through this command relies on using the first event as a flag event. Enabling of menu triggering or event triggering when already enabled, shall result in a new menu or event subscription being set up according to the respective configuration file. WIB shall interact with any other configured information on the card to build a SET-UP MENU proactive SIM command. If disabling the menu, the SET-UP MENU proactive SIM command shall exclude all information from the WIB menu configuration file. If the WIB command includes a Menu Text to Display, this text shall be used as a single menu entry instead of any configured WIB menu entries for the menu in the ME. No entry in the menu itself shall be linked to the WIB. This text is only valid until the SIM is reset and WIB does thus not need to store it. The execution of this WIB command shall take the same menu and event handling issues into consideration as described in section 7.1 and 7.10.

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

31

If the operation is successful, WIB shall assign '00'h to the Output variable. If the operation fails, WIB shall assign the value '01'h to the Output variable. 5.2.4 Get Script Trigger Mode The WIB command tag is '7A'h. This WIB command shall always return the current persistently configured script trigger mode. This means that it shall not consider temporary configuration resulting from a previous Set Script Trigger Mode WIB command. 5.2.5 Get Menu The WIB command tag is '79'h. This WIB command shall read the contents of the EFMenu and EFMenuTitle setup files and prepare output according to [CSP]. The content and ordering of the list of menu items in the output shall reflect the item status and menu ordinal as defined in EFMenu. The output shall be prepared even if the menu is disabled. 5.2.6 Get Script Info The WIB command tag is '78'h. This WIB command shall read the contents of the EFScriptAddress and EFEventConfig setup files and prepare output according to [CSP].

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

32

6 Proactive SIM Command Parameters


When generating proactive SIM commands as a result of a WIB command execution, there may be parameters that have to be set for the proactive SIM command to work properly. Below is a list of default parameters to be used in proactive SIM commands. Device Settings shall be coded as defined in [11.14]. 6.1 Display Text following Display Text or Check Terminal Profile WIB command

Field Command Details

Comment High Priority. Wait for user to clear message.

Value '8103012181'h

6.2 Display text following Display Text Clear after Delay WIB command

Field Command Details

Comment High Priority. Clear after delay.

Value '8103012101'h

6.3 Display text following Display Text Extended WIB command

Field Command Details


WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Comment

Value

Command qualifier, xx, is set according to the '81030121xx'h WIB command Immediate Response is included when required by the WIB command. 'AB00'h

Immediate Response

6.4 Get Input

Field Command Details.

Comment Alphabet set. SMS default alphabet. ME may


33

Value '8103012301'h

See 5.1.2 Text string Response length See 5.1.2. Default Text

echo the input. Input in unpacked format. No help information. This is the 'Text to Display'-value from the WIB command No minimum length. No maximum length. This is the 'Default Text' from the WIB command '910200FF'h

6.5 Select Item

Field Command Details.

Comment No help information.

Value '8103012400'h

6.6 Send Short Message following Submit and Submit Extended WIB commands

Field Command Details. Note 1. Alpha identifier and/or Icon Identifier Address
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Comment Packing not required. If it exists, use alpha identifier and/or icon given in EF Text. For SUBMIT EXTENDED: see section 5.1.11 Shall be taken from record no 1 in EFSMSHeader. Shall be taken from record no 1 in EFSMSHeader.

Value '8103011300'h -

SMS TPDU

Note 1. Since packing is not required, the DCS must indicate 8-bit data transfer. 6.7 Send Short Message following Send SM or Send SM Extended WIB command

Field

Comment
34

Value

Command Details. Address SMS TPDU : PID, DCS, Destination Address, User Data Header, User Data

Packing not required. Taken from the Service Center Address field in the WIB command. Taken from the corresponding fields in the WIB command. Data from the User Data field in the WIB command shall be packed by WIB if DCS indicates "Default alphabet". UDHI shall be set if the User Data Header field is present in the WIB command (only applicable for Send SM Extended). It is the responsibility of the WIB to assemble the SMS TPDU so that it is accepted by the ME. This may include the following tasks: Padding after User Data Header to reach a septet boundary. Calculation of UDHL after variable substitution. Calculation of UDL.

'8103011300'h

6.8 Provide Local Information

Field Command Details.

Comment

Value

Command qualifier, xx, is set according to the '81030126xx'h WIB command.

6.9 Play Tone

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Field Command Details Alpha identifier Tone Duration

Comment Included if Text to Display is supplied (length not zero) in the WIB command Fetched from the WIB command Fetched from the WIB command

Value '8103012000'h

35

6.10 Set Up Idle Mode Text

Field Command Details Text string

Comment As defined in the WIB command. Could be a null string.

Value '8103012800'h

6.11 Refresh

Field Command Details. File list 6.12 Set Up Call

Comment

Value

Command qualifier, xx, is set according to the '81030101xx'h. WIB command According to the WIB command.

Field Command Details. Alpha identifier for User Confirmation Phase. Icon identifier for User Confirmation Phase.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Comment

Value

Command qualifier, xx, is set according to the '81030110xx'h. WIB command Included if defined in the WIB command

Included if defined in the WIB command

Alpha identifier for Call Set Up Phase. Icon identifier for Call Set Up Phase. Address CCP, Duration

Included if defined in the WIB command Included if defined in the WIB command Taken from the WIB command. Taken from the WIB command

36

6.13 Send USSD

Field Command Details. Alpha identifier. USSD string

Comment Included if defined in the WIB command Taken from the WIB command.

Value '8103011200'h

6.14 Timer Management

Field Command Details

Comment

Value

Command qualifier, xx, is set according to the '81030127xx'h. WIB command

6.15 Launch Browser This proactive SIM command occurs as a result of Launch Browser and Launch Browser Extended WIB commands. Field Command Details Comment Command qualifier, xx according to the command qualifier in the WIB command Value '81030115xx'h

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

37

7 Capabilities and Behavior


7.1 Menu handling When the SIM card is activated, WIB shall collect the information from the WIB Menu configuration files, EFMenu and EFMenuTitle. This information is used to connect menu entries to the WIB and the corresponding WIB scripts. WIB shall interact with any application framework on the SIM card to register menu entries to the ME. The item identifiers of EFMenu shall be registered in such a way that WIB is called with the corresponding item identifier by the application framework when a menu item is selected. The resulting SET UP MENU proactive SIM command shall include the entries originating from the WIB menu configuration file. The actual generation and invocation of the SET UP MENU proactive SIM command is out of scope for this specification. The structure of the menu files is defined in chapter 10. The mapping between entries in the menu file and the scripts in the script file is defined in section 7.3. 7.2 Script Execution A script is a sequence of WIB commands. Input to script execution is the script and the maximum script length. The maximum length is encoded by two bytes where the first byte is most significant. The maximum script length shall be used to enforce out-of-bounds restrictions according to section 7.2.1. The maximum script length may also be used to optimise temporary memory allocation. The value 'FFFF'h of the maximum script length is reserved and may be used for error detection by the WIB. The content of the free space parts of EFBytecode is undefined. Thus, WIB can not assume that free space parts of EFBytecode are filled with 'FF'h bytes. Script execution shall start with the first WIB command. When a WIB command has been executed and no termination condition is fulfilled, execution shall continue with the next WIB command. Termination conditions are: 1. User has pressed the Cancel button 2. Exit WIB command has been executed 3. An error has occurred 4. Submit or Submit Extended WIB command has been executed and the wait-for-response state shall be entered

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

38

5. Out-of-bounds execution, as defined in section 7.2.1. 6. Normal exit when the end of the WIB script, according to its maximum script length, is reached 7. Execution of a skip value of -1 as a consequence of any of the WIB commands nin 7.2.1 If an error has occurred, error handling shall be performed according to chapter 8 before WIB terminates. If a Submit or Submit Extended WIB command has been executed, WIB shall enter wait-for-response state according to section 7.9 if certain conditions regarding TAR type and/or Submit Extended WIB command parameters are fulfilled. The value 'FF'h is reserved and not used as a WIB Command tag. When the length of a script is smaller than the maximum script length an 'FF'h byte may be added after the script to indicate end of executable code. If the next WIB command execution pointer points to this byte, execution shall terminate with an error message. When executing a script, WIB shall be considered busy. Any attempt to start execution of another script shall then be disregarded. This includes the case where a script is received in a PDU from the network. 7.2.1 Out-of-bounds Execution Restrictions A script is bounded by its starting point and the maximum script length as indicated by the two length bytes preceding the script. When executing a script, WIB shall verify that the next WIB command pointer is never moved outside of the current script. The WIB commands Skip, Select Item, Check Terminal Profile and Branch On Variable Value include moving the next WIB command pointer forwards or backwards in the script. When executing any of those WIB commands, WIB shall generate an error according to chapter 8 if the next WIB command pointer is moved outside the current script. When reaching the normal end according to maximum script length, WIB shall terminate execution of the current script without reporting an error. 7.3 Addressing of Scripts in EFBytecode Script addressing is the process of transforming the input in either of the following cases to an address in EFBytecode:

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

39

an Execute Local Script WIB command according to [CSP] an ENVELOPE (MENU SELECTION) command according to [11.14] a WIB event, triggered either by an ENVELOPE (EVENT DOWNLOAD) command according to [11.14] or an internal event.

A WIB implementation shall support two addressing modes and shall be configurable regarding which mode is to be used. The length of a script address shall also be configurable. Please refer to the specification of EFScriptAddress in section 10.12 for details on how to configure the mode and address length. 7.3.1 Execute local script Execution of an Execute Local Script WIB command is independent of addressing mode used. The Execute Local Script WIB command always uses absolute addresses. It is performed by searching the entries of the EFScriptAddress for the script identifier in the WIB command. When the script identifier is found, the corresponding entry also contains the absolute address of the script in EFBytecode. The actual address in EFScriptAddress really points to the length bytes preceding each script.
EFBytecode

Free space Length bytes Script

0000

00C5

01A5

EFScriptAddress
'XX02' 0000061C0000
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

00001A0301A5 00003E0500C5

Figure 1Addressing of local scripts

The figure above shows an example of file contents where three scripts are accessible through the Execute Local Script WIB command. The first part of each field in EFScriptAddress contains the script identifier to be matched with the WIB command input. The second part contains the address of the corresponding script in EFBytecode.
40

7.3.2 Menu Selection and WIB Event The handling of menu selection and WIB events depends on addressing mode used. The addressing modes absolute addressing and relative addressing are defined according to the following. The addressing mode is separately configurable for menu selection and WIB event.
7.3.2.1 Absolute Addressing Mode

The item identifier input in menu selection and WIB event is interpreted as an entry in EFScriptAddress. EFScriptAddress stores the absolute addresses of all scripts contained in EFBytecode. The actual address in EFScriptAddress really points to the length bytes preceding each script. The first byte of the address is most significant. The least significant byte of the address of the first byte in EFBytecode has the value '00'h.The entries in the file are counted starting with 1.

EFBytecode
Free space Length bytes Script

0000

00C5

01A5

EFEventConfig
'02' '02'

EFScriptAddress
'0302' 0000061C0000 00001A0301A5 00003E0500C5

EFMenu
02 01 Balance MyBank

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Figure 2 Absolute script addressing

The format of the files is specified in chapter 10. The example in the figure above shows that menu entries in EFMenu are addressing the first and third scripts of EFBytecode. The third script in EFBytecode is also addressed by the event type '02'h, Call disconnected according to [11.14]. The second script in EFBytecode is currently not addressed by any menu or event configuration entry but may be reached through the Execute Local Script WIB command.
7.3.2.2 Relative addressing mode

41

The item identifier input in menu selection and WIB event is interpreted as an ordinal in EFBytecode. WIB iterates through EFBytecode to find the script to be executed. This relies on the two length bytes preceding each script in EFBytecode. Based on the length, WIB finds the length bytes preceding the next script. Counting from 1, WIB shall repeat this procedure until it finds the script that corresponds to the ordinal given as input.
EFBytecode
Free space Length bytes Script

0000 (1)

00C5 (2)

01A5 (3)

EFEventConfig
'02' '03'

EFScriptAddress
'0002' 0000061C0000 00001A0301A5 00003E0500C5

EFMenu
03 01 Balance MyBank

Figure 2 - Relative script addressing

The figure above shows an example of file contents when using relative addressing. The format of the files is specified in chapter 10. The example in figure 2 shows that menu entries in EFMenu are addressing the first and third scripts of EFBytecode. The third script in EFBytecode is also addressed by the event type '02'h, Call disconnected according to [11.14]. The second script is currently not addressed by any menu or event configuration entry but may be reached through the Execute Local Script WIB command.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Since the start address of a certain script is determined based on the length bytes of all preceding scripts in EFBytecode file this is called relative addressing. 7.4 WIB Script Size and Script Identifier Support A WIB shall be capable of executing scripts that are of the same size as EFBytecode, and include any combination of WIB commands that fits into the EFBytecode. A minimum of 1024 script identifiers for locally stored scripts shall be supported. The first 255 script identifiers stored in EFScriptAddress shall be reachable from the

42

menu and event list. All script identifiers shall be reachable from the Execute Local Script WIB command. 7.5 Plug-in Handling A WIB plug-in is an extension to the WIB functionality. A script may access a plug-in through the Plug-In WIB command as defined in section 5.1.4. Plug-ins may be preinstalled on the SIM card. Plug-ins may also be downloaded Over-The-Air at any time after the SIM card has been issued. The Install Plug-In WIB command is used for making a downloaded plug-in accessible through the Plug-In WIB command. The Remove Plug-In WIB command is used to remove a plug-in. Plug-ins are an optional feature to WIB but not the Plug-in WIB command, and they are described in their own documents called Plug-in Specifications. 7.6 Handling of fields in ENVELOPE and TERMINAL RESPONSE WIB shall handle length fields according to GSM 11.14 annex D, which describes the format for lengths greater than 127 bytes. WIB shall handle both that the Comprehension Required bit is set and not set in tag values in ENVELOPE and TERMINAL RESPONSE. Annex B specifies error codes and behaviour of WIB in relation to TERMINAL RESPONSE. 7.7 Variable Handling There may be up to 252 variables in each script. The variable name is 1 byte long. Variable names range from 1 to 255, but the values 0, '80'h, '81'h and '82'h are reserved for special cases. Variable names in the range ['E0'h-'FF'h] shall be cleared only when executing a New Context WIB command where the Attribute field indicates clearing of these or when terminating WIB script execution due to condition 1, 3 or 5 described in 7.2 or on card reset. These variables may be used to pass data to another script. The rest of the variable range shall be always be cleared when terminating WIB script execution or when executing an Execute Local Script WIB command.

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

43

Variables shall be stored un-typed, for instance as tag-length-value fields one after the other, where the tag contains the variable name index. It is possible to set the same variable several times to different values within a script. WIB shall support a minimum size of 255 bytes for each variable. If up to 30 variables are used, the total available space for variable values shall not be smaller than 1000 bytes regardless of variable size. For each additional variable, this total value space shall not decrease by more than 2 bytes. If 300 bytes of the total value space is free it shall be possible to allocate a new variable with size 255 bytes. Variables may not in turn contain variable references, and the contents of variables are never byte-stuffed. 7.8 Character Set The character sets used by WIB are the ones defined in [03.38], either the GSM 7 bit default alphabet or the UCS2 character set. Conversion between these two character sets shall be done according to Annex A of the current document. 7.9 Wait for Response State
server-bound message Sending info sending state intermediate info intermediate state client-bound message receiving info 1/4 2/4 3/4 4/4 receiving state

waiting-for-response state

Figure 3 Behaviour during submit and receive


WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

WIB shall implement a wait-for-response behaviour. The purpose of the wait-forresponse behaviour is to prevent the user from using the menus to start executing local scripts while a script is expected to be received from the network. To describe this functionality two states are defined for the WIB execution: normal execution state and wait-for-response state. The wait-for-response state is entered either as part of the default behaviour or as part of a forced behaviour, see below. When WIB is in the wait-for-response-state it shall block further execution of scripts initiated through menu selections by the user. WIB shall instead issue a PLAY TONE proactive SIM command to alert the user that menu selection is not allowed. Optionally, an Alpha Identifier and/or icon can be posted as a parameter

44

to the PLAY TONE proactive SIM command, resulting in that the Alpha Identifier and/or icon is displayed on the ME when the tone is played. WIB shall after a number of user retries, specified by the persevere-counter in EFWIBConfiguration, exit the wait-for-response state and again allow menu selections. The persevere counter in EFWIBConfiguration indicates how many times the menu selection is blocked before WIB allows the execution of the associated script. If the persevere counter is '0' the function is disabled, if '1', WIB will block one menu selection but allow the second attempt et cetera. If alpha identifier and/or icon are present in the EFText, they are passed along as parameters to the PLAY TONE proactive SIM command. 7.9.1 Default behavior When a server bound message is submitted to the network due to the execution of a Submit or Submit Extended WIB command and the TAR to be used is of type Pull then WIB shall enter a wait-for-response-state. The wait-for-response-state is exited when the next client-bound message is received from the network and on the same TAR on which the outgoing message was sent. The wait-for-response-state shall not be entered when submit WIB command is to be executed on a TAR defined as being of type Push or Administration in EFTAR. When executing event-triggered scripts, wait-for-response state shall not be entered. If a script is received on a Push TAR and contains a Set Return TAR value WIB command that sets the TAR to a Pull TAR, the wait-for-response state shall be entered since the next Submit is executed on the Pull TAR. 7.9.2 Forced Behaviour The Submit Extended WIB command contains two attributes to override the default behaviour. It allows setting of the wait-for-response behaviour regardless of TAR type. The WIB command contains a "force" flag and an "action" flag. The "force" flag is indicating if the "action" flag is valid or not. The "action" flag indicates whether WIB shall enter wait-for-response-state or not. The behaviour of the Submit Extended WIB command is specified in 5.1.11. 7.9.3 Default Progress Information The default progress information consists of two parts, called the intermediateinfo and the receiving-info, each part having its own alpha identifier and/or icon configured in EFText. The default progress information is shown when WIB is in a wait-for-response state. Default progress information is activated if EFText contains
45

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

the respective alpha identifiers or icons. If default progress information is activated, WIB shall display the progress of receiving 03.40 messages.. The intermediate-info is displayed as soon as the WIB has entered the wait-forresponse-state after the submit WIB command and is displayed until the next incoming client-bound message is received. If the incoming client-bound message consists of several segments, WIB shall display the receiving-info. When receiving concatenated messages, WIB shall begin to display the receiving-info when receiving the segment containing the sequence number with the value 1. The receiving-info is thereafter updated for each new received segment. The alpha identifier for receiving-info may contain the escape characters %C, %T and %P where C is the order of the current short message being received, T is the total number of short messages expected and P is the percentage of messages received. Only the integer part of the percentage shall be given. WIB shall replace the occurrences of these escape sequences with its current values before displaying. For example if the alpha identifier for receiving-info contains the text "Receiving(%C/%T)" then the resulting screen display shall be "Receiving (1/3)" when the first message of three has been received. If the Alpha Identifier contains the text "Receiving %P%%", the resulting display shall be "Receiving 33%" after reception of the first message out of three." To be able to use the actual '%' in its original form it must be preceded with an extra '%', that is "%%". The display of the default progress information may be overridden by the Submit Extended WIB command. The alpha identifiers and/or icons for intermediate-info or receiving-info supplied in the Submit Extended WIB command replace their counterparts in the default progress information, or the attribute settings of the Submit Extended WIB command disable completely the use of the default progress information.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

The display mechanism used for showing progress information shall not violate the ability to receive new incoming messages. The display mechanism shall not require any user action. 7.10 Event Handling The EFEventConfig is read at startup by WIB and an action is taken to subscribe to the corresponding events if any are configured. WIB shall only attempt to enable

46

events that are supported by the handset according to the TERMINAL PROFILE. Events not supported by the handset shall be silently ignored by WIB. When an event occurs, WIB scans EFEventConfig for the event, and starts execution of the corresponding script. The file contains event-item-id pairs, one after the other, until an end mark (event type 'FF'h) occurs. When an event has occurred, the item id in the corresponding pair shall be treated in the same way as an item id from a menu selection. If the item id does not exist, the error shall be silently ignored by WIB. Each event type shall not occur more than once in the list. If an RFU event type is encountered, it shall be ignored by WIB. If the script that is activated by an event contains a Submit WIB command, the default Pull TAR shall be used, unless an explicit Set Return TAR Value WIB command has been executed previously in the script. As default behaviour, when executing event-triggered scripts, WIB does not enter the wait-for-response state described in section 7.9. If an event occurs, and WIB is already busy executing another script, or is in the wait-for-response state, the event shall be queued and executed later as soon as possible when none of these conditions are at hand. Events shall be queued only once per event type, and in a priority following the order they appear in the EFEventConfig, with the first entry as highest priority, NOT in the order they occur. If an event of the same type occurs a second time, the first entry of that type is discarded and replaced with the new one. The event queue is cleared at SIM initialization. 7.10.1 Description of events In addition to the event types described in [11.14], SIM internal events can be generated. The internal events described in this specification shall be generated by WIB. Generation of additional internal events according to separate specifications is optional.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

7.10.1.1 Startup Event

After SIM initialization WIB shall generate a startup event. This event shall be generated when the ME is able process proactive commands after startup. This event can be referenced by the event configuration in EFEventConfig with event type coded according to section 10.9.

47

7.10.2 Contents of variables at start of script When WIB starts a script as a result of an event, the following data according to GSM 11.14 shall first be stored in variables. If the data is not available, the variable shall be set to an empty string.

Event MT call Call connected Call disconnected Location status User activity Idle screen available Card reader status Language selection Browser termination Data available Channel status

Variable id and the data to be stored '90'h: Address of calling line identity '91'h: Called party subaddress '90'h: Device identities '90'h: Device identities '91'h: Cause of disconnection '90'h: Location status '91'h: Location information

'90'h: Card reader status '90'h: Language selection '90'h: Termination cause '90'h: Channel status '91'h: Channel data length '90'h: Channel status

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

48

8 Error Handling
If an error occurs the WIB script execution shall terminate. WIB shall thereafter display an error text using the DISPLAY TEXT proactive SIM command. The behavior of the proactive SIM command shall be the same as for Display Text WIB command, tag '02'h/'82'h. WIB shall then terminate. An exception is Provide Local Information WIB command, where errors shall be ignored to facilitate implementation of services that pick out the best information from the ME. See ref [CSP]. Another exception is Display Text Extended WIB command. If Immediate Response data object is included in DISPLAY TEXT proactive SIM command and the ME responds with "Command data not understood by ME" result value, WIB shall ignore it and continue execution. Annex B specifies error codes and behaviour of WIB in relation to TERMINAL RESPONSE received from the ME. The error message to be displayed contains ErrorText including DetailedErrorInfo, if so configured. The DetailedErrorInfo is a string of hexadecimal numbers on the form ErrorCode CommandTag TerminalResponse/FileIdentifier. CommandTag is the tag for the WIB command that was executing when the error occurred. TerminalResponse is the terminal response general result value if a proactive SIM command was issued. See below regarding the use of FileIdentifier. If the error occurred for other reasons than that a WIB command failed, the CommandTag field is set to "XX". If TerminalResponse/FileIdentifier is not applicable it shall be left out. When the ErrorCode is '1F'h, failed to access file, the file identifier of the file that could not be accessed shall be given instead of the TerminalResponse. When an error occurs, EFErrorText is searched for an entry for the particular error code. If an entry is found and has an error text, the error text shall be presented. If an entry is found but does not contain an error text no error text shall be presented. If no entry is found for the error code, the error text connected to the special error code 'DF'h shall be used. It is mandatory to have an entry defined for error code 'DF'h if any error code used by the WIB implementation is not assigned to an individual error text. WIB shall display the real error code when DetailedErrorInfo is contained in the error text of the special error code 'DF'h. The use of the DetailedErrorInfo is configurable. The escape sequence "%D" within the error text specifies where the detailed error information shall occur. For example, the ErrorText may be defined as Error message: %D. The ErrorText will then be on the form Error message: ErrorCode CommandTag

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

49

TerminalResponse. If "%D" is not found in ErrorText then no DetailedErrorInfo is shown. To be able to use the actual '%' in its original form it must be preceeded with an extra '%', That is "%%". Possible error codes are defined in the table below. The error code is displayed using hexadecimal formatting. Example 1 WIB tries to send an SM, but the request is rejected by the ME. If the error text in EFErrorText is "Failed to connect to the network: %D", WIB shall display "Failed to connect to the network: 40 01 21" to the user. In that string, 40 means proactive SIM command rejected by ME, 01 is the WIB command tag for a Submit WIB command and 21 is a TERMINAL RESPONSE general result received from ME. Example 2 WIB executes an incorrect WIB script that jumps out of bounds on a Check Terminal Profile WIB command. If the error text in EFErrorText is "Incorrect script. %D", WIB shall display "Incorrect Script 2B 17" to the user. Example 3 WIB tries to access the file 2700/6FA3 that is not on the card and it is not connected to a specific WIB command. If the error text in EFErrorText is "File access failure. %D", WIB shall display "File access failure. 1F XX 2700/6FA3" to the user.
File Access Errors

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Error code (range 1-1F) '01'h '02'h '03'h '04'h '05'h '06'h '1F'h

Error text (Example) Failed to find/read EFBytecode Failed to find/read EFTAR Failed to access/read EFErrorText Failed to find/read EFSMSHeader Failed to read key file Failed to find/read EFVersionInformation Failed to access file

Comments

WIB command Errors

50

Error code (range 20-3F) '20'h '21'h '22'h '23'h '24'h '25'h '26'h

Error text (Example) Unknown WIB command found Variable substitution failed Too many variables used Out of variable memory Script too large to handle SMS TPDU Tag in incoming SMS not found Creation of SELECT ITEM failed Encryption/decryption failed Out of buffer space Plug-in not found

Comments

This error is not allowed This error is not allowed

WIB could not create SELECT ITEM proactive SIM command

'27'h '28'h '29'h

The called plug-in does not exist on the SIM card or the name of the plug-in is wrong

'2A'h '2B'h

Bad format on proactive SIM command Goto out of bounds

Skip, Select Item, Check Terminal Profile or Branch on variable value is pointing outside the current script.

'2C'h '2D'h '2E'h '2F'h


WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

E2PROM memory problem Command error in client bound message Configuration error Set Return TAR Value not allowed

Application tries to change from Pull or Push TAR to the Admin TAR. Or the target TAR is not defined in EFTAR.

'30'h '31'h '32'h '33'h '34'h

Script not found Timer management failure. Return from script not allowed Invalid input data to WIB command Invalid incoming message

Text shown as error message if an error occurs in the 03.48 message processing.

51

ME Errors

Error code Error text (Example) (range 40-5F) '40'h Proactive SIM command rejected by ME

Comments The following result codes in TERMINAL RESPONSE: '31, '32', '33', '34', '35', '36', '37' and '39'. WIB expected a terminal response for another command type

'41'h

'42'h '43'h

'44'h

Wrong type of command returned by ME in terminal response Get Input did not return a string No item identifier was returned by ME in the terminal response to a Select Item Temporary error occurred in application. Please try again later.

ME returned a temporary error. The following result codes in TERMINAL RESPONSE: '20', '21', '25' and '26'. The following result code in TERMINAL RESPONSE: '30' or the command type is not defined in TERMINAL PROFILE. No longer used, command information included in the DetailedErrorDescription No longer used, command information included in the DetailedErrorDescription

'45'h '46'h

Error in format of received SM Command not supported by the mobile

'47'h

SET UP CALL failed

'48'h
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

SET UP EVENT LIST failed

Plug-in Errors

Error code (range 60-7F) '60'h '61'h '62'h '63'h

Error text (Example) Invalid input parameter(s) Input out of bounds Output overflow RSA error

Comments

52

'64'h '65'h '66'h


Default Errors

Illegal operation Integrity error PIN length error

'DF'h

Error in application occurred. Please call support.

User friendly error text

Proprietary Errors

Proprietary Errors may be added in the 'E0'h-'FF'h series. If a WIB implementation uses any proprietary error codes, it is the responsibility of that implementation to provide descriptions for those codes.

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

53

9 Optional WIB features


This chapter describes features that are optional for WIB. 9.1 Bookmarking 9.1.1 Introduction The bookmarking feature provides a way of storing the data submitted by a Submit Extended WIB command for direct access at a later time. This is similar to the bookmarks in Netscape and MSIE. The end-user can easily resubmit the bookmarked data later on from a bookmark menu. 9.1.2 Behavior for WIB without Bookmarking A WIB that does not support bookmarking must still accept the Submit Extended WIB command including the data fields relating to the bookmark feature. 9.1.3 Configurability In a WIB that supports bookmarking, certain aspects of the functionality shall be configurable. It shall be possible to configure WIB as to whether bookmarking shall be enabled and thus be available to the end-user. This is configured in EFMenu. If bookmarking is disabled, WIB shall behave as a WIB that does not support bookmarking. Furthermore, the following text strings shall be configurable. The text strings are stored in EFText.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

String Name Menu-entry-string

Storage-query-string

Name-query-string Remove-entry-string

Purpose The menu-entry-string controls the name that the bookmark feature shall have in the menu. The storage-query-string controls the question that WIB shall ask the user to find out if the current data shall be bookmarked. The name-query-string controls the name that the bookmark shall be stored under The remove-entry-string controls the name that the remove bookmark list item shall

Example "My Bookmarks"

"Do you want to store this as a bookmark?"

"Name of bookmark?" "Remove bookmark"

54

Unstorable-error-string Positive-answer-string Negative-answer-string Duplicate-name-string

have. The unstorable-error-string controls the text to be displayed to the end-user when a bookmark cannot be stored. The string that represent a postive answer alternative in a selection. The string that represent a negative answer alternative in a selection. The string that shall be displayed when attempting to store a new bookmark with the same name as an existing one.

Error - bookmark cannot be stored "Yes" "No" "Bookmark name already exists. Please choose another one."

Both UCS2 and GSM Default character encoding shall be accepted in the configurable text strings associated with the bookmarking feature. 9.1.4 Storing of Bookmarks The possibility for bookmarking is indicated by the presence of either of the fields Default Bookmark Name or Icon Identifier For Bookmark in the Submit Extended WIB command. When executing a Submit Extended WIB command that indicates that bookmarking is possible, WIB shall check if bookmarking is enabled. If bookmarking is disabled, WIB shall behave as a WIB that does not support bookmarking. If bookmarking is enabled, WIB shall examine if the Output field, after variable substitution, is already stored as a bookmark. If not already stored, WIB shall, using the storage-query-string, ask if the user wishes to store it as a bookmark. The user shall be presented with two options as defined by the positive-answerstring and the negative-answer-string defined in section 9.1.3. If the answer is positive, WIB shall prompt the user for a name to store the data under, using name-query-string. The alpha identifier provided as Default Bookmark Name shall be given as proposal.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

If the name for the new entry is already in use for an existing entry, WIB shall inform the user using the duplicate-name-string and thereafter prompt the user for a new name. WIB shall thereafter store the bookmark data to the bookmark storage. The data to be stored is the Output field after variable substitution, the current TAR, the enduser assigned name for the bookmark as well as the optional Icon Identifier For Bookmark. After the bookmark save is completed, WIB executes the transmission of the data in the Output field to the server component.

55

If the size of the bookmark data to store is larger than the free space in the bookmark storage, an error message shall be displayed to the end-user. The text of the error string shall be taken from the configuration string unstorable-errorstring, see section 9.1.3. WIB shall thereafter proceed to execute the Submit Extended WIB command. The bookmarks shall be stored by WIB in a permanent storage. WIB shall be able to support bookmark storage with room for a minimum of three (3) bookmarks each of which may be of size up to 512 bytes. The operational configuration is defined by the operator. 9.1.5 Presentation and Navigation WIB shall insert a menu entry in the last menu position. The name of the menu entry shall be taken from the configuration string menu-entry-string, see section 9.1.3. When the menu entry is selected, WIB shall present the bookmarks in a list for the end-user to select one of them. If none of bookmark entries have an icon identifier stored, no icons shall be used in the presentation of this list. If at least one bookmark entry has an icon identifier, any bookmark entry not having an icon identifier stored and the remove bookmark item shall be presented in the menu using the default icon identifier '01'h. If not all icons of the menu entries are self-explanatory, the icon list qualifier shall be set to "not self-explanatory". When the end-user selects a bookmark for navigation from the bookmark menu, WIB shall behave as if executing a Submit WIB command. 9.1.6 Management of Bookmarks WIB shall provide an interface for the end-user to remove bookmarked data in an easy and user-friendly way. WIB shall insert a remove bookmark item in the last position of the bookmark list presented to the end-user when the bookmark menu entry has been selected. The name of the list item shall be taken from the configuration string remove-entrystring, see section 9.1.3. When the remove bookmark item has been selected, WIB shall present the bookmarks in a list for the end-user to select one of them to be removed. The presentation of icons in this list shall be the same as in the list including the remove bookmark item. The bookmark selected in the list shall be removed from the bookmark storage and the space shall be freed.

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

56

10 WIB Setup Files


There are some administrative data that WIB has to keep track of. To store that information a set of elementary files is defined. The structure and contents is described below. All elementary files are stored in dedicated file 2700 under the master file. 10.1 EFTAR (6F1A) This file contains the TAR values that WIB listens to and replaces the deprecated EFTAR(6F01). Incoming 03.48 messages that do not contain a TAR value listed in this file shall be discarded. Records 1, 2 and 3 of this file shall always contain a Pull, a Push and an Administration TAR, in that order. They are referred to as the 'default' entries for the specific TAR type.
Identifier: '6F1A' Record length : 5 bytes Access Conditions: READ UPDATE INVALIDATE REHABILITATE Bytes 1 2-4 5 Structure: linear fixed Mandatory Update activity: low ADM ADM ADM ADM Description TAR type TAR value SC index M/O M M M Length 1 byte 3 bytes 1 byte

Coding:
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Field TAR type

Contents As explained in 4.4.1.

TAR value SC index

Toolkit Application Reference. Index of related SC contained in EFSC

Coding '00'h = Pull 01'h = Push '02'h = Administration '03'h 'FF'h = RFU As defined in [03.48] '01'h refers to the first SC, '02'h to the second, and so on.

10.2 EFErrorText (6F02)

57

Identifier: '6F02' File size: X bytes Access Conditions: READ UPDATE INVALIDATE REHABILITATE Bytes 1 to A A+1 to A+B : A++1 to A++N A++N+1 A+Z+1

Structure: transparent Mandatory Update activity: low ADM ADM ADM ADM Description M/O M M : M M O Length A B : N 1 Z

Error #1 Error #2 : Error #n Endmark value '00'h Padding ('FF''FF')

Coding of each error field:


Field Length Error Code DCS Error Text Contents Length of the following bytes Data Coding Scheme Displayed error text in case of an error. Coding 2+X According to section 8. According to [03.38] . According to the Data Coding Scheme. Length 1 1 1 X

At least error code 'DF' shall be defined in this file, unless all individual error codes used by the WIB implementation are defined. 10.3 EFBytecode (6F03) This file contains locally stored scripts that may be run by WIB. Scripts are described in [CSP].
Identifier: '6F03' File size: Z bytes
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Structure: transparent Mandatory Update activity: low ADM ADM ADM ADM Description M/O M Length Z

Access Conditions: READ UPDATE INVALIDATE REHABILITATE Bytes 1 to Z

Bytecode

File structure depends on the used addressing mode. Absolute addressing mode is described in section 7.3.2.1and relative addressing mode in section 7.3.2.2.

58

10.4 EFSMSHeader (6F04) This file contains the SMS header to be used in Submit and Submit Extended WIB commands.
Identifier: '6F04' Record length: 27 bytes Access Conditions: READ UPDATE INVALIDATE REHABILITATE Bytes 1 to 12 13 to 24 25 26 27 Structure: linear fixed Mandatory Update activity: low ADM ADM ADM ADM M/O M M M M M Length 12 bytes 12 bytes 1 byte 1 byte 1 byte

Description TP-Destination Address TS-Service Centre Address TP-Protocol Identifier TP-Data Coding Scheme TP-Validity Period

Coding:
Field TP-Destination Address TS-Server Centre Address TP-Protocol Identifier TP-Data Coding Scheme TP-Validity Period Contents As defined for SM-TL address fields in [03.40]. As defined for RP-Destination address Centre Address in [04.11]. Protocol Identifier Data Coding Scheme As defined in [03.40] for the relative time format. Coding Unused nibbles are set to F. Unused nibbles are set to F. As defined in [03.40] As defined in [03.38] As defined in [03.40]

10.5 EFSC (6F1B) This file is used according section 4.7 and replaces the deprecated EF03.48Header (6F05).
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

59

Identifier: '6F1B' File size: A+B++N+X bytes Access Conditions: READ UPDATE INVALIDATE REHABILITATE Bytes 1 to A A+1 to A+B A+B++1 to A++N A+B++N+1

Structure: transparent Mandatory Update activity: low ADM ADM ADM ADM Description M/O M M M M M Length A B N 1

SC #1 SC #2 SC #n End-mark

The end-mark is coded 'FF'h. The file contents after the end-mark is undefined. Each SC shall be coded according to:
Field Tag Contents Tag matching the BER encoding of the tag of the SEQUENCE ASN.1 type. The length of following fields (including padding) Reference to counters for incoming and outgoing messages. SPI-KIc-KID to be used in outgoing GSM 03.48 messages. List of acceptable SPIKIc-KID combinations for incoming messages. References to KIc keys. References to KID keys. Optional padding. Coding '30'h Length 1

Length of SC Counters Outgoing SPI-KIcKID Incoming SPI-KIcKID list KIc key set KID key set
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

10+A+B+C+D According to 10.5.1. According to 10.5.2. According to 10.5.3. According to 10.5.4. According to 10.5.5. 'FF FF FF', as many as necessary.

1 4 6 A B='02'h'22' h C='02'h'22' h D

Padding

10.5.1 Coding of 'Counters'

60

Field Tag Length Outgoing counter Incoming counter

Contents Ref. to the outgoing message counter. Ref. to the incoming message counter.

Coding '80'h '02'h The ref. is a record ID, pointing to a record in EF03.48Counter The ref. is a record ID, pointing to a record in EF03.48Counter.

Length 1 1 1 1

10.5.2 Coding of 'Outgoing SPI-KIc-KID'


Field Tag Length SPI KIc KID Contents Coding '81'h '04'h Coding according to [03.48] section 5.1.1. Coding according to [03.48] section 5.1.2. Coding according to [03.48] section 5.1.3. Length 1 1 2 1 1

The SPI bytes. The KIc byte. The KID byte.

10.5.3 Coding of 'Incoming SPI-KIc-KID list'


Field Tag Length SPI-KIc-KID entry #0 SPI-KIc-KID entry #1 : SPI-KIc-KID entry #k Contents Total length of all value bytes. Coding '82'h 4*k Coded as defined below. Coded as defined below. : : Coded as defined below. Length 1 1 4 4 : 4

Each 'SPI-KIc-KID entry' in the list shall be coded according to:


WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Field SPI KIc KID

Contents The SPI bytes. The KIc byte. The KID byte.

Coding Coding according to ref. [03.48] section 5.1.1. Coding according to [03.48] section 5.1.2. High nibble is to be ignored. Coding according to [03.48] section 5.1.3. High nibble is to be ignored.

Length 2 1 1

10.5.4 Coding of 'KIc key set'

61

Field Tag Length KIc #1 Key ref. #1 KIc #2 Key ref. #2 : KIc #m (Note) Key ref. #m

Contents Total length of the following fields. KIc index of key #1 KIc key reference #1, pointing to the key in the key file. KIc index of key #2. KIc key reference #2, pointing to the key in the key file. : KIc index of key #m

Coding '83'h 2*m Value in range '00'h to '0F'h.

Length 1 1 1 1

Value in range '00'h to '0F'h.

1 1

: Value in range '00'h to '0F'h.

: 1 1

KIc key reference #m, pointing to the key in the key file. Note: m is less than or equal to 16

The value part does not have to contain more Kic/key ref. pairs than need. The length must always reflect the true length of the value-list. 10.5.5 Coding of 'KID key set'
Field Tag Length KIc #1 Key ref. #1 KIc #2 Key ref. #2 : KIc #p (Note) Key ref. #p Contents Total length of following fields. KIc index of key #1 KIc key reference #1, pointing to the key in the key file. KIc index of key #2. KIc key reference #2, pointing to the key in the key file. : KIc index of key #p Coding '84'h 2*p Value in range '00'h to '0F'h. Length 1 1 1 1 Value in range '00'h to '0F'h. 1 1 : Value in range '00'h to '0F'h. : 1 1

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

KIc key reference #p, pointing to the key in the key file. Note: p is less than or equal to 16

The value part does not have to contain more Kic/key ref. pairs than needed. The length must always reflect the true length of the value-list.

62

10.6 EF03.48Counter (6F06) This file contains all the counters required by the security configurations.
Identifier: '6F06' Record length: 5 bytes Access Conditions: READ UPDATE INVALIDATE REHABILITATE Bytes 1 to 5 Structure: linear fixed Mandatory Update activity: High ADM ADM ADM ADM Description Counter (CNTR) M/O M Length 5 bytes

Coding of counter:
Field CNTR Contents Counter Coding As defined in [03.48]

10.7 EFVersionInformation (6F07) This file contains different kinds of version information.
Identifier: '6F07' File size: X bytes, X>=5 Access Conditions: READ UPDATE INVALIDATE REHABILITATE Bytes 1 2-4 5 6 to A+5 6+A to 5+A+B : 6++N to 5+A++N 6+A++N to 5+A+N+Y Structure: transparent Optional Update activity: low ADM ADM ADM ADM M/O M M M O O : O O Length 1 3 1 A B : N Y

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Description Manufacturer identifier WIB version number Number of following plug-in entries Plug-in #1 Plug-in #2 : Plug-in #n Padding bytes ('FF''FF'h)

Manufacturer identifier is defined by SmartTrust. Coding of the WIB version number:

63

Field Main version Sub-version Manufacturer specific WIB version

Contents First number of the WIB version Second number of the WIB version Manufacturer specific WIB version

Coding Hexadecimal Hexadecimal Proprietary

Length 1 1 1

For example WIB 1.3 shall be coded 01 03 FF, if the manufacturer specific version is not used. Coding of the plug-in field:
Field Length Plug-in name Plug-in version Contents Length of the plug-in name Plug-in name used in the Plug-In WIB command Manufacturer specific plug-in version Coding Length (X) According to appropriate plug-in specification Manufacturer specific coding Length 1 X 3

10.8 EFWIBConfiguration (6F08) This EF is reserved for configuration of WIB.


Identifier: '6F08' File size: X bytes, X>=1 Access Conditions: READ UPDATE INVALIDATE REHABILITATE Bytes 1
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Structure: Transparent

Mandatory

Update activity: low ADM ADM ADM ADM M/O M Length 1

Description Persevere counter initial value

Coding:
Field Persevere counter initial value Contents Coding According to section 7.9. Length 1

64

10.9 EFEventConfig (6F0B) This file contains a list of events, each connected to a script in the EFBytecode 6F03.
Identifier: '6F0B' File size: X bytes, X>=1 Access Conditions: READ UPDATE INVALIDATE REHABILITATE Bytes 1 to A A+1 to A+B : A++1 to A++N A++N+1 ADM ADM ADM ADM Description Event #1 Event #2 : Event #n End-Mark M/O M M : Length A B : N 1 Structure: Transparent Update activity: low Optional

The end-mark is coded 'FF'h. The file contents after the end-mark is undefined. Coding of event fields:
Field Event type Contents Defined the type of expected event Coding According to [11.14]. Additional event type identifiers: 80h: Startup event '81'h'8F'h: reserved '90'.. 'A0': reserved for customer-specific events 'A1'h'FD'h: reserved for SmartTrust 'FE'h: used according to 5.2.3 '00'h: Event is not active Other values depend on the used addressing mode as described in sections 7.3.2.1 and 7.3.2.2. Length X Event specific Length 1

Item identifier

Item identifier address to the script to be executed when the event occurs.

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Length of event specific parameter Event specific parameters

Length of the following field Event specific parameters

1 X

10.10 EFText (6F1C) This file contains text to be displayed to the user in different situations. The usage for each entry is predefined for a specific purpose and specified here. The text

65

content may be decided upon personalization or changed Over-The-Air.


Identifier: '6F1C' File size: X bytes Access Conditions: READ UPDATE INVALIDATE REHABILITATE Bytes 1 to A A+1 to A+B : A++1 to A++N A++N+1 Structure: transparent Mandatory Update activity: low ADM ADM ADM ADM Description Text #1 Text #2 : Text #n End-mark M/O O O : O M Length A B : N 1

The end-mark is coded 'FF'h. The file contents after the end-mark is undefined. All text fields are coded according to the table below:
Field Tag Length Alpha Id Tag Length of the alpha identifier Alpha identifier Icon Tag Icon qualifier Icon identifier Contents Identifies the text object Length of the following fields Length of the alpha identifier Text to display Icon qualifier EFIMG record number Coding According to section 10.10.1 (5+X) or (2+X) '00'h Length (X) '00'h means that the alpha identifier is a null object According to EFADN '01'h According to [11.14] According to [11.14] M/O M M O Length 1 1 1 1

X 1 1 1

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

For UCS2 support only the coding scheme with first octet set to '80'h needs to be supported. Coding schemes with first octet set to '81'h or '82'h may optionally be supported. If the length of the alpha identifier is zero, the corresponding object in the proactive command shall have zero length.

66

10.10.1 Defined text fields


Tag '01'h Usage Default text and/or icon to be used when issuing a SEND SHORT MESSAGE proactive SIM command due to a Submit or Submit Extended WIB command. Text and/or icon included in the Menu-entry-string according to section 9.1.3. Text and/or icon included in the Storage-query-string according to section 9.1.3. Text and/or icon included in the Name-query-string according to section 9.1.3. Text and/or icon included in the Remove-entry-string according to section 9.1.3. Text and/or icon included in the Unstorable-error-string according to section 9.1.3. Text and/or icon included in the Positive-answer-string according to section 9.1.3. Text and/or icon included in the Negative-answer-string according to section 9.1.3. Default text and/or icon to be used for informing the user that WIB is in a wait-for-response-state. Usage according to 7.9 Default text and/or icon to be used for showing receiving-info as part of the progress information. Usage according to 7.9 Default text and/or icon to be used as intermediate-info as part of the progress information. Usage according to 7.9 Text and/or icon included in the Duplicate-name-string according to section 9.1.3 RFU Implementation specific Non-used Text

'02'h '03'h '04'h '05'h '06'h '07'h '08'h '09'h '0A'h '0B'h '0C'h '0D'h'7F'h '80'h - 'FD'h 'FE'h

Tag 'FE'h indicates that the TLV is not used. The Tags may occur in the file in any order. 10.11 EFMenu (6F18) This file contains the menu data to be used as input for preparation of a SET UP MENU proactive SIM command.
WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

The contents of this file will determine which script is to be executed when the user selects a menu item.

67

Identifier: '6F18' Record length: Z bytes (Z 7) Access Conditions: READ UPDATE INVALIDATE REHABILITATE

Structure: linear fixed Mandatory Update activity: low ADM ADM ADM ADM

Bytes 1 2 3 4 5 6 7 to Z+6 Bytes 1 2 3 4 5 6 7 to X+6 x+7 to X+Z+6

Description of the first record Description RFU Bookmarking Indication SET UP MENU parameter Icon identifier for the main menu text Icon qualifier for the main menu text Icon list qualifier for the item list RFU Description of the remaining records Description Item status Item identifier Menu ordinal RFU Icon identifier Menu text length Menu text Padding with "FF"

M/O M M M M M M M M/O M M M M M M M O

Length 1 1 1 1 1 1 Z bytes Length 1 1 1 1 1 1 X Z

Coding of the first record:


Field Bookmarking Indication SET UP MENU parameter Contents Coding '00'h: Bookmarking is enabled '01'h: Bookmarking is disabled '02'-'FF'h: RFU '00': The main menu is generated, SETUP MENU is issued by the SIM 'XX': (other value than '00'): No main menu (SETUP MENU) is generated by the SIM. According to [11.14] According to [11.14] According to [11.14]

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Icon identifier for the main menu text Icon qualifier for the main menu text Icon list qualifier for the item list

EFIMG record number

Coding of the remaining records:

68

Field Item status Item identifier

Menu ordinal

Icon identifier Menu text length Menu text

Contents Indicator of whether the entry shall be included in the menu The item identifier to be associated with this menu entry. The interpretation is defined by the addressing mode as specified in section 7.3.2. Indicates the order of the menu items by ascending order of the menu ordinals. If two items have the same menu ordinal, their relative position is defined by the record number. EFIMG record number according to [11.14] The number of bytes in the menu text.

Coding 00h, do not include in menu 02h, included in menu One byte

According to EFADN in [11.11].

The number of entries, in the file, with item status '02'h, shall not exceed 25. Note: The number of records in this file will limit the maximum number of applications in EFBytecode. Further, the total length of data in SET UP MENU proactive SIM command is limited, for example if the average length of the text strings is 10 bytes, the maximum amount of items is 18. Records that are not used shall be at the end of the file and contain "FF" bytes. This means that the first empty record is the end of the menu. 10.12 EFScriptAddress (6F1D) The intention of EFScriptAddress is to provide a uniform way to map integer identifiers with script addresses. Once an address has been mapped to an identifier, this identifier may be used in Execute Local Script WIB command. For the mapping of entries in the EFMenu and EFEventConfig see section 7.3.2.

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

69

Identifier: '6F1D' File size: A*N+2 bytes Access Conditions: READ UPDATE INVALIDATE REHABILITATE Bytes 1 2 3 to 2+A 3+A to 2+2*A : 3+(n-1)*A to 2 +n*A

Structure: transparent Mandatory Update activity: low ADM ADM ADM ADM M/O M M M M : M Length 1 1 A A : A

Description Address mode configuration Length (Y) of Script address Script data #1 Script data #2 : Script data #n

Coding:
Field Address mode configuration Contents Script addressing mode Coding 00h, Relative addressing for menu and events. 01h, Relative addressing for menu. Absolute addressing for events. '02'h Absolute addressing for menu. Relative addressing for events. '03'h Absolute addressing for menu and events. '04'h'FF'h RFU Length 1

Length of Script Address

Number of bytes used in an absolute script address.

Coding of Script data:


Field Script identifier Contents Identifier to be used in Execute Local Script WIB commands Absolute address of the length bytes preceding a script EFBytecode Coding Octet string Length 4

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

Script address

The size of this file will limit the maximum number of accessible scripts in EFBytecode when using absolute addressing mode or Execute Local Script WIB command.

70

10.13 EFMenuTitle (6F1E) This file contains the WIB menu title together with EFMenu to be used by WIB at start-up or when executing the Set Script Trigger Mode WIB command.
Identifier: '6F1E' Record length: Y bytes Access Conditions: READ UPDATE INVALIDATE REHABILITATE Structure: linear fixed Optional Update activity: low ADM ADM ADM ADM Description of the first record Description RFU RFU Menu text length Menu text Padding with 'FFh

Bytes 1 2 3 4 to X+6 x+7 to X+Z+6

M/O M M M M O

Length 1 1 1 X Z

Coding:
Field Menu text length Menu text Contents The number of bytes in the menu text. Coding According to EFADN in [11.11].

10.14 Reserved file identifiers The file identifiers 6F00 to 6F4F are reserved for use in specifications made by SmartTrust.

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

71

Annex A. Conversions between the GSM Default Alphabet and UCS2


This Annex specifies how characters encoded with the GSM Default Alphabet shall be converted to UCS2 and vice versa. The sources for the tables in this Annex are the standards [03.38], [07.05], and The Unicode Standard [UCS30]. If there are discrepancies, the standards take precedence. Conversion from the GSM Default Alphabet to UCS2 shall be made according to Section A1. Conversion from UCS2 to the GSM Default Alphabet shall be made according to Section A.1 and Section A.2. USC2 characters not defined in any of these tables shall be ignored and not be reflected in the output. The table entry (in Section A.1) for character "2xEsc" is not valid when converting to the GSM Default Alphabet.

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

72

A.1 GSM Default Alphabet to/from UCS2


Char GSM Default (Hex) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E UCS2 (Hex) 0040 00A3 0024 00A5 00E8 00E9 00F9 00EC 00F2 00C7 000A 00D8 00F8 000D 00C5 00E5 0394 005F 03A6 0393 039B 03A9 03A0 03A8 03A3 0398 039E 00C6 00E6 00DF 00C9 0020 0021 0022 0023 00A4 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E AB Char GSM Default (Hex) 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C UCS2 (Hex) 002F 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F 00A1 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 00C4 00D6 AB Char GSM Default (Hex) 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F 1B0A 1B14 1B1B 1B28 1B29 1B2F 1B3C 1B3D 1B3E 1B40 1B65 UCS2 (Hex) 00D1 00DC 00A7 00BF 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 00E4 00F6 00F1 00FC 00E0 000C 005E 0020 007B 007D 005C 005B 007E 005D 007C 20AC

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

@ $ "LF" "CR" _ "SP" ! " # % & ' ( ) * + , .

/ 0 1 2 3 4 5 6 7 8 9 : ; < = > ? A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

a b c d e f g h i j k l m n o p q r s t u v w x y z "FF" ^ 2xEsc { } \ [ ~ ] |

73

A.2 UCS2 to GSM Default


UCS2 (Char) WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29 UCS2 (Hex) 00C0 00C1 00C2 00C3 00C8 00CA 00CB 00CC 00CD 00CE 00CF 00D2 00D3 00D4 00D5 00D9 00DA 00DB 00DD 00E1 00E2 00E3 00E7 00EA 00EB 00ED 00EE 00EF 00F3 00F4 00F5 00FA 00FB 00FD 00FF GSM Default (Hex) 41 41 41 41 45 45 45 49 49 49 49 4F 4F 4F 4F 55 55 55 59 61 61 61 09 65 65 69 69 69 6F 6F 6F 75 75 79 79 GSM Default (Char) A A A A E E E I I I I O O O O U U U Y a a a e e i i i o o o u u y y

74

Annex B. Error codes and behaviour versus Terminal response


This Annex specifies error codes and behaviour of WIB in relation to TERMINAL RESPONSE received from the ME. The tables below specify an error code and WIB command tag for each possible combination of TERMINAL RESPONSE and WIB command. If no error code shall be displayed the table specifies the appropriate action that WIB should take. The following actions are defined:
C I T R Ignore the error and continue execution. WIB shall reissue the proactive SIM command that generated this TERMINAL RESPONSE. WIB execution shall terminate. WIB shall restart the current script from the beginning, variables in the range ['E0'h-'FF'h] shall retain their current value and all other variables shall be cleared. If the instruction pointer is already at the beginning of the script, or pointing at the first proactive SIM command in the script that includes user action, the WIB execution shall terminate. If Immediate response data object is added to the command, then WIB shall ignore the error and continue execution. WIB shall silently re-attempt the command twice. If the mobile returns still an error the error text is displayed.

*) **)

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

75

SETUP IDLE MODE TEXT SET UP IDLE MODE TEXT 44 0B

SET UP IDLE MODE TEXT EXTENDED 44 22

TIMER MANAGEMENT PROVIDE LOCAL INFO SET UP MENU SELECT ITEM GET INPUT DISPLAY TEXT DISPLAY CLEAR TEXT AFTER DELAY T T T R T R T DISPLAY TEXT PLAY TONE LAUNCH BROWSER LAUNCH BROWSER EXTENDED LAUNCH BROWSER SEND SMS SEND SM SUBMIT EXTENDED SUBMIT SEND USSD SET UP CALL SEND USSD SET UP CALL EXT. SET UP CALL SETUP EVENT LIST REFRESH SET SCRIPT TRIGGER MODE REFRESH T T T T T SEND SM EXTENDED PLAY TONE DISPLAY TEXT EXTENDED T R T 44 21 44 19 44 02 44 0A GET INPUT T 44 03 R I T SELECT ITEM T 44 04 R I T SET SCRIPT TRIGGER MODE 44 7B PROVIDE LOCAL INFORMATION 44 09

TIMER MANAGEMENT 44 28

44 16 44 23 **) 44 13 **) 44 1B **) 44 01 **) 44 12 44 20 44 0D 44 7B 44 0C

TERMINAL RESPONSE '10' Proactive SIM session terminated by user

Help information required by the user

TOOLKIT COMMAND

WIB COMMAND

'12'

'14'

'11'

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

'20'

'13'

ME currently unable to process command

Backward move in the proactive SIM session requested by the user

No response from user

USSD/SS Transact terminated by user

76

44 1C

SETUP IDLE MODE TEXT SET UP IDLE MODE TEXT

SET UP IDLE MODE TEXT EXTENDED

TIMER MANAGEMENT PROVIDE LOCAL INFO SET UP MENU SELECT ITEM GET INPUT DISPLAY TEXT DISPLAY CLEAR TEXT AFTER DELAY DISPLAY TEXT PLAY TONE LAUNCH BROWSER LAUNCH BROWSER EXTENDED 44 1C 44 16 44 23 **) 44 13 **) 44 1B **) 44 01 **) 44 12 44 20 44 0D T T T T T T LAUNCH BROWSER SEND SMS SEND SM SUBMIT EXTENDED SUBMIT SEND USSD SEND USSD SET UP CALL EXT. SET UP CALL SETUP EVENT LIST REFRESH SET SCRIPT TRIGGER MODE REFRESH SET UP CALL SEND SM EXTENDED PLAY TONE DISPLAY TEXT EXTENDED GET INPUT SELECT ITEM SET SCRIPT TRIGGER MODE PROVIDE LOCAL INFORMATION

TIMER MANAGEMENT

44 16

44 12 44 20 44 0D

Action in contradiction with the current timer state

User did not accept the proactive command

TERMINAL RESPONSE '21' Network currently unable to process command

TOOLKIT COMMAND

WIB COMMAND

'23'

Interaction with call control by SIM, temporary problem

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

'26'

'22'

'24'

'25'

Launch Browser generic error

User cleared down call before connection or network release

77

44 1C

SETUP IDLE MODE TEXT SET UP IDLE MODE TEXT 46 0B 40 0B 40 0B 40 0B

SET UP IDLE MODE TEXT EXTENDED

46 22

40 22

40 22

40 22

TIMER MANAGEMENT PROVIDE LOCAL INFO SET UP MENU SELECT ITEM GET INPUT DISPLAY TEXT DISPLAY CLEAR TEXT AFTER DELAY 46 19 46 02 46 0A 46 1C 46 16 46 23 **) 46 13 **) 46 1B **) 46 01 **) 46 12 46 20 46 0D 46 7B SET SCRIPT TRIGGER MODE REFRESH 46 0C 40 23 **) 40 13 **) 40 1B **) 40 01 **) 40 12 40 20 40 0D 40 7B 40 0C 40 16 40 16 40 23 **) 40 13 **) 40 1B **) 40 01 **) 40 12 40 20 40 0D 40 7B 40 0C 40 1C 40 1C 40 1C 40 16 40 23 **) 40 13 **) 40 1B **) 40 01 **) 40 12 40 20 40 0D 40 7B 40 0C 40 20 40 0D 40 23 **) 40 13 **) 40 1B **) 40 01 **) 40 0A 40 0A 40 0A 40 02 40 02 40 02 40 19 40 19 40 19 DISPLAY TEXT PLAY TONE LAUNCH BROWSER LAUNCH BROWSER EXTENDED LAUNCH BROWSER SEND SMS SEND SM SUBMIT EXTENDED SUBMIT SEND USSD SEND USSD SET UP CALL EXT. SET UP CALL SETUP EVENT LIST REFRESH SET UP CALL SEND SM EXTENDED PLAY TONE DISPLAY TEXT EXTENDED 46 21 40 21 40 21 *) 40 21 GET INPUT 46 03 40 03 40 03 40 03 SELECT ITEM 46 04 40 04 40 04 40 04 SET SCRIPT TRIGGER MODE 46 7B 40 7B 40 7B 40 7B PROVIDE LOCAL INFORMATION C C C C

TIMER MANAGEMENT

46 28

40 28

40 28

40 28

TERMINAL RESPONSE '30' Command beyond MEs capabilities

TOOLKIT COMMAND

Command number not known by ME

Command type not understood by ME

Command data not understood by ME

WIB COMMAND

SS Return Error

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

'35'

'32'

'31'

'33'

'34'

SMS RPERROR

78

SETUP IDLE MODE TEXT SET UP IDLE MODE TEXT 40 0B

SET UP IDLE MODE TEXT EXTENDED 40 22

TIMER MANAGEMENT PROVIDE LOCAL INFO SET UP MENU SELECT ITEM GET INPUT DISPLAY TEXT DISPLAY CLEAR TEXT AFTER DELAY 40 19 40 02 40 0A DISPLAY TEXT PLAY TONE LAUNCH BROWSER LAUNCH BROWSER EXTENDED LAUNCH BROWSER SEND SMS SEND SM SUBMIT EXTENDED SUBMIT SEND USSD SEND USSD SET UP CALL EXT. SET UP CALL SETUP EVENT LIST REFRESH SET SCRIPT TRIGGER MODE REFRESH SET UP CALL 40 13 **) 40 1B **) 40 01 **) 40 12 40 20 40 0D 40 7B 40 0C SEND SM EXTENDED 40 23 **) 40 23 **) 40 13 **) 40 1B **) 40 01 **) 40 12 40 12 40 20 40 0D PLAY TONE DISPLAY TEXT EXTENDED 40 21 GET INPUT 40 03 SELECT ITEM 40 04 SET SCRIPT TRIGGER MODE 40 7B PROVIDE LOCAL INFORMATION C

TIMER MANAGEMENT 40 28

TERMINAL RESPONSE '36' Error, required values are missing

TOOLKIT COMMAND

WIB COMMAND

'37'

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

'39'

Interaction with call control by SIM or MO SM control by SIM, permanent problem

USSD return error

79

Annex C. C-code illustrating CRC32 calculation


The following C-code illustrates the CRC32 calculation.

/* FU NC TIO N : l Gen CR C32 */ / * Pol yn omi al : / * X32 +X 26+ X2 3+X 22 +X1 6+ X12 +X 11+ X1 0+X 8+ X7+ X5 +X4 +X 2+X 1+ X0 /* */ /* PA RA MET ER S I N : */ /* l Ol dCr c : th e c rc 32 va lue w hic h */ /* w as bu il t o ve r p re vio us by te s * / /* B yt eVa l : t he ne w d at a b yt e */ / * --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --* // *-- -- --- -- -- --- -- --- -- --- -- --- -- --- -- --- -- -*/ s ta tic u nsi gn ed lo ng lG enC RC 32( u nsi gn ed lo ng lO ldC RC , u ns ign ed ch ar By te Val ) { un si gne d lon g T ab Val ; in t j; Ta bV al = ((l Ol dCR C) ^ By teV al ) & 0 xff ; fo r (j= 8; j> 0; j- -) { i f (Ta bV al & 1) { T ab Val = (T ab Val > > 1 ) ^ 0 xE DB8 83 20L ; } e lse { T ab Val > >= 1; } } r et urn T abV al ^ (( (lO ld CRC ) >> 8) & 0x 00F FF FFF L) ; } / * Exa mp le of ca lc ula ti on */ m ai n() { u ns ign ed in t i i; u ns ign ed lo ng C rc 32; u ns ign ed ch ar d at a[] = {0 x0 1, 0x 02, 0 x03 , 0x0 4, 0 x0 5}; C rc 32 = 0xF FF FFF FF ; / * pre co ndi ti oni ng */ for (i i=0 ; ii< si zeo f( dat a) ; i i+ +) Crc 32 = lG enC RC 32( Cr c32 , dat a[ ii] ); C rc 32 = ~Cr c3 2; / * pos tc ond it ion in g * /

WIB 1.3 - Implementation Specification Document number: MPM02:0111 Revision:PA29

80