• No results found

Wib1.3_ImplementationSpecification PA29

N/A
N/A
Protected

Academic year: 2021

Share "Wib1.3_ImplementationSpecification PA29"

Copied!
81
0
0

Loading.... (view fulltext now)

Full text

(1)

mb er : M P M0 2: 0 11 1 A 29

Implementation Specification

SmartTrust WIB™, version 1.3

© 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.

SmartTrust is a trademark of SmartTrust AB.

Document number: MPM02:0111 Revision:PA29

(2)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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

(3)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29 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

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

(4)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29 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

(5)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29 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

(6)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

1 References

Ref. Title

[CSP] Client-Server Protocol Specification, WIB 1.3

[03.48] “3GPP TS 03.48, SIM Toolkit Secure Messaging”, version 8.8.0, Release 1999 [11.14] “3GPP TS 11.14, SIM Application Toolkit Interface”, version 8.10.0, Release 1999 [03.38] “GSM 03.38, Alphabet and language-specific information”, version 7.2.0, Release 1998 [03.40] "GSM 03.40, Technical Realization of the SMS-PP", version 7.4.0, Release 1998 [04.11] “GSM 04.11, Point-to-Point short message support on mobile radio interface", version 7.0.0, Release 1998

[9797] International Standard ISO/IEC 9797-1, Information technology – Security techniques – Message Authentication Codes (MACs) [07.05] “GSM 07.05", version 7.0.1, Release 1998

[10646] ISO/IEC10646: "Universal Multiple-Octet Coded Character Set (UCS)”; UCS2, 16 bit coding. [UCS30] The Unicode Standard, Version 3.0. http://www.unicode.org/

[11.11] "3GPP TS 11.11, Subscriber Identity Module – Mobile Equipment (SIM-ME) Interface", version 8.8.0 Release 99 [DEA] ANSI X3.92: 1981, Data Encryption Algorithm (DEA)

(7)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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.

(8)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

3 Terminology and Abbreviations

3.1 Abbreviations

BER Basic Encoding Rules

CRC Cyclic Redundancy Check CBC Cipher Block Chaining

DED Decrypt-Encrypt-Decrypt DES Data Encryption Standard

EDE Encrypt-Decrypt-Encrypt

IV Initialisation Vector

MAC Message Authentication Code

SAT SIM Application Toolkit

SC Security Configuration

SPI Security Parameter Indicator. See [03.48] for details. TAR Toolkit Application Reference. See [03.48] for details.

WIB SmartTrust WIB™ implemented in accordance with the current specification and [CSP]

3.2 Terminology

03.48 message Shorthand notation for a Secured Command Packet as defined in [03.48]. X || Y Concatenation of bit-strings X and Y (in that order).

CRC32 CRC32 cyclic redundancy check algorithm. See Annex C for details. Client bound Message A message as defined in [CSP] from the server component to the WIB DES_ENCR(K,P) DES encryption. K is the key and P the data to be encrypted. See [DEA] for details. GSM 7 bit default alphabet As defined in [03.38]

(9)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

ISO_9797_PAD3(D) ISO/IEC 9797 padding method 3. D is the data to be padded. See [9797] for details. ISO_9797_ALG4(K,K',K'',

D)

ISO/IEC 9797 MAC algorithm 4. D is data to be MACed. See [9797] for details.

Locally Stored WIB Script A WIB script that resides in EFBytecode

Proactive SIM Command A command as defined in [11.14] Script Synonym to WIB script

Script Identifier A globally unique identifier of a WIB script TDES_DECR(K1,K2,K3,C)

Triple DES decryption in outer CBC mode using three keys in DED operation. C is the data to be decrypted. See [TDEA] for details.

TDES_ENCR(K1,K2,K3,P)

Triple DES encryption in outer CBC mode using three keys in EDE operation. P is the data to be encrypted. See [TDEA] for details.

WIB Command A command as defined in [CSP]

WIB Command Sequence Several WIB commands that logically belong together and occur one after the other. WIB Script A WIB command sequence

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.

(10)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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.

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

(11)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29 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.

(12)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29 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

(13)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

• 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 SPI KIc KID Description

L0 00 00 00 00 Replay protection: None Authentication: None Ciphering: None

This security level should be used for testing only, since it provides no protection whatsoever.

L1 12 00 x7 y3 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.

L2 15 00 x5 00 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. L3 16 00 x5 y0 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.

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

(14)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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.

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.

(15)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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:

• 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

(16)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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'.

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,

(17)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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

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 )

(18)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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-decrypt-encrypt) 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.

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.

(19)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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.

(20)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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.

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.

(21)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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

(22)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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.

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

(23)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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

(24)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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

(25)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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 pull TAR push/admin TAR

b5b4 = x0 WFRS on WFRS off

b5b4 = 01 WFRS on WFRS on

b5b4 = 11 WFRS off 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.

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 sending-info is not present, WIB shall not provide an alpha-identifier in the proactive command.

(26)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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.

default text/icon exist default text/icon do not exist

text/icon provided in command b1/b2/b3 = x: use provided b1/b2/b3 = x: use provided text/icon not provided in

command

b1/b2/b3 = 0: use no information b1/b2/b3 = 1: use default

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

No DT, No DI DT only Both DT and DI

0, No CT, No CI - - -

0, CT present, No CI CT CT CT

0, No CT, CI present X X X

0, Both CT and CI present CT+CI CT+CI CT+CI

1, No CT, No CI - DT DT+DI

1, CT present, No CI CT CT CT + DI

1, No CT, CI present X DT+CI DT+CI

1, Both CT and CI present CT+CI CT+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.

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.

(27)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29 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 Value pairs where each Value pair reflects the content of a variable from the list. The order of the Length-Value 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 Length-Value 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 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.

(28)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

'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 BCD "0"-"9" '0' – '9' "*" 'A' "#" 'B' "a" 'C' "b" 'D' "c" '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".

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.

(29)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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.

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.

(30)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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. 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

(31)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 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 plug-in name does not exist and '03'h if the Manufacturer Specific Plug-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.

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.

(32)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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.

(33)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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

(34)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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 Comment Value

Command Details High Priority. Wait for user to clear message. '8103012181'h

6.2 Display text following Display Text Clear after Delay WIB command

Field Comment Value

Command Details High Priority. Clear after delay. '8103012101'h

6.3 Display text following Display Text Extended WIB command

Field Comment Value

Command Details Command qualifier, xx, is set according to the WIB command

'81030121xx'h Immediate Response Immediate Response is included when

required by the WIB command.

'AB00'h

6.4 Get Input

Field Comment Value

(35)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

See 5.1.2 echo the input. Input in unpacked format. No help information.

Text string This is the 'Text to Display'-value from the WIB command

Response length

See 5.1.2. No minimum length. No maximum length. '910200FF'h Default Text This is the 'Default Text' from the WIB

command

6.5 Select Item

Field Comment Value

Command Details. No help information. '8103012400'h

6.6 Send Short Message following Submit and Submit Extended WIB commands

Field Comment Value

Command Details.

Note 1. Packing not required. '8103011300'h Alpha identifier

and/or Icon Identifier

If it exists, use alpha identifier and/or icon given in EF Text.

For SUBMIT EXTENDED: see section 5.1.11

-

Address Shall be taken from record no 1 in EFSMSHeader.

- SMS TPDU Shall be taken from record no 1 in

EFSMSHeader.

- 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

(36)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

Command Details. Packing not required. '8103011300'h Address Taken from the Service Center Address field

in the WIB command. SMS TPDU : PID,

DCS, Destination Address, User Data Header, User Data

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.

6.8 Provide Local Information

Field Comment Value

Command Details. Command qualifier, xx, is set according to the

WIB command. '81030126xx'h

6.9 Play Tone

Field Comment Value

Command Details '8103012000'h

Alpha identifier Included if Text to Display is supplied (length not zero) in the WIB command

Tone Fetched from the WIB command Duration Fetched from the WIB command

(37)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

6.10 Set Up Idle Mode Text

Field Comment Value

Command Details '8103012800'h

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

6.11 Refresh

Field Comment Value

Command Details. Command qualifier, xx, is set according to the WIB command

'81030101xx'h. File list According to the WIB command.

6.12 Set Up Call

Field Comment Value

Command Details. Command qualifier, xx, is set according to the

WIB command '81030110xx'h. Alpha identifier for

User Confirmation Phase.

Included if defined in the WIB command

Icon identifier for User Confirmation Phase.

Included if defined in the WIB command

Alpha identifier for

Call Set Up Phase. Included if defined in the WIB command Icon identifier for

Call Set Up Phase.

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

(38)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29 6.13 Send USSD

Field Comment Value

Command Details. '8103011200'h

Alpha identifier. Included if defined in the WIB command USSD string Taken from the WIB command.

6.14 Timer Management

Field Comment Value

Command Details Command qualifier, xx, is set according to the

WIB command '81030127xx'h.

6.15 Launch Browser

This proactive SIM command occurs as a result of Launch Browser and Launch Browser Extended WIB commands.

Field Comment Value

Command Details Command qualifier, xx according to the command qualifier in the WIB command

(39)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision: P A 2 9

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

(40)

1.3 - Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

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:

(41)

- Im ple m en tation Sp ecification e nt nu mber: M P M0 2:0 111 R e vision :P A 29

- 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.

Script Free space Length bytes EFBytecode ’0000’ ’00C5’ ’01A5’ 'XX02' ’0000061C0000’ EFScriptAddress ’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.

References

Related documents