hash
stringlengths
32
32
doc_id
stringlengths
7
13
section
stringlengths
3
121
content
stringlengths
0
3.82M
1c4b4f087015eb6e69461ecdbc9d8f65
101 109
6.1 Point
The co-ordinates of an ellipsoid point are coded with an uncertainty of less than 3 metres The latitude is coded with 24 bits: 1 bit of sign and a number between 0 and 223-1 coded in binary on 23 bits. The relation between the coded number N and the range of (absolute) latitudes X it encodes is the following (X in degrees): N X N ≤ < + 2 90 1 23 except for N=223-1, for which the range is extended to include N+1. ETSI TS 101 109 V6.0.0 (1999-04) 9 (GSM 03.32 version 6.0.0 Release 1997) The longitude, expressed in the range -180°, +180°, is coded as a number between -223 and 223-1, coded in 2’s complement binary on 24 bits. The relation between the coded number N and the range of longitude X it encodes is the following (X in degrees): N X N ≤ < + 2 360 1 24
1c4b4f087015eb6e69461ecdbc9d8f65
101 109
6.2 Uncertainty
A method of describing the uncertainty has been sought which is both flexible (can cover wide differences in range) and efficient. The proposed solution makes use of a variation on the Binomial expansion. The uncertainty r, expressed in metres, is mapped to a number K, with the following formula: ( ) ( ) r C x K = + − 1 1 with C = 10 and x = 0,1. With 0 ≤ K ≤ 127, a suitably useful range between 0 and 1800 kilometres is achieved for the uncertainty, while still being able to code down to values as small as 1 metre. The uncertainty can then be coded on 7 bits, as the binary encoding of K. Table 1: Example values for the uncertainty Function Value of K Value of uncertainty 0 0 m 1 1 m 2 2.1 m - - 20 57.3 m - - 40 443 m - - 60 3 km - - 80 20 km - - 100 138 km - - 120 927 km - - 127 1800 km 7 General message format and information elements coding This clause describes a coding method for geographical area descriptions. A geographical area description is coded as a finite bit string. In the figures, the bit string is described by octets from top downward, and in the octet from left to right. Number encoding strings start with the most significant bit.
1c4b4f087015eb6e69461ecdbc9d8f65
101 109
7.1 Overview
A bit string encoding a geographical description shall consist of the following parts: - Type of Shape; - Shape Description. Such a bit string is usually part of an information element. The structure of the information element (e.g., element identifier, length) depends on the protocol in which the message containing the description is defined, and is specified in the protocol specification. ETSI TS 101 109 V6.0.0 (1999-04) 10 (GSM 03.32 version 6.0.0 Release 1997) This organisation is illustrated in the example shown in figure 4. 8 7 6 5 4 3 2 1 Type of shape Shape description Octet 2 Etc... Octet 1 Figure 4: Example
1c4b4f087015eb6e69461ecdbc9d8f65
101 109
7.2 Type of Shape
The Type of Shape information field identifies the type which is being coded in the Shape Description. The Type of Shape is coded as shown in table 2. Table 2: Coding of Type of Shape Bits 4 3 2 1 0 0 0 0 Ellipsoid Point 0 0 0 1 Ellipsoid point with uncertainty Circle 0 1 0 1 Polygon other values reserved for future use
1c4b4f087015eb6e69461ecdbc9d8f65
101 109
7.3 Shape description
The shape description consist of different elements. ETSI TS 101 109 V6.0.0 (1999-04) 11 (GSM 03.32 version 6.0.0 Release 1997)
1c4b4f087015eb6e69461ecdbc9d8f65
101 109
7.3.1 Ellipsoid Point
The coding of a point is described in figure 5. 8 7 6 5 4 3 2 1 spare 0 0 0 0 S Degrees of latitude Degrees of longitude Octet 7 Octet 6 Octet 5 Octet 3 Octet 4 Octet 2 Octet 1 Figure 5: Shape description of a point S: Sign of latitude Bit value 0 North Bit value 1 South Degrees of latitude Bit 1 of octet 4 is the low order bit Degrees of longitude Bit 1 of octet 7 is the low order bit ETSI TS 101 109 V6.0.0 (1999-04) 12 (GSM 03.32 version 6.0.0 Release 1997)
1c4b4f087015eb6e69461ecdbc9d8f65
101 109
7.3.2 Ellipsoid Point with uncertainty Circle
8 7 6 5 4 3 2 1 spare 0 0 0 1 Uncertainty code S Degrees of latitude Degrees of longitude Octet 8 Octet 7 Octet 6 Octet 5 Octet 3 Octet 4 Octet 2 Octet 1 0 spare Figure 6: Shape description of an ellipsoid point with uncertainty circle ETSI TS 101 109 V6.0.0 (1999-04) 13 (GSM 03.32 version 6.0.0 Release 1997)
1c4b4f087015eb6e69461ecdbc9d8f65
101 109
7.3.3 Polygon
8 7 6 5 4 3 2 1 Number of points 0 1 0 1 S1 Degrees of latitude of point 1 Degrees of longitude of point 1 Octet 7 Octet 6 Octet 5 Octet 3 Octet 4 Octet 2 Octet 1 Sn Degrees of latitude of point n Degrees of longitude of point n Octet 6n+1 Octet 6n Octet 6n-1 Octet 6n-3 Octet 6n-2 Octet 6n-4 Figure 7: Shape description of a polygon The number of points field encodes in binary on 4 bits the number n of points in the description, and ranges from 3 to 15. ETSI TS 101 109 V6.0.0 (1999-04) 14 (GSM 03.32 version 6.0.0 Release 1997) Annex A (informative): Element description in compact notation The notation is the one described in GSM 04.07. <Geographical Area Description> ::= <Point> | <Point with uncertainty> | <Polygon> ; <Point> : := 0000 <spare>(4) <Point co-ordinates> ; <point co-ordinates> ::= <Latitude sign : bit> <Unsigned latitude : bit string(23)> <Longitude : bit string(24)> ; <Point with uncertainty> ::= 0001 <spare>(4) <Point co-ordinates> <spare bit> <Uncertainty: bit string(7)> ; <Polygon> ::= 0101 <Number of points> <Point co-ordinates>(val(Number of points)) ; <Number of points> ::= 0011 | 0100 | 0101 | 0110 | 0111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 ; ETSI TS 101 109 V6.0.0 (1999-04) 15 (GSM 03.32 version 6.0.0 Release 1997) Annex B (informative): Change Request History Status of Technical Specification GSM 03.32 Date Version Remarks No Phase 1 version October 1997 5.0.0 Specification approved by SMG#23 June 1998 5.1.0 CR 03.32-A001r1 (R96-F) on Clarification in section 7.3.1 (WI: CAMEL Phase 1) approved by SMG#26 October 1998 5.2.0 CR 03.32-A002r1 (R96-F) on Error correction in GSM 03.32 for value of uncertainty (WI: CAMEL Phase 1) approved by SMG#27 January 1999 6.0.0 Release 1997 version Text and figures: WinWord 6.0 Stylesheet: etsiw_70.dot Rapporteur: ETSI TS 101 109 V6.0.0 (1999-04) 16 (GSM 03.32 version 6.0.0 Release 1997) History Document history V6.0.0 April 1999 Publication ISBN 2-7437-3009-9 Dépôt légal : Avril 1999
07cacd4869c6b37fc59006cce6a9de60
101 181
1 Scope
The present document specifies the structure of the Secured Packets in a general format and in an implementation using the Short Message Service (SMS). Furthermore, the coding is specified for a set of common application commands within the secured packets. This set is a subset of commands specified in GSM 11.11 [5] and allows remote management of files on the Subscriber Identity Module (SIM) in conjunction with SMS and the SIM Data Download feature of GSM 11.14 [6]. The present document is applicable to the exchange of secured packets between an entity in a GSM PLMN and an entity in the SIM. Secured Packets contain application messages to which certain mechanisms according to GSM 02.48 [2] have been applied. Application messages are commands or data exchanged between an application resident in or behind the GSM PLMN and on the SIM. The Sending/Receiving Entity in the GSM PLMN and the SIM are responsible for applying the security mechanisms to the application messages and thus turning them into Secured Packets.
07cacd4869c6b37fc59006cce6a9de60
101 181
2 References
The following documents contain provisions which, through reference in this text, constitute provisions of the present document. • References are either specific (identified by date of publication, edition number, version number, etc.) or non-specific. • For a specific reference, subsequent revisions do not apply. • For a non-specific reference, the latest version applies. • A non-specific reference to an ETS shall also be taken to refer to later versions published as an EN with the same number. • For this Release 1998 document, references to GSM documents are for Release 1998 versions (version 7.x.y).
07cacd4869c6b37fc59006cce6a9de60
101 181
2.1 Normative references
[1] GSM 01.04: "Digital cellular telecommunications system (Phase 2+); Abbreviations and acronyms". [2] GSM 02.48: "Digital cellular telecommunications system (Phase 2+); Security Mechanisms for the SIM Application Toolkit - Stage 1". [3] GSM 03.40: "Digital cellular telecommunications system (Phase 2+); Technical realization of the Short Message Service (SMS) Point-to-Point (PP)". [4] GSM 04.11: "Digital cellular telecommunications system (Phase 2+); Point-to-Point (PP) Short Message Service (SMS) support on mobile radio interface". [5] GSM 11.11: "Digital cellular telecommunications system (Phase 2+); Specification of the Subscriber Identity Module - Mobile Equipment (SIM - ME) interface". [6] GSM 11.14: "Digital cellular telecommunications system (Phase 2+); Specification of the SIM Application Toolkit for the Subscriber Identity Module - Mobile Equipment (SIM - ME) interface". [7] ISO/IEC 7816-4: "1995 Information technology -- Identification cards -- Integrated circuit(s) cards with contacts -- Part 4: Interindustry commands for interchange". [8] ISO/IEC 7816-6:1996 "Identification cards -- Integrated circuit(s) cards with contacts -- Part 6: Interindustry data elements". ETSI ETSI TS 101 181 V7.0.1 (1999-07) 6 (GSM 03.48 version 7.0.1 Release 1998) [9] ISO 8731-1:1987 "Banking -- Approved algorithms for message authentication -- Part 1: DEA". [10] ISO/IEC 10116:1997 "Information technology -- Security techniques -- Modes of operation for an n-bit block cipher".
07cacd4869c6b37fc59006cce6a9de60
101 181
2.2 Informative references
[20] Schneier, Bruce: "Applied Cryptography Second Edition: Protocols, Algorithms and Source code in C", John Wiley & Sons, 1996, ISBN 0-471-12845-7.
07cacd4869c6b37fc59006cce6a9de60
101 181
3 Definitions and abbreviations
For the purposes of the present document, the following definitions and abbreviations apply.
07cacd4869c6b37fc59006cce6a9de60
101 181
3.1 Definitions
For the purposes of the present document, the following definitions apply: Application Layer: The layer above the Transport Layer on which the Application Messages are exchanged between the Sending and Receiving Applications. Application Message: The package of commands or data sent from the Sending Application to the Receiving Application, or vice versa, independently of the transport mechanism. An Application Message is transformed with respect to a chosen Transport Layer and chosen level of security into one or more secured packets. Command Header: The Security Header of a Command Packet. Command Packet: A Secured Packet transmitted by the Sending Entity to the Receiving Entity, containing a secured Application Message. Counter: A mechanism or data field used for keeping track of a message sequence. This could be realised as a sequence oriented or time stamp derived value, maintaining a level of synchronisation between the Sending Entity and the Receiving Entity. Cryptographic Checksum: A string of bits derived from some secret information, (e.g. a secret key), part or all of the Application Message, and possible further information (e.g. part of the Security Header). The secret key is known to the Sending Entity and to the Receiving Entity. The Cryptographic Checksum is often referred to as Message Authentication Code. DES: a standard cryptographic algorithm specified as DEA in ISO 8731-1 [9]. Digital Signature: A string of bits derived from some secret information, (e.g. a secret key), the complete Application Message, and possible further information (e.g. part of the Security Header). The secret information is known only to the Sending Entity. Although the authenticity of the Digital Signature can be proved by the Receiving Entity, the Receiving Entity is not able to reproduce the Digital Signature without knowledge of the secret information owned by the Sending Entity. Receiving Application: This is the entity to which the Application Message is destined. Receiving Entity: This is the entity where the Secured Packet is received (e.g. SMS-SC, SIM, USSD entry point, or dedicated SIM Toolkit Server) and where the security mechanisms are utilised. The Receiving Entity processes the Secured Packets. Redundancy Check: A string of bits derived from the Application Message and possible further information for the purpose of detecting accidental changes to the message, without the use of any secret information. Response Header: The Security Header of a Response Packet. Response Packet: A Secured Packet transmitted by the Receiving Entity to the Sending Entity, containing a secured response and possibly application data. ETSI ETSI TS 101 181 V7.0.1 (1999-07) 7 (GSM 03.48 version 7.0.1 Release 1998) Secured Packet: The information flow on top of which the level of required security has been applied. An Application Message is transformed with respect to a chosen Transport Layer and chosen level of security into one or more Secured Packets. Security Header: That part of the Secured Packet which consists of all security information (e.g. counter, key identification, indication of security level, checksum or Digital Signature). Sender Identification: This is the simple verification of the identity of the Sending Entity by the Receiving Entity comparing the sender identity with an apriori stored identity of the sender at the Receiving Entity. Sending Application: The entity generating an Application Message to be sent. Sending Entity: This is the entity from which the Secured Packet originates (e.g. SMS-SC, SIM, USSD entry point, or dedicated SIM Toolkit Server) and where the security mechanisms are invoked. The Sending Entity generates the Secured Packets to be sent. Short Message: Information that may be conveyed by means of the SMS Service as defined in GSM 03.40 [3]. Status Code: This is an indication that a message has been received (correctly or incorrectly, indicating reason for failure). Transport Layer: This is the layer responsible for transporting Secured Packets through the GSM network. The transport layer implements one or more transport mechanisms, (e.g. SMS or USSD). Unsecured Acknowledgement: This is a Status Code included in a response message.
07cacd4869c6b37fc59006cce6a9de60
101 181
3.2 Abbreviations
In addition to those below, abbreviations used in the present document are listed in GSM 01.04. CBC Cipher Block Chaining CC Cryptographic Checksum CNTR Counter CHI Command Header Identifier CHL Command Header Length CPI Command Packet Identifier CPL Command Packet Length DES Data Encryption Standard DS Digital Signature ECB Electronic codebook IEI Information Element Identifier IEIDL Information Element Identifier Data Length IED Information Element Data KIc Key and algorithm Identifier for ciphering KID Key and algorithm Identifier for RC/CC/DS MO-SMS Mobile Originated Short Message MT-SMS Mobile Terminated Short Message PCNTR Padding Counter PLMN Public Land Mobile Network PoR Proof of Receipt RA Receiving Application RC Redundancy Check RE Receiving Entity RHI Response Header Identifier RHL Response Header Length RPI Response Packet Identifier RPL Response Packet Length SA Sending Application SE Sending Entity SIM Subscribers Identity Module SM Short Message ETSI ETSI TS 101 181 V7.0.1 (1999-07) 8 (GSM 03.48 version 7.0.1 Release 1998) SMS Short Message Service SMS-SC Short Message Service - Service Centre SPI Security Parameters Indication TAR Toolkit Application Reference TLV Tag – Length – Value (data structure) UDH User Data Header UDHI User Data Header Indicator UDHL User Data Header Length UDL User Data Length USSD Unstructured Supplementary Services Data
07cacd4869c6b37fc59006cce6a9de60
101 181
4 Overview of Security System
An overview of the secure communication related to the SIM Application Toolkit together with the required security mechanisms is given in GSM 02.48 [2], (see figure 1). Sending Application Sending Entity Transport Mech. Receiving Entity Receiving Application Security Security Information flow (e.g. a bank) (e.g. SMS -SC) (e.g. USSD, SMS) (e.g. SIM) (e.g. SIM resident application) (e.g. SIM resident application) (e.g. SIM) (e.g. SMS -SC) (e.g. a bank resident application) Figure 1: System Overview The Sending Application prepares an Application Message and forwards it to the Sending Entity, with an indication of the security to be applied to the message. The Sending Entity prepends a Security Header (the Command Header) to the Application Message. It then applies the requested security to part of the Command Header and all of the Application Message, including any padding octets. The resulting structure is here referred to as the (Secured) Command Packet. Under normal circumstances the Receiving Entity receives the Command Packet and unpacks it according to the security parameters indicated in the Command Header. The Receiving Entity subsequently forwards the Application Message to the Receiving Application indicating to the Receiving Application the security that was applied. The interface between the Sending Application and Sending Entity and the interface between the Receiving Entity and Receiving Application are proprietary and therefore outside the scope of the present document. If so indicated in the Command Header, the Receiving Entity shall create a (Secured) Response Packet. The Response Packet consists of a Security Header (the Response Header) and optionally, application specific data supplied by the ETSI ETSI TS 101 181 V7.0.1 (1999-07) 9 (GSM 03.48 version 7.0.1 Release 1998) Receiving Application. Both the Response Header and the application specific data are secured using the security mechanisms indicated in the received Command Packet. The Response Packet will be returned to the Sending Entity, subject to constraints in the transport layer, (e.g. timing). In some circumstances a security related error may be detected at the Receiving Entity. In such circumstances the Receiving Entity shall react according to the following rules; 1) nothing shall be forwarded to the Receiving Application. i.e. no part of the Application Message, and no indication of the error. 2) if the Sending Entity does not request a response (in the Command Header) the Receiving Entity discards the Command Packet and no further action is taken 3) if the Sending Entity does request a response and the Receiving Entity can unambiguously determine what has caused the error, the Receiving Entity shall create a Response Packet indicating the error cause. This Response Packet shall be secured according to the security indicated in the received Command Packet. 4) if the Sending Entity does request a response and the Receiving Entity cannot determine what has caused the error, the Receiving Entity shall send a Response Packet indicating that an unidentified error has been detected. This Response Packet is sent without any security being applied. 5) If the Receiving Entity receives an unrecognisable Command Header (e.g. an inconsistency in the Command Header), the Command Packet shall be discarded and no further action taken.
07cacd4869c6b37fc59006cce6a9de60
101 181
5 Generalised Secured Packet structure
Command and Response Packets have the same overall structure consisting of a variable length security header within a variable length shell. To model this, use is made of a double TLV -tag, length, value- structure.
07cacd4869c6b37fc59006cce6a9de60
101 181
5.1 Command Packet structure
The Command Header precedes the Secured Data in the Command Packet, and is of variable length. The Command Packet shall be structured according to table 1. Table 1: Structure of the Command Packet Element Length Comment Command Packet Identifier (CPI) 1 octet Identifies that this data block is the secured Command Packet. Command Packet Length (CPL) variable This shall indicate the number of octets from and including the Command Header Identifier to the end of the Secured Data, including any padding octets. Command Header Identifier (CHI) 1 octet Identifies the Command Header. Command Header Length (CHL) variable This shall indicate the number of octets from and including the SPI to the end of the RC/CC/DS. Security Parameter Indicator (SPI) 2 octets see detailed coding in section 5.1.1. Ciphering Key Identifier (KIc) 1 octet Key and algorithm Identifier for ciphering. Key Identifier (KID) 1 octet Key and algorithm Identifier for RC/CC/DS. Toolkit Application Reference (TAR) 3 octets Coding is application dependent. Counter (CNTR) 5 octets Replay detection and Sequence Integrity counter. Padding counter (PCNTR) 1 octet This indicates the number of padding octets at the end of the secured data. Redundancy Check (RC), Cryptographic Checksum (CC) or Digital Signature (DS) variable Length depends on the algorithm. A typical value is 8 octets if used, and for a DS could be 48 or more octets; the minimum should be 4 octets. Secured Data variable Contains the Secured Application Message and possibly padding octets. Unless indicated otherwise, the CPL and the CHL shall be coded according to ISO/IEC 7816-6 [8]. ETSI ETSI TS 101 181 V7.0.1 (1999-07) 10 (GSM 03.48 version 7.0.1 Release 1998) Table 2: Linear Representation of Command Packet CPI CPL CHI CHL SPI KIc KID TAR CNTR PCNTR RC/CC/DS Secured Data with Padding Note 1 Note 1 Note 1 Note 1 Note 3 Note 3 Note 2 Note 2 Note 2 Note 2 Note 2 Note 2 Note 2 NOTE 1: These fields are included in the data to be ciphered if ciphering is indicated in the Security Header. NOTE 2: These fields are included in the calculation of the RC/CC/DS. NOTE 3: Part or all of these fields may also be included in the calculation of the RC/CC/DS, depending on implementation (e.g. SMS). If ciphering is indicated, first the RC/CC/DS shall be calculated as indicated in Note 2, and then ciphering shall be applied, as indicated in Note 1. If the SPI indicates that a specific field is unused, the Sending Entity shall set the contents of this field to zero, and the Receiving Entity shall ignore the contents. If the SPI indicates that no RC, CC or DS is present in the Command Header, the RC/CC/DS field shall be of zero length. If the Padding Counter content is zero, this shall indicate no padding octets, or no padding is necessary. 5.1.1 Coding of the SPI The SPI is coded as below. First Octet: b8 b7 b6 b5 b4 b3 b2 b1 00: No RC, CC or DS 01: Redundancy Check 10: Cryptographic Checksum 11: Digital Signature 0 : No Ciphering 1 : Ciphering 00: No counter available 01: Counter available; no replay or sequence checking (note 1) 10: Process if and only if counter value is higher than the value in the RE (note 2) 11: Process if and only if counter value is one higher than the value in the RE (note 3) Reserved (set to zero and ignored by RE) NOTE 1: In this case the counter value is used for information purposes only, (e.g. date or time stamp). If the Command Packet was successfully unpacked, the counter value can be forwarded from the Receiving Entity to the Receiving Application. This depends on proprietary implementations and happens in a application dependent way. NOTE 2: The counter value is compared with the counter value of the last received Command Packet. This is tolerant to failures on the transport level (i.e. losses of Command Packets). A possible scenario is a global update. NOTE 3: This provides strict control in addition to security indicated in Note 2. ETSI ETSI TS 101 181 V7.0.1 (1999-07) 11 (GSM 03.48 version 7.0.1 Release 1998) Second Octet: b8 b7 b6 b5 b4 b3 b2 b1 00: No PoR reply to the Sending Entity (SE) 01: PoR required to be sent to the SE 10: PoR required only when an error has occured 11: Reserved 00: No security applied to PoR response to SE 01: PoR response with simple RC applied to it 10: PoR response with CC applied to it 11: PoR response with DS applied to it 0 : PoR response shall not be ciphered 1 : PoR response shall be ciphered For SMS only 0 : PoR response shall be sent using SMS-DELIVER-REPORT 1 : PoR response shall be sent using SMS-SUBMIT Reserved (set to zero and ignored by RE) 5.1.2 Coding of the KIc The KIc is coded as below. b8 b7 b6 b5 b4 b3 b2 b1 00: Algorithm known implicitly by both entities 01: DES 10: Reserved 11: proprietary Implementations 00: DES in CBC mode 01: Triple DES in outer-CBC mode using two different keys 10: Triple DES in outer-CBC mode using three different keys 11: DES in ECB mode indication of Keys to be used (keys implicitly agreed between both entities) DES is the algorithm specified as DEA in ISO 8731-1 [9]. DES in CBC mode is described in ISO/IEC 10116 [10]. Triple DES in outer-CBC mode is described in section 15.2 of [20]. DES in ECB mode is described in ISO/IEC 10116 [10]. The initial chaining value for CBC modes shall be zero. For the CBC modes the counter (CNTR) shall be used. 5.1.3 Coding of the KID The KID is coded as below. b8 b7 b6 b5 b4 b3 b2 b1 00: Algorithm known implicitly by both entities 01: DES 10: Reserved 11: proprietary Implementations 00: DES in CBC mode 01: Triple DES in outer-CBC mode using two different keys 10: Triple DES in outer-CBC mode using three different keys 11: Reserved indication of Keys to be used (keys implicitly agreed between both entities) DES is the algorithm specified as DEA in ISO 8731-1 [9]. DES in CBC mode is described in ISO/IEC 10116 [10]. Triple DES in outer-CBC mode is described in section 15.2 of [20]. ETSI ETSI TS 101 181 V7.0.1 (1999-07) 12 (GSM 03.48 version 7.0.1 Release 1998) The initial chaining value for CBC modes shall be zero. For the CBC modes the counter (CNTR) shall be used. If padding is required, the padding octets shall be coded hexadecimal '00'.
07cacd4869c6b37fc59006cce6a9de60
101 181
5.1.4 Counter Management
The following rules shall apply to counter management: - The SE sets the counter value. It shall only be incremented. - When the counter value reaches its maximum value the counter is blocked . - In order to prevent replay attacks the RE shall increment the counter to its next value upon receipt of a Command Packet irrespective of whether or not the Command Packet could be successfully unpacked. If there is more than one SE, care has to be taken to ensure that the counter values remain synchronised between the SE’s to what the RE is expecting, irrespective of the transport mechanism employed. The level of security is indicated via the proprietary interface between the Sending/Receiving Application and Sending/Receiving Entity. Application designers should be aware that if the Sending Application requests “No RC/CC/DS” or “Redundancy Check” and “No Counter Available” from the SE, no security is applied to the Application Message and therefore there is an increased threat of malicious attack.
07cacd4869c6b37fc59006cce6a9de60
101 181
5.2 Response Packet structure
Table 3: Structure of the Response Packet Element Length Comment Response Packet Identifier (RPI) 1 octet Identifies a Response Packet. Response Packet Length (RPL) variable Indicates the number of octets from and including RHI to the end of Additional Response data, including any padding octets. Response Header Identifier (RHI) 1 octet Identifies the Response Header. Response Header Length (RHL) variable Indicates the number of octets from and including RC/CC/DSto the end of the Response Status Code octet. Toolkit Application Reference (TAR) 3 octets This shall be a copy of the contents of the TAR in the Command Packet. Counter (CNTR) 5 octets This shall be a copy of the contents of the CNTR in the Command Packet. Padding counter (PCNTR) 1 octet This indicates the number of padding octets at the end of the Additional Response Data. Response Status Code Octet 1 octet Codings defined in Table 5. Redundancy Check (RC), Cryptographic Checksum (CC) or Digital Signature (DS) variable Length depending on the algorithm indicated in the Command Header in the incoming message. A typical value is 4 to 8 octets, or zero if no RC/CC/DS is requested. Additional Response Data variable Optional Application Specific Response Data, including possible padding octets. Unless indicated otherwise, the RPL and RHL shall be coded according to ISO/IEC 7816-6 [8]. Table 4: Linear Representation of Response Packet RPI RPL RHI RHL TAR CNTR PCNTR Status Code RC/CC/DS Additional Response Data with padding Note 1 Note 1 Note 1 Note 1 Note 1 Note 2 Note 2 Note 2 Note 2 Note 2 NOTE 1: If ciphering is indicated in the Command Packet SPI then these fields shall be ciphered. NOTE 2: These fields shall be included in the calculation of the RC/CC/DS. ETSI ETSI TS 101 181 V7.0.1 (1999-07) 13 (GSM 03.48 version 7.0.1 Release 1998) If ciphering is indicated, first the RC/CC/DS shall be calculated as indicated in Note 2, and then ciphering shall be applied, as indicated in note 1. If the SPI indicates that a specific field is unused, than its contents shall be set to zero, and ignored by the recipient of the Response Packet. If the SPI in the Command Packet indicates that no RC, CC or DS is present in the Command Header, this field shall be of zero length. If the Padding Counter content is zero, this shall indicate no padding octets are present, or no padding is necessary. Table 5: Response Status Codes Status Code (hexadecimal) Meaning ‘00’ PoR OK. ‘01’ RC/CC/DS failed. ‘02’ CNTR low. ‘03’ CNTR high. ‘04’ CNTR Blocked ‘05’ Ciphering error. ‘06’ Unidentified security error. This code is for the case where the Receiving Entity cannot correctly interpret the Command Header and the Response Packet is sent unciphered with no RC/CC/DS. ‘07’ Insufficient memory to process incoming message. ‘08’ This status code “more time” should be used if the Receiving Entity/Application needs more time to process the Command Packet due to timing constraints. In this case a later Response Packet should be returned to the Sending Entity once processing has been completed. ‘09’ TAR Unknown ‘0A’ - ‘FF’ Reserved for future use.
07cacd4869c6b37fc59006cce6a9de60
101 181
6 Implementation for SMS
6.1 Structure of the UDH of the Security Header in a Short Message The coding of the SMS-DELIVER, SMS-SUBMIT, SMS-DELIVER-REPORT or SMS-SUBMIT-REPORT header shall indicate that the data is binary (8 bit), and not 7 bit or 16 bit. In order to invoke the UDH functionality of relevant SMS element, the UDHI bit shall be set as defined in GSM 03.40 [3]. However, in the case of a Response Packet originating from the SIM, due to the inability of the SIM to indicate to a ME that the UDHI bit should be set, the Response Packet SMS will not have the UDHI bit set, and the Sending Entity shall treat the Response Packet as if the UDHI bit was set. ETSI ETSI TS 101 181 V7.0.1 (1999-07) 14 (GSM 03.48 version 7.0.1 Release 1998) U DL U DHL IEIa IED a IEIb ......... IEIn IED Ln IEDn SM (8 bit data) O ctet Boundary Total num ber of O ctets Length Indicator Total num ber of O ctets Length Indicator O ctets O ctets IEIDLa Figure 2: Structure of User Data Header in the Short Message The generalised structure of the UDH in the Short Message element is shown in figure 2, which is contained in the User Data part of the Short Message element. The Command Packet and the Response Packet are partially mapped into this UDH structure. Information Element Identifiers (IEI's) values '70 - 7F' are reserved for use in the present document. Values '70' and '71' are used in the present document, values '72 - 7D' are reserved, and '7E' and '7F' are for proprietary implementations. Where a Response Packet is too large to be contained in a single SMS-DELIVER-REPORT or SMS-SUBMIT- REPORT TP element, a Response Packet containing the Status Code “more time” should be returned to the SE using the SMS-REPORT element, followed by a complete Response Packet, contained in a SMS-DELIVER or SMS-SUBMIT element, which may be concatenated.
07cacd4869c6b37fc59006cce6a9de60
101 181
6.2 A Command Packet contained in a Single Short Message
The relationship between the Command Packet and its inclusion in the UDH structure of a single Short Message with no other UDH elements is indicated in table 6. Table 6: Relationship of Command Packet in UDH for single Short Message SMS specific elements Generalised Command Packet Elements (Refer to Table 1) Comments UDL Indicates the length of the entire SM. UDHL ='02' The first octet of the content or User Data part of the Short Message itself. Length of the total User Data Header, in this case, includes the length of IEIa + IEIDLa + IEDa (see figure 2), and is '02' in this case. IEIa CPI= ‘70’ Identifies this element of the UDH as the Command Packet Identifier. This value is reserved in GSM 03.40 [3]. IEIDLa ='00' Length of this object, in this case the length of IEDa, which is zero, indicating that IEDa is a null field.. IEDa Null field. SM (8 bit data) Length of Command Packet (2 octets)(Note) Length of the Command Packet (CPL), coded over 2 octets, and shall not be coded according to ISO/IEC 7816-6 [8]. Command Header Identifier (CHI) Null field. Length of the Command Header Length of the Command Header (CHL), coded over one octet, and shall not be coded according to ISO/IEC 7816-6 [8]. SPI to RC/CC/DS in the Command Header The remainder of the Command Header. Secured Data Application Message, including possible padding octets. ETSI ETSI TS 101 181 V7.0.1 (1999-07) 15 (GSM 03.48 version 7.0.1 Release 1998) NOTE: Whilst not absolutely necessary in this particular instance, this field is necessary for the case where concatenated Short Message is employed (see subclause 6.3). IEIa identifies the Command Packet and indicates that the first portion of the SM contains the Command Packet Length, the Command Header length followed by the remainder of the Command Header: the Secured Data follows on immediately as the remainder of the SM element. The UDHL field indicates the length of the IEIa and IEIDLa octets only ('02' in this case). It is recognised that most checksum algorithms require input data in modulo 8 length. In order to achieve a modulo 8 length of the data before the RC/CC/DS field in the Command Header the Length of the Command Packet and the Length of the Command Header shall be included in the calculation of RC/CC/DS if used. These fields shall not be ciphered. 6.3 A Command Packet contained in Concatenated Short Messages If a Command Packet is longer than 140 octets (including the Command Header), it shall be concatenated according to GSM 03.40 [3]. In this case, the entire Command Packet including the Command Header shall be assembled, and then separated into its component concatenated parts. The first Short Message shall contain the concatenation User Data Header and the Command Packet Identifier in the UDH in no particular order. Subsequent Short Messages shall contain only the concatenation User Data Header. The concatenation Header contains a Reference number that will allow the Receiving Entity to link individual Short Messages together to re-assemble the original Command Packet before unpacking the Command Packet. The relationship between the Command Packet and its inclusion in the structure of the first concatenated Short Message is indicated in table 7; the ordering of the various elements of the UDH is not important. Table 7: Relationship of Command Packet in UDH for concatenated Short Message SMS specific elements Generalised Command Packet Elements (Refer to Table 1) Comments UDL Indicates the length of the entire SM UDHL ='07' The first octet of the content or User Data part of the Short Message itself. Length of the total User Data Header, in this case, includes the length of IEIa + IEIDLa + IEDa + IEIb + IEIDLb + IEDb (see figure 2), which is '07' in this case. IEIa ‘00’, indicating concatenated short message identifies this Header as a concatenation control header defined in GSM 03.40 [3]. IEIDLa Length of Concatenation header length of the concatenation control header (= 3). IEDa 3 octets containing data concerned with concatenation These octets contain the reference number, sequence number and total number of messages in the sequence, as defined in GSM 03.40 [3]. IEIb CPI= ‘70’ Identifies this element of the UDH as the Command Packet Identifier. IEIDLb ='00' Length of this object, in this case the length of IEDb alone, which is zero, indicating that IEDb is a null field. IEDb Null field. SM (8 bit data) Length of Command Packet (2 octets) Length of the Command Packet (CPL), coded over 2 octets, and shall not be coded according to ISO/IEC 7816-6 [8]. Command Header Identifier (CHI) Null field. Length of the Command Header Length of the Command Header (CHL), coded over one octet, and shall not be coded according to ISO/IEC 7816-6 [8]. SPI to RC/CC/DS in the Command Header The remainder of the Command Header. Secured Data (part) Contains the first portion of the Secured Data. The remaining Secured Data will be contained in subsequent concatenated short messages. In the case where the Command Packet requires to be concatenated, then in table 7, IEIa identifies the concatenation control element of the Short Message, and is repeated in each subsequent Short Message in the concatenated series. In ETSI ETSI TS 101 181 V7.0.1 (1999-07) 16 (GSM 03.48 version 7.0.1 Release 1998) the first Short Message alone, in this example, IEIb identifies the Command Packet, which indicates that the first portion of the content of the Short Message contains the Command Header, which is followed immediately by the secured data as the SM part in table 7. In the first Short Message, the UDHL field contains the length of the concatenation control and the Command Packet Identifier, whereas in subsequent Short Message's in the concatenated series, the UDHL contains the length of the concatenation control only, as there is no subsequent Command Header. If the data is ciphered, then it is ciphered as described above, before being broken down into individual concatenated elements. The concatenation control portion of the UDH in each SM shall not be ciphered. In order to achieve a modulo 8 length of the data before the RC/CC/DS field in the Command Header, the Length of the Command Packet and the Length of the Command Header shall be included in the calculation of RC/CC/DS if used. These fields shall not be ciphered. An example illustrating the relationship between a Command Packet split over a sequence of three Short Messages is shown below. CC1 CH CC2 CC3 CH Secured data Padding First SMS in sequence Second SMS Third and final SMS CCn = Concatenation Control (1,2,3) CH = Command Header where
07cacd4869c6b37fc59006cce6a9de60
101 181
6.4 Structure of the Response Packet
The Response Packet is as follows. This message is generated by the Receiving Entity and possibly includes some data supplied by the Receiving Application, and returned to the Sending Entity/Sending Application. In the case where the Receiving Entity is the SIM, depending on bit 6 of the second octet of the SPI, this Response Packet is generated on the SIM, either: - retrieved by the ME from the SIM, and included in the User-Data part of the SMS-DELIVER-REPORT returned to the network; or - retrieved by the ME from the SIM using the Send Short Message proactive command. ETSI ETSI TS 101 181 V7.0.1 (1999-07) 17 (GSM 03.48 version 7.0.1 Release 1998) Table 8: Relationship of Response Packet in UDH SMS-REPORT specific elements Generalised Response Packet Elements (Refer to Table 3) Comments UDL Indicates the length of the entire SMS UDHL ='02' The first octet of the content of the SMS itself. Length of the total User Data Header, in this case, includes the length of IEIa + IEIDLa + IEDa. IEIa RPI= ‘71’ Identifies this element of the UDH as the Response Packet Identifier. This value is reserved in GSM 03.40 [3]. IEIDLa ='00' Length of this object, in this case the length of IEDa alone, which is zero, indicating that IEDa is a null field. IEDa Null field. SM (8 bit data) Length of Response Packet Length of the Response Packet (RPL), coded over 2 octets, and shall not be coded according to ISO/IEC 7816-6 [8]. (see note) Response Header Identifier (RHI) Null field. Length of the Response Header Length of the Response Header (RHL), coded over one octet, and shall not be coded according to ISO/IEC 7816-6 [8]. TAR to RC/CC/DS elements in the Response Header The remainder of the Response Header. Secured Data Additional Response Data (optional), including padding octets. Note: This field is not absolutely necessary but is placed here to maintain compatibility with the structure of the Command Packet when included in a SMS-SUBMIT or SMS-DELIVER. In order to achieve a modulo 8 length of the data before the RC/CC/DS field in the Response Header, the Length of the Response Packet, the Length of the Response Header and the three preceding octets (UDHL, IEIa and IEIDLa in the above table) shall be included in the calculation of RC/CC/DS if used. These fields shall not be ciphered. The structure of an SMS-DELIVER/SUBMIT-REPORT User Data object is very similar to that of the SMS-SUBMIT or SMS-DELIVER, see GSM 03.40 [3]. 7 Standardised SIM toolkit commands for Remote File Management There are two elements to Remote File Management on the SIM; the first is the behaviour of the SIM resident Toolkit Application which performs the Remote File Management, and the second is the command structure in the SIM Data Download message, see GSM 11.14 [6]. Access conditions for the GSM files as seen by the SIM resident application, are not standardised. These are under the control of the application designer, in co-operation with the Network Operator or Service Provider owning the SIM. These access conditions may be dependent on the level of security applied to the SIM Data Download message (e.g. SMS).
07cacd4869c6b37fc59006cce6a9de60
101 181
7.1 Behaviour of the Remote File Management Application
1. The parameter(s) in the SIM Data Download Message is either a single command, or a list of commands, which shall be processed sequentially. 2. The application shall take parameters from the SIM Data Download message and shall act upon the GSM files according to these parameters. 3. A Command "session" is defined as starting upon receipt of the parameter/command list, and ends when the parameter list in the SIM Data Download Message is completed, or when an error is detected which shall halt further processing of the command list. 4. At the beginning and end of a Command "session" the logical state, (e.g. file pointers) of the SIM as seen from the ME shall not be changed to an extent sufficient to disrupt the behaviour of the ME. If changes in the logical state have occurred that the ME needs to be aware of, the application on the SIM may issue a REFRESH ETSI ETSI TS 101 181 V7.0.1 (1999-07) 18 (GSM 03.48 version 7.0.1 Release 1998) command according to GSM 11.14 [6]. However, this is application dependent and therefore out of scope of the present document.
07cacd4869c6b37fc59006cce6a9de60
101 181
7.2 Coding of the commands
A command string may contain a single command or a sequence of commands. Each command is coded according to the generalised structure defined below; each element other than the Data field is a single octet; see GSM 11.11 [5]. Class byte (CLA) Instruction code (INS) P1 P2 P3 Data
07cacd4869c6b37fc59006cce6a9de60
101 181
7.2.1 Class 1 Commands
The standardised commands are listed in table 9. The commands are as defined in GSM 11.11 [5], except that the SELECT command is extended from the one in GSM 11.11 [5] to include "SELECT by path" as defined in ISO/IEC 7816-4 [7]. The following list of commands require a Class 1 implementation of the SIM Application Toolkit, see GSM 11.14 [6]. Table 9: Class 1 Commands Operational command SELECT GET RESPONSE UPDATE BINARY UPDATE RECORD SEEK INCREASE VERIFY CHV CHANGE CHV DISABLE CHV ENABLE CHV UNBLOCK CHV INVALIDATE REHABILITATE The GET RESPONSE command shall only occur once in a command string and, if present, shall be the last command in the string. The Response Data shall be placed in the Additional Response Data element of the Response Packet. Administrative commands are not defined, and remain proprietary to SIM manufacturers.
07cacd4869c6b37fc59006cce6a9de60
101 181
7.2.2 Class 2 Commands
The list of commands contained in table 10 require a Class 2 implementation of the SIM Application Toolkit. If SMS is being used, these should result in the generation of a single SM by the SIM application containing the relevant data as a result of executing these commands. Table 10: Class 2 commands Operational command READ BINARY READ RECORD
07cacd4869c6b37fc59006cce6a9de60
101 181
7.3 SIM specific behaviour for Response Packets (Using SMS)
Table 11 summarises the behaviour of the SIM’s RE/RA with regard to PoR if the SMS-DELIVER REPORT is used. ETSI ETSI TS 101 181 V7.0.1 (1999-07) 19 (GSM 03.48 version 7.0.1 Release 1998) Table 11: SIM specific behaviour PoR successful case Unsuccessful cases (see table 5) No '90 00' or '91 XX', null RP-ACK '90 00' or '91 XX', null RP-ACK OR '9E 00', null RP-ERROR Yes ‘9F XX’ (PoR OK, status code ‘00’). ‘9E XX’ (security error of some kind). NOTE : in the case where no proof of Receipt is required by the sending entity, it is however permissible for the SIM to send back data using '9F XX' in the successful case or '9E XX' in the unsuccessful case. If the SIM responds with the '90 00' or '91 XX' code, then there is no User Data to be included in an SMS-DELIVER- REPORT; the ME sends a "null" RP-ACK, with no User Data attached. In the case of a '9F XX' or '9E XX' response from the SIM, 'XX' indicates the length of the response data to be obtained from the SIM using a later GET RESPONSE command, or states that no additional information is given ('XX' = '00'). The response obtained from the SIM is the complete Response Packet to be included in the User Data part of the SMS- DELIVER-REPORT which will be returned to the Sending Entity as the TP part of the RP-ACK in the '9F XX' case, or as the TP part of the RP-ERROR in the '9E XX' case. In the case of a '9E XX' response from the SIM, the value of the TP-FCS element of the RP-ERROR shall be 'SIM data download error'. Because the SIM is unable to indicate to the ME that the TP-UDHI bit is to be set, the Sending Entity receiving the Response Packet shall expect the UDH structure in any event. See GSM 04.11 [4] for more detail of the structure of the RP-ACK and RP-ERROR protocol element, and GSM 03.40 [3] for more detail of the SMS-DELIVER-REPORT structure. ETSI ETSI TS 101 181 V7.0.1 (1999-07) 20 (GSM 03.48 version 7.0.1 Release 1998) Annex A (normative): Change History This annex lists all changes made to the present document since its initial approval by the ETSI committee, SMG. SMG# SMG tdoc SMG9 tdoc VERS CR RE V PHA SE CA T SUBJECT Resulting Version s24 0888/97 2.0.1 GSM 03.48 approved by SMG plenary 24 (December 1997) 5.0.0 Note: Version changed to 6.0.0 in line with decision at SMG #25 stating that release 97 documents shall become version 6.x.y s25 98-0159 98p069 5.0.0 A001 R97 F User data header indication for secure messaging. 6.0.0 s26 98-0401 98p250 6.0.0 A002 R97 F RP-ACK RP-ERROR for SIM data download error 6.1.0 s28 P-99-183 98p430 6.1.0 A003 R97 F Clarification about the CHI field in the command packet and RHI field in the response packet 7.0.0 P-99-183 99p069 A004 1 R98 C Modification for networks not supporting RP-ACK s29 7.0.0 Publication as version 7.0.1 7.0.1 ETSI ETSI TS 101 181 V7.0.1 (1999-07) 21 (GSM 03.48 version 7.0.1 Release 1998) History Document history V6.0.0 April 1998 Publication V6.1.0 June 1998 Publication V6.2.0 May 1999 Publication V7.0.1 July 1999 Publication ISBN2-7437-3207-5 Dépôt légal : Juillet 1999
7cb4fd1069780e5630834ee9b5bf2c49
100 977
1 Scope
The present document defines the interface between the Subscriber Identity Module (SIM) and the Mobile Equipment (ME) for use during the network operation phase of GSM as well as those aspects of the internal organization of the SIM which are related to the network operation phase. This is to ensure interoperability between a SIM and an ME independently of the respective manufacturers and operators. The concept of a split of the Mobile Station (MS) into these elements as well as the distinction between the GSM network operation phase, which is also called GSM operations, and the administrative management phase are described in the GSM 02.17 [6]. The present document defines: - the requirements for the physical characteristics of the SIM, the electrical signals and the transmission protocols; - the model which shall be used as a basis for the design of the logical structure of the SIM; - the security features; - the interface functions; - the commands; - the contents of the files required for the GSM application; - the application protocol. Unless otherwise stated, references to GSM also apply to DCS 1800. The present document does not specify any aspects related to the administrative management phase. Any internal technical reallocation of either the SIM or the ME are only specified where these reflect over the interface. It does not specify any of the security algorithms which may be used. The present document defines the SIM/ME interface for GSM Phase 2. While all attempts have been made to maintain phase compatibility, any issues that specifically relate to Phase 1 should be referenced from within the relevant Phase 1 specification.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
2 References
The following documents contain provisions which, through reference in this text, constitute provisions of the present document. • References are either specific (identified by date of publication, edition number, version number, etc.) or non-specific. • For a specific reference, subsequent revisions do not apply. • For a non-specific reference, the latest version applies. • A non-specific reference to an ETS shall also be taken to refer to later versions published as an EN with the same number. • For this Release 1997 document, references to GSM documents are for Release 1997 versions (version 6.x.y). [1] GSM 01.02: "Digital cellular telecommunications system (Phase 2+); General description of a GSM Public Land Mobile Network (PLMN)". [2] GSM 01.04: "Digital cellular telecommunications system (Phase 2+); Abbreviations and acronyms". [3] GSM 02.07: "Digital cellular telecommunications system (Phase 2+); Mobile Stations (MS) features". [4] GSM 02.09: "Digital cellular telecommunications system (Phase 2+); Security aspects". ETSI ETSI TS 100 977 V6.3.0 (2000-05) 10 (GSM 11.11 version 6.3.0 Release 1997) [5] GSM 02.11: "Digital cellular telecommunications system (Phase 2+); Service accessibility". [6] GSM 02.17: "Digital cellular telecommunications system (Phase 2+); Subscriber Identity Modules (SIM) Functional characteristics". [7] GSM 02.24: "Digital cellular telecommunications system (Phase 2+); Description of Charge Advice Information (CAI)". [8] GSM 02.30: "Digital cellular telecommunications system (Phase 2+); Man-Machine Interface (MMI) of the Mobile Station (MS)". [9] GSM 02.86: "Digital cellular telecommunications system (Phase 2+); Advice of charge (AoC) Supplementary Services - Stage 1". [10] GSM 03.03: "Digital cellular telecommunications system (Phase 2+); Numbering, addressing and identification". [11] GSM 03.20: "Digital cellular telecommunications system (Phase 2+); Security related network functions". [12] GSM 03.38: "Digital cellular telecommunications system (Phase 2+); Alphabets and language-specific information". [13] GSM 03.40: "Digital cellular telecommunications system (Phase 2+); Technical realization of the Short Message Service (SMS) Point-to-Point (PP)". [14] GSM 03.41: "Digital cellular telecommunications system (Phase 2+); Technical realization of Short Message Service Cell Broadcast (SMSCB)". [15] GSM 04.08: "Digital cellular telecommunications system (Phase 2+); Mobile radio interface layer 3 specification". [16] GSM 04.11: "Digital cellular telecommunications system (Phase 2+); Point-to-Point (PP) Short Message Service (SMS) support on mobile radio interface". [17] GSM 09.91 (ETR 174): "Digital cellular telecommunications system; Interworking aspects of the Subscriber Identity Module - Mobile Equipment (SIM - ME) interface between Phase 1 and Phase 2". [18] CCITT Recommendation E.118: "The international telecommunication charge card". [19] CCITT Recommendation E.164: "Numbering plan for the ISDN era". [20] CCITT Recommendation T.50: "International Alphabet No. 5". (ISO 646: 1983, Information processing - ISO 7-bits coded characters set for information interchange). [21] ISO/IEC 7810 (1995): "Identification cards - Physical characteristics". [22] ISO/IEC 7811-1 (1995): "Identification cards - Recording technique - Part 1: Embossing". [23] ISO/IEC 7811-3 (1995): "Identification cards - Recording technique - Part 3: Location of embossed characters on ID-1 cards". [24] ISO 7816-1 (1987): "Identification cards - Integrated circuit(s) cards with contacts, Part 1: Physical characteristics". [25] ISO 7816-2 (1988): "Identification cards - Integrated circuit(s) cards with contacts, Part 2: Dimensions and locations of the contacts". [26] ISO/IEC 7816-3 (1989): "Identification cards - Integrated circuit(s) cards with contacts, Part 3: Electronic signals and transmission protocols". [27] GSM 11.14 (TS 101 267): "Digital cellular telecommunications system (Phase 2+); Specification of the SIM Application Toolkit for the Subscriber Identity Module - Mobile Equipment (SIM - ME) interface". ETSI ETSI TS 100 977 V6.3.0 (2000-05) 11 (GSM 11.11 version 6.3.0 Release 1997) [28] GSM 11.12: "Digital cellular telecommunications system (Phase 2); Specification of the 3 Volt Subscriber Identity Module - Mobile Equipment (SIM - ME) interface". [29] GSM 02.22: "Digital cellular telecommunications system (Phase 2+); Personalization of GSM Mobile Equipment (ME) Mobile functionality specification". [30] ISO 639 (1988): "Code for the representation of names of languages". [31] ISO/IEC 10646-1 (1993): "Information technology - Universal Multiple-Octet Coded Character Set (UCS) - Part 1: Architecture and Basic Multilingual Plane". [32] GSM 03.60: "Digital cellular telecommunications system (Phase 2+); General Packet Radio ervice (GPRS); Service description; Stage 2". [33] GSM 02.67: "Digital cellular telecommunications system (Phase 2+); Enhanced Multi Level Pre- emption and Priority (EMLPP) services - stage 1".
7cb4fd1069780e5630834ee9b5bf2c49
100 977
3 Definitions, abbreviations and symbols
7cb4fd1069780e5630834ee9b5bf2c49
100 977
3.1 Definitions
For the purposes of the present document, the following terms and definitions apply. For further information and definitions refer to GSM 01.02 [1]. access conditions: set of security attributes associated with a file. application: application consists of a set of security mechanisms, files, data and protocols (excluding transmission protocols). application protocol: set of procedures required by the application. card session: link between the card and the external world starting with the ATR and ending with a subsequent reset or a deactivation of the card. current directory: latest MF or DF selected. current EF: latest EF selected. data field: obsolete term for Elementary File. Dedicated File (DF): file containing access conditions and, optionally, Elementary Files (EFs) or other Dedicated Files (DFs). directory: general term for MF and DF. Elementary File (EF): file containing access conditions and data and no other files. file: directory or an organized set of bytes or records in the SIM. file identifier: 2 bytes which address a file in the SIM. GSM or DCS 1800 application: set of security mechanisms, files, data and protocols required by GSM or DCS 1800. GSM session: that part of the card session dedicated to the GSM operation. IC card SIM: obsolete term for ID-1 SIM. ID-1 SIM: SIM having the format of an ID-1 card (see ISO 7816-1 [24]). Master File (MF): unique mandatory file containing access conditions and optionally DFs and/or EFs. normal GSM operation: relating to general, CHV related, GSM security related and subscription related procedures. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 12 (GSM 11.11 version 6.3.0 Release 1997) padding: one or more bits appended to a message in order to cause the message to contain the required number of bits or bytes. plug-in SIM: second format of SIM (specified in clause 4). proactive SIM: SIM which is capable of issuing commands to the ME. Part of SIM Application Toolkit (see clause 11). record: string of bytes within an EF handled as a single entity (see clause 6). record number: number which identifies a record within an EF. record pointer: pointer which addresses one record in an EF. root directory: obsolete term for Master File. SIM application toolkit procedures: defined in GSM 11.14 [27].
7cb4fd1069780e5630834ee9b5bf2c49
100 977
3.2 Abbreviations
For the purposes of the present document, the following abbreviations apply, in addition to those listed in GSM 01.04 [2]: A3 Algorithm 3, authentication algorithm; used for authenticating the subscriber A38 A single algorithm performing the functions of A3 and A8 A5 Algorithm 5, cipher algorithm; used for enciphering/deciphering data A8 Algorithm 8, cipher key generator; used to generate Kc ACM Accumulated Call Meter ADM Access condition to an EF which is under the control of the authority which creates this file ADN Abbreviated Dialling Number ALW ALWays AoC Advice of Charge APDU Application Protocol Data Unit ATR Answer To Reset BCCH Broadcast Control CHannel BCD Binary Coded Decimal BDN Barred Dialling Number BTS Base Transmitter Station CB Cell Broadcast CBMI Cell Broadcast Message Identifier CCITT The International Telegraph and Telephone Consultative Committee (now also known as the ITU Telecommunications Standardization sector) CCP Capability/Configuration Parameter CHV Card Holder Verification information; access condition used by the SIM for the verification of the identity of the user CLA CLAss CNL Co-operative Network List DCK De-personalization Control Keys DCS Digital Cellular System DF Dedicated File (abbreviation formerly used for Data Field) DTMF Dual Tone Multiple Frequency ECC Emergency Call Code EF Elementary File eMLPP enhanced Multi-Level Precedence and Pre-emption Service ETSI European Telecommunications Standards Institute etu elementary time unit FDN Fixed Dialling Number GSM Global System for Mobile communications HPLMN Home PLMN IC Integrated Circuit ICC Integrated Circuit(s) Card ID IDentifier ETSI ETSI TS 100 977 V6.3.0 (2000-05) 13 (GSM 11.11 version 6.3.0 Release 1997) IEC International Electrotechnical Commission IMSI International Mobile Subscriber Identity ISO International Organization for Standardization Kc Cryptographic key; used by the cipher A5 Ki Subscriber authentication key; the cryptographic key used by the authentication algorithm, A3, and cipher key generator, A8 LAI Location Area Information; information indicating a cell or a set of cells lgth The (specific) length of a data unit LND Last Number Dialled LSB Least Significant Bit MCC Mobile Country Code ME Mobile Equipment MF Master File MMI Man Machine Interface MNC Mobile Network Code MS Mobile Station MSB Most Significant Bit MSISDN Mobile Station international ISDN number NET NETwork NEV NEVer NPI Numbering Plan Identifier PIN/PIN2 Personal Identification Number / Personal Identification Number 2 (obsolete terms for CHV1 and CHV2, respectively) PLMN Public Land Mobile Network PTS Protocol Type Select (response to the ATR) PUK/PUK2 PIN Unblocking Key / PIN2 Unblocking Key (obsolete terms for UNBLOCK CHV1 and UNBLOCK CHV2, respectively) RAND A RANDom challenge issued by the network RFU Reserved for Future Use SDN Service Dialling Number SIM Subscriber Identity Module SMS Short Message Service SRES Signed RESponse calculated by a SIM SSC Supplementary Service Control string SW1/SW2 Status Word 1 / Status Word 2 TMSI Temporary Mobile Subscriber Identity TON Type Of Number TP Transfer layer Protocol TPDU Transfer Protocol Data Unit TS Technical Specification UNBLOCK CHV1/2 value to unblock CHV1/CHV2 VBS Voice Broadcast Service VGCS Voice Group Call Service VPLMN Visited PLMN
7cb4fd1069780e5630834ee9b5bf2c49
100 977
3.3 Symbols
For the purposes of the present document, the following symbols apply: Vcc Supply voltage Vpp Programming voltage '0' to '9' and 'A' to 'F' The sixteen hexadecimal digits ETSI ETSI TS 100 977 V6.3.0 (2000-05) 14 (GSM 11.11 version 6.3.0 Release 1997)
7cb4fd1069780e5630834ee9b5bf2c49
100 977
4 Physical characteristics
Two physical types of SIM are specified. These are the "ID-1 SIM" and the "Plug-in SIM". The physical characteristics of both types of SIM shall be in accordance with ISO 7816-1,2 [24, 25] unless otherwise specified. The following additional requirements shall be applied to ensure proper operation in the GSM environment.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
4.1 Format and layout
The information on the exterior of either SIM should include at least the individual account identifier and the check digit of the IC Card Identification (see clause 10, EFICCID).
7cb4fd1069780e5630834ee9b5bf2c49
100 977
4.1.1 ID-1 SIM
Format and layout of the ID-1 SIM shall be in accordance with ISO 7816-1 [24] and ISO 7816-2 [25]. The card shall have a polarization mark (see GSM 02.07 [3]) which indicates how the user should insert the card into the ME. The ME shall accept embossed ID-1 cards. The embossing shall be in accordance with ISO/IEC 7811 [22, 23]. The contacts of the ID-1 SIM shall be located on the front (embossed face, see ISO/IEC 7810 [21]) of the card. NOTE: Card warpage and tolerances are now specified for embossed cards in ISO/IEC 7810 [21].
7cb4fd1069780e5630834ee9b5bf2c49
100 977
4.1.2 Plug-in SIM
The Plug-in SIM has a width of 25 mm, a height of 15 mm, a thickness the same as an ID-1 SIM and a feature for orientation. See figure A.1 in normative annex A for details of the dimensions of the card and the dimensions and location of the contacts. Annexes A.1 and A.2 of ISO 7816-1 [24] do not apply to the Plug-in SIM. Annex A of ISO 7816-2 [25] applies with the location of the reference points adapted to the smaller size. The three reference points P1, P2 and P3 measure 7,5 mm, 3,3 mm and 20,8 mm, respectively, from 0. The values in table A.1 of ISO 7816-2 [25] are replaced by the corresponding values of figure A.1.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
4.2 Temperature range for card operation
The temperature range for full operational use shall be between -25°C and +70°C with occasional peaks of up to +85°C. "Occasional" means not more than 4 hours each time and not over 100 times during the life time of the card.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
4.3 Contacts
7cb4fd1069780e5630834ee9b5bf2c49
100 977
4.3.1 Provision of contacts
ME: Contacting elements in the ME in positions C4 and C8 are optional, and are not used in the GSM application. They shall present a high impedance to the SIM card in the GSM application. If it is determined that the SIM is a multi-application ICC, then these contacts may be used. Contact C6 need not be provided for Plug-in SIMs. SIM: Contacts C4 and C8 need not be provided by the SIM, but if they are provided, then they shall not be connected internally in the SIM if the SIM only contains the GSM application. Contact C6 shall not be bonded in the SIM for any function other than supplying Vpp. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 15 (GSM 11.11 version 6.3.0 Release 1997)
7cb4fd1069780e5630834ee9b5bf2c49
100 977
4.3.2 Activation and deactivation
The ME shall connect, activate and deactivate the SIM in accordance with the Operating Procedures specified in ISO/IEC 7816-3 [26]. For any voltage level, monitored during the activation sequence, or during the deactivation sequence following soft power-down, the order of the contact activation/deactivation shall be respected. NOTE 1: Soft Power switching is defined in GSM 02.07 [3]. NOTE 2: It is recommended that whenever possible the deactivation sequence defined in ISO/IEC 7816-3 [26] should be followed by the ME on all occasions when the ME is powered down. If the SIM clock is already stopped and is not restarted, the ME is allowed to deactivate all the contacts in any order, provided that all signals reach low level before Vcc leaves high level. If the SIM clock is already stopped and is restarted before the deactivation sequence, then the deactivation sequence specified in ISO/IEC 7816-3 [26] subclause 5.4 shall be followed. When Vpp is connected to Vcc, as allowed by GSM (see clause 5), then Vpp will be activated and deactivated with Vcc, at the time of the Vcc activation/deactivation, as given in the sequences of ISO/IEC 7816-3 [26] subclauses 5.1 and 5.4. The voltage level of Vcc, used by GSM, differs from that specified in ISO/IEC 7816-3 [26]. Vcc is powered when it has a value between 4,5 V and 5,5 V.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
4.3.3 Inactive contacts
The voltages on contacts C1, C2, C3, C6 and C7 of the ME shall be between 0 and ± 0,4 volts referenced to ground (C5) when the ME is switched off with the power source connected to the ME. The measurement equipment shall have a resistance of 50 kohms when measuring the voltage on C2, C3, C6 and C7. The resistance shall be 10 kohms when measuring the voltage on C1.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
4.3.4 Contact pressure
The contact pressure shall be large enough to ensure reliable and continuous contact (e.g. to overcome oxidisation and to prevent interruption caused by vibration). The radius of any curvature of the contacting elements shall be greater than or equal to 0,8 mm over the contact area. Under no circumstances may a contact force be greater than 0,5 N per contact. Care shall be taken to avoid undue point pressure to the area of the SIM opposite to the contact area. Otherwise this may damage the components within the SIM.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
4.4 Precedence
For Mobile Equipment, which accepts both an ID-1 SIM and a Plug-in SIM, the ID-1 SIM shall take precedence over the Plug-in SIM (see GSM 02.17 [6]).
7cb4fd1069780e5630834ee9b5bf2c49
100 977
4.5 Static Protection
Considering that the SIM is a CMOS device, the ME manufacturer shall take adequate precautions (in addition to the protection diodes inherent in the SIM) to safeguard the ME, SIM and SIM/ME interface from static discharges at all times, and particularly during SIM insertion into the ME. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 16 (GSM 11.11 version 6.3.0 Release 1997)
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5 Electronic signals and transmission protocols
Electronic signals and transmission protocols shall be in accordance with ISO/IEC 7816-3 [26] unless specified otherwise. The following additional requirements shall be applied to ensure proper operation in the GSM environment. The choice of the transmission protocol(s), to be used to communicate between the SIM and the ME, shall at least include that specified and denoted by T=0 in ISO/IEC 7816-3 [26]. The values given in the tables hereafter are derived from ISO/IEC 7816-3 [26], subclause 4.2 with the following considerations: - VOH and VOL always refer to the device (ME or SIM) which is driving the interface. VIH and VIL always refer to the device (ME or SIM) which is operating as a receiver on the interface; - this convention is different to the one used in ISO/IEC 7816-3 [26], which specifically defines an ICC for which its current conventions apply. The following clauses define the specific core requirements for the SIM, which provide also the basis for Type Approval. For each state (VOH, VIH, VIL and VOL) a positive current is defined as flowing out of the entity (ME or SIM) in that state; - the high current options of ISO/IEC 7816-3 [26] for VIH and VOH are not specified for the SIM as they apply to NMOS technology requirements. No realization of the SIM using NMOS is foreseen.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5.1 Supply voltage Vcc (contact C1)
The SIM shall be operated within the following limits: Table 1: Electrical characteristics of Vcc under normal operating conditions Symbol Minimum Maximum Unit Vcc 4,5 5,5 V Icc 10 mA The current consumption of the SIM shall not exceed the value given in table 1 during any state (including activation and deactivation as defined in subclause 4.3.2). When the SIM is in idle state (see below) the current consumption of the card shall not exceed 200 µA at 1 MHz and 25°C. If clock stop mode is allowed, then the current consumption shall also not exceed 200 µA while the clock is stopped. The ME shall source the maximum current requirements defined above. It shall also be able to counteract spikes in the current consumption of the card up to a maximum charge of 40 nAs with no more than 400 ns duration and an amplitude of at most 200 mA, ensuring that the supply voltage stays in the specified range. NOTE: A possible solution would be to place a capacitor (e.g. 100 nF, ceramic) as close as possible to the contacting elements.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5.2 Reset (RST) (contact C2)
The ME shall operate the SIM within the following limits: Table 2: Electrical characteristics of RST under normal operating conditions Symbol Conditions Minimum Maximum VOH IOHmax = +20 µA Vcc-0,7 Vcc (note) VOL IOLmax = -200 µA 0V (note) 0,6 V tR tF Cout = Cin = 30 pF 400 µs NOTE: To allow for overshoot the voltage on RST shall remain between -0,3 V and Vcc+0,3 V during dynamic operation. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 17 (GSM 11.11 version 6.3.0 Release 1997)
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5.3 Programming voltage Vpp (contact C6)
SIMs shall not require any programming voltage on Vpp. The ME need not provide contact C6. If the ME provides contact C6, then, in the case of the ID-1 SIM the same voltage shall be supplied on Vpp as on Vcc, while in the case of Plug-in SIMs the ME need not provide any voltage on C6. Contact C6 may be connected to Vcc in any ME but shall not be connected to ground.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5.4 Clock CLK (contact C3)
The SIM shall support 1 MHz to 5 MHz. The clock shall be supplied by the ME. No "internal clock" SIMs shall be used. If a frequency of 13/4 MHz is needed by the SIM to run the authentication procedure in the allotted time (see GSM 03.20 [11]), or to process an ENVELOPE command used for SIM Data Download, bit 2 of byte 1 in the file characteristics shall be set to 1. Otherwise a minimum frequency of 13/8 MHz may be used. The duty cycle shall be between 40 % and 60 % of the period during stable operation. The ME shall operate the SIM within the following limits: Table 3: Electrical characteristics of CLK under normal operating conditions Symbol Conditions Minimum Maximum VOH IOHmax = +20 µA 0,7xVcc Vcc (note) VOL IOLmax = -200 µA 0 V (note) 0,5 V tR tF Cout = Cin = 30 pF 9 % of period with a maximum of 0,5 µs NOTE: To allow for overshoot the voltage on CLK shall remain between -0,3 V and Vcc+0,3 V during dynamic operation.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5.5 I/O (contact C7)
Table 4 defines the electrical characteristics of the I/O (contact C7). The values given in the table have the effect of defining the values of the pull-up resistor in the ME and the impedances of the drivers and receivers in the ME and SIM. Table 4: Electrical characteristics of I/O under normal operating conditions Symbol Conditions Minimum Maximum VIH IIHmax = ± 20 µA (note 2) 0,7xVcc Vcc+0,3 V VIL IILmax = +1 mA -0,3 V 0,8 V VOH (note 1) IOHmax = + 20µA 3,8 V Vcc (note 3) VOL IOLmax = -1 mA 0 V (note 3) 0,4 V tR tF Cout = Cin = 30 pF 1 µs NOTE 1: It is assumed that a pull-up resistor is used in the interface device (recommended value: 20 kohms). NOTE 2: During static conditions (idle state) only the positive value can apply. Under dynamic operating conditions (transmission) short term voltage spikes on the I/O line may cause a current reversal. NOTE 3: To allow for overshoot the voltage on I/O shall remain between -0,3 V and Vcc+0,3 V during dynamic operation.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5.6 States
There are two states for the SIM while the power supply is on: - the SIM is in operating state when it executes a command. This state also includes transmission from and to the ME; - the SIM is in idle state at any other time. It shall retain all pertinent data during this state. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 18 (GSM 11.11 version 6.3.0 Release 1997) The SIM may support a clock stop mode. The clock shall only be switched off subject to the conditions specified in the file characteristics (see clause 9). Clock stop mode. An ME of Phase 2 or later shall wait at least 1 860 clock cycles after having received the last character, including the guard time (2 etu), of the response before it switches off the clock (if it is allowed to do so). It shall wait at least 744 clock cycles before it sends the first command after having started the clock. To achieve phase compatibility, the following procedure shall be adhered to: - a SIM of Phase 2 or later shall always send the status information "normal ending of the command" after the successful interpretation of the command SLEEP received from a Phase 1 ME. An ME of Phase 2 or later shall not send a SLEEP command; - a Phase 1 ME shall wait at least 744 clock cycles after having received the compulsory acknowledgement SW1 SW2 of the SLEEP command before it switches off the clock (if it is allowed to do so). It shall wait at least 744 clock cycles before it sends the first command after having started the clock.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5.7 Baudrate
The initial baudrate (during ATR) shall be: (clock frequency)/372. Subsequent baudrate shall be: (clock frequency)/372 unless the PTS procedure has been successfully performed. In that case the negotiated baudrate shall be applied according to subclause 5.8.2.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5.8 Answer To Reset (ATR)
The ATR is information presented by the SIM to the ME at the beginning of the card session and gives operational requirements.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5.8.1 Structure and contents
The following table gives an explanation of the characters specified in ISO/IEC 7816-3 [26] and the requirements for their use in GSM. The answer to reset consists of at most 33 characters. The ME shall be able to receive interface characters for transmission protocols other than T=0, historical characters and a check byte, even if only T=0 is used by the ME. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 19 (GSM 11.11 version 6.3.0 Release 1997) Table 5: ATR Character Contents sent by the card a) evaluation by the ME b) reaction by the ME 1. Initial character TS coding convention for all subsequent characters (direct or inverse convention) always a) always b) using appropriate convention 2. Format character T0 subsequent interface characters, number of historical characters always a) always b) identifying the subsequent characters accordingly 3. Interface character (global) TA1 parameters to calculate the work etu optional a) always if present b) if TA1 is not '11', PTS procedure shall be used (see subclause 5.8.2) 4. Interface character (global) TB1 parameters to calculate the programming voltage and current optional a) always if present b) if PI1 is not 0, then reject the SIM (in accordance with subclause 5.10) 5. Interface character (global) TC1 parameters to calculate the extra guardtime requested by the card; no extra guardtime is used to send characters from the card to the ME optional a) always if present b) if TC1 is neither 0 nor 255, then reject the SIM (in accordance with subclause 5.10); see the note after the table 6. Interface character TD1 protocol type; indicator for the presence of inter- face characters, specifying rules to be used for transmissions with the given protocol type optional a) always if present b) identifying the subsequent characters accordingly 7. Interface character (specific) TA2 not used for protocol T=0 optional a) optional b) -------- 8. Interface character (global) TB2 parameter to calculate the programming voltage never the allowed value of TB1 above defines that an external programming voltage is not applicable 9. Interface character (specific) TC2 parameters to calculate the work waiting time optional a) always if present b) using the work waiting time accordingly 10. Interface character TDi (i>1) protocol type; indicator for the presence of interface characters, specifying rules to be used for transmissions with the given protocol type optional a) always if present b) identifying the subsequent characters accordingly (continued) ETSI ETSI TS 100 977 V6.3.0 (2000-05) 20 (GSM 11.11 version 6.3.0 Release 1997) Table 5 (concluded): ATR Character Contents sent by the card a) evaluation by the ME b) reaction by the ME 11. Interface character TAi, TBi, TCi (i>2) characters which contain interface characters for other transmission protocols optional a) optional b) -------- 12. Historical characters T1,...,TK contents not specified in ISO/IEC optional a) optional b) -------- 13. Check character TCK check byte (exclusive -ORing) not sent if only T=0 is indicated in the ATR; in all other cases TCK shall be sent a) optional b) -------- NOTE: According to ISO/IEC 7816-3:1989/DAM2 (see annex D) N=255 indicates that the minimum delay is 12 etu for the asynchronous half-duplex character transmission protocol.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5.8.2 PTS procedure
Specifically related to the present document the PTS procedure according to ISO/IEC 7816-3 [26], clause 7, is applied, only if TA1 is not equal to '11', as follows: a) for MEs only supporting default speed (F=372, D=1) ME ————————————— Reset —————————————> SIM <————————————— ATR —————————————— TA1 not = '11' PTSS = 'FF' PTS0 = '00' ———————— PTS Request —————> PCK = 'FF' PTSS = 'FF' <———————— PTS Response ————— PTS0 = '00' PCK = 'FF' Figure 1: PTS procedure PTS Request and PTS Response consist of the three (3) characters PTSS, PTSO and PCK of which PTSS is sent first. After this procedure the protocol T=0 and the parameters F=372, D=1 and N=0 will be used. b) for MEs only supporting enhanced speed (F=512, D=8) ME ————————————— Reset —————————————> SIM <—————————————— ATR —————————————— TA1 = '94' PTSS = 'FF' PTS0 = '10' ———————— PTS Request —————> PTS1 = '94' PCK = '7B' PTSS = 'FF' <———————— PTS Response ————— PTS0 = '10' PTS1 = '94' PCK = '7B' Figure 2: PTS procedure requesting enhanced speed values (F=512, D=8, see subclause 5.8.3) ETSI ETSI TS 100 977 V6.3.0 (2000-05) 21 (GSM 11.11 version 6.3.0 Release 1997) PTS Request and PTS Response consist of the four (4) characters PTSS, PTSO, PTS1 and PCK of which PTSS is sent first. After this procedure the protocol T=0 and the parameters F=512, D=8 and N=0 will be used.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5.8.3 Speed enhancement
If speed enhancement is implemented, the ME and the SIM shall at least support F=512 and D=8 in addition to F=372 and D=1. However, other values may also be supported. If the ME requests PTS using values other than those above then the PTS procedure shall be initiated accordingly. The SIM shall support the default value (F=372 and D=1). If the speed enhancement is supported by the SIM it is mandatory that F=512 and D=8 is supported. However, the value in TA1 may even indicate a faster speed (F=512 and D=16). The SIM may also support other values between the default value (F=372 and D=1) and the values indicated in TA1. The SIM shall offer the negotiable mode, to ensure backwards compatibility with existing MEs. In the negotiable mode the SIM will use default values even if other parameters are offered in the ATR if the PTS procedure is not initiated. The ME shall support the default value (F=372 and D=1). If the speed enhancement is supported in the ME it is mandatory to support F=512 and D=8. The ME may additionally support other values. If the SIM does not answer the PTS request within the initial waiting time the ME shall reset the SIM. After two failed PTS attempts using F=512 and D=8 or values indicated in TA1, (no PTS response from the SIM) the ME shall initiate PTS procedure using default values. If this also fails (no PTS response from the SIM) the ME may proceed using default values without requesting PTS. If the SIM does not support the values requested by the ME, the SIM shall respond to the PTS request indicating the use of default values.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5.9 Bit/character duration and sampling time
The bit/character duration and sampling time specified in ISO/IEC 7816-3 [26], subclauses 6.1.1 and 6.1.2, are valid for all communications.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
5.10 Error handling
Following receipt of an ATR, which is not in accordance with the present document, e.g. because of forbidden ATR characters or too few bytes being transmitted, the ME shall perform a Reset. The ME shall not reject the SIM until at least three consecutive wrong ATRs are received. During the transmission of the ATR and the protocol type selection, the error detection and character repetition procedure specified in ISO/IEC 7816-3 [26], subclause 6.1.3, is optional for the ME. For the subsequent transmission on the basis of T=0 this procedure is mandatory for the ME. For the SIM the error detection and character repetition procedure is mandatory for all communications.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
6 Logical Model
This clause describes the logical structure for a SIM, the code associated with it, and the structure of files used.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
6.1 General description
Figure 3 shows the general structural relationships which may exist between files. The files are organized in a hierarchical structure and are of one of three types as defined below. These files may be either administrative or application specific. The operating system handles the access to the data stored in different files. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 22 (GSM 11.11 version 6.3.0 Release 1997) MF DF2 EF DF1 DF11 DF111 EF DF12 .... EF EF EF EF EF .... Figure 3: Organization of memory Files are composed of a header, which is internally managed by the SIM, and optionally a body part. The information of the header is related to the structure and attributes of the file and may be obtained by using the commands GET RESPONSE or STATUS. This information is fixed during the administrative phase. The body part contains the data of the file.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
6.2 File identifier
A file ID is used to address or identify each specific file. The file ID consists of two bytes and shall be coded in hexadecimal notation. They are specified in clause 10. The first byte identifies the type of file, and for GSM is: - '3F': Master File; - '7F': 1st level Dedicated File; - '5F': 2nd level Dedicated File; - '2F': Elementary File under the Master File; - '6F': Elementary File under a 1st level Dedicated File; - '4F': Elementary File under 2nd level Dedicated File. File IDs shall be subject to the following conditions: - the file ID shall be assigned at the time of creation of the file concerned; - no two files under the same parent shall have the same ID; - a child and any parent, either immediate or remote in the hierarchy, e.g. grandparent, shall never have the same file ID. In this way each file is uniquely identified.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
6.3 Dedicated files
A Dedicated File (DF) is a functional grouping of files consisting of itself and all those files which contain this DF in their parental hierarchy (that is to say it consists of the DF and its complete "subtree"). A DF "consists" only of a header part. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 23 (GSM 11.11 version 6.3.0 Release 1997) Three 1st level DFs are defined in the present document: - DFGSM which contains the applications for both GSM and/or DCS 1800; - DFIS41 which contains the applications for IS-41 as specified by ANSI T1P1; - DFTELECOM which contains telecom service features. All three files are immediate children of the Master File (MF) and may coexist on a multi-application card. 2nd level DFs are defined in the present document under DFGSM. All 2nd level DFs are immediate children of the DFGSM and may coexist on a multi-application card.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
6.4 Elementary files
An Elementary File (EF) is composed of a header and a body part. The following three structures of an EF are used by GSM.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
6.4.1 Transparent EF
An EF with a transparent structure consists of a sequence of bytes. When reading or updating, the sequence of bytes to be acted upon is referenced by a relative address (offset), which indicates the start position (in bytes), and the number of bytes to be read or updated. The first byte of a transparent EF has the relative address '00 00'. The total data length of the body of the EF is indicated in the header of the EF. Header Body Sequence of bytes NOTE: This structure was previously referred to as "binary" in GSM. Figure 4: Structure of a transparent EF
7cb4fd1069780e5630834ee9b5bf2c49
100 977
6.4.2 Linear fixed EF
An EF with linear fixed structure consists of a sequence of records all having the same (fixed) length. The first record is record number 1. The length of a record as well as this value multiplied by the number of records are indicated in the header of the EF. Header Body Record 1 Record 2 : : Record n Figure 5: Structure of a linear fixed file There are several methods to access records within an EF of this type: - absolutely using the record number; - when the record pointer is not set it shall be possible to perform an action on the first or the last record by using the NEXT or PREVIOUS mode; - when the record pointer is set it shall be possible to perform an action on this record, the next record (unless the record pointer is set to the last record) or the previous record (unless the record pointer is set to the first record); - by identifying a record using pattern seek starting: ETSI ETSI TS 100 977 V6.3.0 (2000-05) 24 (GSM 11.11 version 6.3.0 Release 1997) - forwards from the beginning of the file; - forwards from the record following the one at which the record pointer is set (unless the record pointer is set to the last record); - backwards from the end of the file; - backwards from the record preceding the one at which the record pointer is set (unless the record pointer is set to the first record). If an action following selection of a record is aborted, then the record pointer shall remain set at the record at which it was set prior to the action. NOTE 1: It is not possible, at present, to have more than 255 records in a file of this type, and each record cannot be greater than 255 bytes. NOTE 2: This structure was previously referred to as "formatted" in GSM.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
6.4.3 Cyclic EF
Cyclic files are used for storing records in chronological order. When all records have been used for storage, then the next storage of data shall overwrite the oldest information. An EF with a cyclic structure consists of a fixed number of records with the same (fixed) length. In this file structure there is a link between the last record (n) and the first record. When the record pointer is set to the last record n, then the next record is record 1. Similarly, when the record pointer is set to record 1, then the previous record is record n. The last updated record containing the newest data is record number 1, and the oldest data is held in record number n. Header Body Record 1 Record 2 : : Record n Figure 6: Structure of a cyclic file For update operations only PREVIOUS record shall be used. For reading operations, the methods of addressing are Next, Previous, Current and Record Number. After selection of a cyclic file (for either operation), the record pointer shall address the record updated or increased last. If an action following selection of a record is aborted, then the record pointer shall remain set at the record at which it was set prior to the action. NOTE: It is not possible, at present, to have more than 255 records in a file of this type, and each record cannot be greater than 255 bytes.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
6.5 Methods for selecting a file
After the Answer To Reset (ATR), the Master File (MF) is implicitly selected and becomes the Current Directory. Each file may then be selected by using the SELECT function in accordance with the following rules. Selecting a DF or the MF sets the Current Directory. After such a selection there is no current EF. Selecting an EF sets the current EF and the Current Directory remains the DF or MF which is the parent of this EF. The current EF is always a child of the Current Directory. Any application specific command shall only be operable if it is specific to the Current Directory. The following files may be selected from the last selected file: - any file which is an immediate child of the Current Directory; ETSI ETSI TS 100 977 V6.3.0 (2000-05) 25 (GSM 11.11 version 6.3.0 Release 1997) - any DF which is an immediate child of the parent of the current DF; - the parent of the Current Directory; - the current DF; - the MF. This means in particular that a DF shall be selected prior to the selection of any of its EFs. All selections are made using the file ID. The following figure gives the logical structure for the GSM application. GSM defines only two levels of DFs under the MF. EF1 DF2 EF3 EF4 MF EF2 DF1 EF5 DF3 Figure 7: Logical structure The following table gives the valid selections for GSM for the logical structure in figure 7. Reselection of the last selected file is also allowed but not shown. Table 6: File selection Last selected file Valid Selections MF DF1, DF2, EF1 DF1 MF, DF2, DF3, EF2 DF2 MF, DF1, EF3, EF4 DF3 MF, DF1, EF5 EF1 MF, DF1, DF2 EF2 MF, DF1, DF2, DF3 EF3 MF, DF1, DF2, EF4 EF4 MF, DF1, DF2, EF3 EF5 MF, DF1, DF3
7cb4fd1069780e5630834ee9b5bf2c49
100 977
6.6 Reservation of file IDs
In addition to the identifiers used for the files specified in the present document, the following file IDs are reserved for use by GSM. Dedicated Files: - administrative use: '7F 4X', '5F1X', '5F2X' - operational use: '7F 10' (DFTELECOM), '7F 20' (DFGSM), '7F 21' (DFDCS1800), '7F 22' (DFIS41), and '7F 2X', where X ranges from '3' to 'F'. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 26 (GSM 11.11 version 6.3.0 Release 1997) - reserved under '7F20': '5F30' (DFIRIDIUM), '5F31' (DFGlobalstar), '5F32' (DFICO), '5F33' (DFACeS), '5F3X', where X ranges from '4' to 'F' for other MSS. '5F40'(DFPCS-1900), '5F4Y' where Y ranges from '1' to 'F' and, '5FYX' where Y ranges from '5' to 'F'. Elementary files: - administrative use: '6F XX' in the DFs '7F 4X'; '4F XX' in the DFs '5F 1X', '5F2X' '6F 1X' in the DFs '7F 10', '7F 20', '7F 21'; '4F 1X' in all 2nd level DFs '2F 01', '2F EX' in the MF '3F 00'; - operational use: '6F 2X', '6F 3X', '6F 4X' in '7F 10' and '7F 2X'; '4F YX', where Y ranges from '2' to 'F' in all 2nd level DFs. '2F 1X' in the MF '3F 00'. In all the above, X ranges, unless otherwise stated, from '0' to 'F'.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
7 Security features
The security aspects of GSM are described in the normative references GSM 02.09 [4] and GSM 03.20 [11]. This clause gives information related to security features supported by the SIM to enable the following: - authentication of the subscriber identity to the network; - data confidentiality over the radio interface; - file access conditions.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
7.1 Authentication and cipher key generation procedure
This subclause describes the authentication mechanism and cipher key generation which are invoked by the network. For the specification of the corresponding procedures across the SIM/ME interface see clause 11. The network sends a Random Number (RAND) to the MS. The ME passes the RAND to the SIM in the command RUN GSM ALGORITHM. The SIM returns the values SRES and Kc to the ME which are derived using the algorithms and processes given below. The ME sends SRES to the network. The network compares this value with the value of SRES which it calculates for itself. The comparison of these SRES values provides the authentication. The value Kc is used by the ME in any future enciphered communications with the network until the next invocation of this mechanism. A subscriber authentication key Ki is used in this procedure. This key Ki has a length of 128 bits and is stored within the SIM for use in the algorithms described below.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
7.2 Algorithms and processes
The names and parameters of the algorithms supported by the SIM are defined in GSM 03.20 [11]. These are: - algorithm A3 to authenticate the MS to the network; ETSI ETSI TS 100 977 V6.3.0 (2000-05) 27 (GSM 11.11 version 6.3.0 Release 1997) - algorithm A8 to generate the encryption key. These algorithms may exist either discretely or combined (into A38) within the SIM. In either case the output on the SIM/ME interface is 12 bytes. The inputs to both A3 and A8, or A38, are Ki (128 bits) internally derived in the SIM, and RAND (128 bits) across the SIM/ME interface. The output is SRES (32 bits)/Kc (64 bits) the coding of which is defined in the command RUN GSM ALGORITHM in clause 9.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
7.3 File access conditions
Every file has its own specific access condition for each command. The relevant access condition of the last selected file shall be fulfilled before the requested action can take place. For each file: - the access conditions for the commands READ and SEEK are identical; - the access conditions for the commands SELECT and STATUS are ALWays. No file access conditions are currently assigned by GSM to the MF and the DFs. The access condition levels are defined in table 7. Table 7: Access condition level coding Level Access Condition 0 1 2 3 4 to 14 15 ALWays CHV1 CHV2 Reserved for GSM Future Use ADM NEVer The meaning of the file access conditions is as follows: ALWAYS: The action can be performed without any restriction; CHV1 (card holder verification 1): The action shall only be possible if one of the following three conditions is fulfilled: - a correct CHV1 value has already been presented to the SIM during the current session; - the CHV1 enabled/disabled indicator is set to "disabled"; NOTE: Some Phase 1 and Phase 2 SIMs do not necessarily grant access when CHV1 is "disabled" and "blocked". - UNBLOCK CHV1 has been successfully performed during the current session; CHV2: The action shall only be possible if one of the following two conditions is fulfilled: - a correct CHV2 value has already been presented to the SIM during the current session; - UNBLOCK CHV2 has been successfully performed during the current session; ADM: Allocation of these levels and the respective requirements for their fulfilment are the responsibility of the appropriate administrative authority. The definition of access condition ADM does not preclude the administrative authority from using ALW, CHV1, CHV2 and NEV if required. NEVER: The action cannot be performed over the SIM/ME interface. The SIM may perform the action internally. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 28 (GSM 11.11 version 6.3.0 Release 1997) Condition levels are not hierarchical. For instance, correct presentation of CHV2 does not allow actions to be performed which require presentation of CHV1. A condition level which has been satisfied remains valid until the end of the GSM session as long as the corresponding secret code remains unblocked, i.e. after three consecutive wrong attempts, not necessarily in the same card session, the access rights previously granted by this secret code are lost immediately. A satisfied CHV condition level applies to both DFGSM and DFTELECOM. The ME shall determine whether CHV2 is available by using the response to the STATUS command. If CHV2 is "not initialized" then CHV2 commands, e.g. VERIFY CHV2, shall not be executable.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8 Description of the functions
This clause gives a functional description of the commands and their respective responses. Associated status conditions, error codes and their corresponding coding are specified in clause 9. It shall be mandatory for all cards complying with the present document to support all functions described in the present document. The command GET RESPONSE which is needed for the protocol T=0 is specified in clause 9. The following table lists the file types and structures together with the functions which may act on them during a GSM session. These are indicated by an asterisk (*). Table 8: Functions on files in GSM session File Function MF DF EF transparent EF linear fixed EF cyclic SELECT * * * * * STATUS * * * * * READ BINARY * UPDATE BINARY * READ RECORD * * UPDATE RECORD * * SEEK * INCREASE * INVALIDATE * * * REHABILITATE * * *
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.1 SELECT
This function selects a file according to the methods described in clause 6. After a successful selection the record pointer in a linear fixed file is undefined. The record pointer in a cyclic file shall address the last record which has been updated or increased. Input: - file ID. Output: - if the selected file is the MF or a DF: - file ID, total memory space available, CHV enabled/disabled indicator, CHV status and other GSM specific data; - if the selected file is an EF: - file ID, file size, access conditions, invalidated/not invalidated indicator, structure of EF and length of the records in case of linear fixed structure or cyclic structure. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 29 (GSM 11.11 version 6.3.0 Release 1997)
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.2 STATUS
This function returns information concerning the current directory. A current EF is not affected by the STATUS function. It is also used to give an opportunity for a pro-active SIM to indicate that the SIM wants to issue a SIM Application Toolkit command to the ME. Input: - none. Output: - file ID, total memory space available, CHV enabled/disabled indicator, CHV status and other GSM specific data (identical to SELECT above).
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.3 READ BINARY
This function reads a string of bytes from the current transparent EF. This function shall only be performed if the READ access condition for this EF is satisfied. Input: - relative address and the length of the string. Output: - string of bytes.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.4 UPDATE BINARY
This function updates the current transparent EF with a string of bytes. This function shall only be performed if the UPDATE access condition for this EF is satisfied. An update can be considered as a replacement of the string already present in the EF by the string given in the update command. Input: - relative address and the length of the string; - string of bytes. Output: - none.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.5 READ RECORD
This function reads one complete record in the current linear fixed or cyclic EF. The record to be read is described by the modes below. This function shall only be performed if the READ access condition for this EF is satisfied. The record pointer shall not be changed by an unsuccessful READ RECORD function. Four modes are defined: CURRENT: The current record is read. The record pointer is not affected. ABSOLUTE: The record given by the record number is read. The record pointer is not affected. NEXT: The record pointer is incremented before the READ RECORD function is performed and the pointed record is read. If the record pointer has not been previously set within the selected EF, then READ RECORD (next) shall read the first record and set the record pointer to this record. If the record pointer addresses the last record in a linear fixed EF, READ RECORD (next) shall not cause the record pointer to be changed, and no data shall be read. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 30 (GSM 11.11 version 6.3.0 Release 1997) If the record pointer addresses the last record in a cyclic EF, READ RECORD (next) shall set the record pointer to the first record in this EF and this record shall be read. PREVIOUS: The record pointer is decremented before the READ RECORD function is performed and the pointed record is read. If the record pointer has not been previously set within the selected EF, then READ RECORD (previous) shall read the last record and set the record pointer to this record. If the record pointer addresses the first record in a linear fixed EF, READ RECORD (previous) shall not cause the record pointer to be changed, and no data shall be read. If the record pointer addresses the first record in a cyclic EF, READ RECORD (previous) shall set the record pointer to the last record in this EF and this record shall be read. Input: - mode, record number (absolute mode only) and the length of the record. Output: - the record.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.6 UPDATE RECORD
This function updates one complete record in the current linear fixed or cyclic EF. This function shall only be performed if the UPDATE access condition for this EF is satisfied. The UPDATE can be considered as a replacement of the relevant record data of the EF by the record data given in the command. The record pointer shall not be changed by an unsuccessful UPDATE RECORD function. The record to be updated is described by the modes below. Four modes are defined of which only PREVIOUS is allowed for cyclic files: CURRENT: The current record is updated. The record pointer is not affected. ABSOLUTE: The record given by the record number is updated. The record pointer is not affected. NEXT: The record pointer is incremented before the UPDATE RECORD function is performed and the pointed record is updated. If the record pointer has not been previously set within the selected EF, then UPDATE RECORD (next) shall set the record pointer to the first record in this EF and this record shall be updated. If the record pointer addresses the last record in a linear fixed EF, UPDATE RECORD (next) shall not cause the record pointer to be changed, and no record shall be updated. PREVIOUS: For a linear fixed EF the record pointer is decremented before the UPDATE RECORD function is performed and the pointed record is updated. If the record pointer has not been previously set within the selected EF, then UPDATE RECORD (previous) shall set the record pointer to the last record in this EF and this record shall be updated. If the record pointer addresses the first record in a linear fixed EF, UPDATE RECORD (previous) shall not cause the record pointer to be changed, and no record shall be updated. For a cyclic EF the record containing the oldest data is updated, the record pointer is set to this record and this record becomes record number 1. Input: - mode, record number (absolute mode only) and the length of the record; - the data used for updating the record. Output: - none. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 31 (GSM 11.11 version 6.3.0 Release 1997)
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.7 SEEK
This function searches through the current linear fixed EF to find a record starting with the given pattern. This function shall only be performed if the READ access condition for this EF is satisfied. Two types of SEEK are defined: Type 1 The record pointer is set to the record containing the pattern, no output is available. Type 2 The record pointer is set to the record containing the pattern, the output is the record number. NOTE: A Phase 1 SIM only executes type 1 of the SEEK function. The SIM shall be able to accept any pattern length from 1 to 16 bytes inclusive. The length of the pattern shall not exceed the record length. Four modes are defined: - from the beginning forwards; - from the end backwards; - from the next location forwards; - from the previous location backwards. If the record pointer has not been previously set (its status is undefined) within the selected linear fixed EF, then the search begins: - with the first record in the case of SEEK from the next location forwards; or - with the last record in the case of SEEK from the previous location backwards. After a successful SEEK, the record pointer is set to the record in which the pattern was found. The record pointer shall not be changed by an unsuccessful SEEK function. Input: - type and mode; - pattern; - length of the pattern. Output: - type 1: none; - type 2: status/record number.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.8 INCREASE
This function adds the value given by the ME to the value of the last increased/updated record of the current cyclic EF, and stores the result into the oldest record. The record pointer is set to this record and this record becomes record number 1. This function shall be used only if this EF has an INCREASE access condition assigned and this condition is fulfilled (see bytes 8 and 10 in the response parameters/data of the current EF, clause 9). The SIM shall not perform the increase if the result would exceed the maximum value of the record (represented by all bytes set to 'FF'). Input: - the value to be added. Output: - value of the increased record; - value which has been added. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 32 (GSM 11.11 version 6.3.0 Release 1997)
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.9 VERIFY CHV
This function verifies the CHV presented by the ME by comparing it with the relevant one stored in the SIM. The verification process is subject to the following conditions being fulfilled: - CHV is not disabled; - CHV is not blocked. If the access condition for a function to be performed on the last selected file is CHV1 or CHV2, then a successful verification of the relevant CHV is required prior to the use of the function on this file unless the CHV is disabled. If the CHV presented is correct, the number of remaining CHV attempts for that CHV shall be reset to its initial value 3. If the CHV presented is false, the number of remaining CHV attempts for that CHV shall be decremented. After 3 consecutive false CHV presentations, not necessarily in the same card session, the respective CHV shall be blocked and the access condition can never be fulfilled until the UNBLOCK CHV function has been successfully performed on the respective CHV. Input: - indication CHV1/CHV2, CHV. Output: - none.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.10 CHANGE CHV
This function assigns a new value to the relevant CHV subject to the following conditions being fulfilled: - CHV is not disabled; - CHV is not blocked. The old and new CHV shall be presented. If the old CHV presented is correct, the number of remaining CHV attempts for that CHV shall be reset to its initial value 3 and the new value for the CHV becomes valid. If the old CHV presented is false, the number of remaining CHV attempts for that CHV shall be decremented and the value of the CHV is unchanged. After 3 consecutive false CHV presentations, not necessarily in the same card session, the respective CHV shall be blocked and the access condition can never be fulfilled until the UNBLOCK CHV function has been performed successfully on the respective CHV. Input: - indication CHV1/CHV2, old CHV, new CHV. Output: - none.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.11 DISABLE CHV
This function may only be applied to CHV1. The successful execution of this function has the effect that files protected by CHV1 are now accessible as if they were marked "ALWAYS". The function DISABLE CHV shall not be executed by the SIM when CHV1 is already disabled or blocked. If the CHV1 presented is correct, the number of remaining CHV1 attempts shall be reset to its initial value 3 and CHV1 shall be disabled. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 33 (GSM 11.11 version 6.3.0 Release 1997) If the CHV1 presented is false, the number of remaining CHV1 attempts shall be decremented and CHV1 remains enabled. After 3 consecutive false CHV1 presentations, not necessarily in the same card session, CHV1 shall be blocked and the access condition can never be fulfilled until the UNBLOCK CHV function has been successfully performed on CHV1. Input: - CHV1. Output: - none.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.12 ENABLE CHV
This function may only be applied to CHV1. It is the reverse function of DISABLE CHV. The function ENABLE CHV shall not be executed by the SIM when CHV1 is already enabled or blocked. If the CHV1 presented is correct, the number of remaining CHV1 attempts shall be reset to its initial value 3 and CHV1 shall be enabled. If the CHV1 presented is false, the number of remaining CHV1 attempts shall be decremented and CHV1 remains disabled. After 3 consecutive false CHV1 presentations, not necessarily in the same card session, CHV1 shall be blocked and may optionally be set to "enabled". Once blocked, the CHV1 can only be unblocked using the UNBLOCK CHV function. If the CHV1 is blocked and "disabled", the access condition shall remain granted. If the CHV1 is blocked and "enabled", the access condition can never be fulfilled until the UNBLOCK CHV function has been successfully performed on CHV1. Input: - CHV1. Output: - none.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.13 UNBLOCK CHV
This function unblocks a CHV which has been blocked by 3 consecutive wrong CHV presentations. This function may be performed whether or not the relevant CHV is blocked. If the UNBLOCK CHV presented is correct, the value of the CHV, presented together with the UNBLOCK CHV, is assigned to that CHV, the number of remaining UNBLOCK CHV attempts for that UNBLOCK CHV is reset to its initial value 10 and the number of remaining CHV attempts for that CHV is reset to its initial value 3. After a successful unblocking attempt the CHV is enabled and the relevant access condition level is satisfied. If the presented UNBLOCK CHV is false, the number of remaining UNBLOCK CHV attempts for that UNBLOCK CHV shall be decremented. After 10 consecutive false UNBLOCK CHV presentations, not necessarily in the same card session, the respective UNBLOCK CHV shall be blocked. A false UNBLOCK CHV shall have no effect on the status of the respective CHV itself. Input: - indication CHV1/CHV2, the UNBLOCK CHV and the new CHV. Output: - none. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 34 (GSM 11.11 version 6.3.0 Release 1997)
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.14 INVALIDATE
This function invalidates the current EF. After an INVALIDATE function the respective flag in the file status shall be changed accordingly. This function shall only be performed if the INVALIDATE access condition for the current EF is satisfied. An invalidated file shall no longer be available within the application for any function except for the SELECT and the REHABILITATE functions unless the file status of the EF indicates that READ and UPDATE may also be performed. Input: - none. Output: - none.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.15 REHABILITATE
This function rehabilitates the invalidated current EF. After a REHABILITATE function the respective flag in the file status shall be changed accordingly. This function shall only be performed if the REHABILITATE access condition for the current EF is satisfied. If BDN is enabled (see clause 11.5.1) then the REHABILITATE function shall not rehabilitate the invalidated EFIMSI and EFLOCI until the PROFILE DOWNLOAD procedure is performed indicating that the ME supports the "Call control by SIM" facility (see GSM 11.14 [27]). Input: - none. Output: - none.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.16 RUN GSM ALGORITHM
This function is used during the procedure for authenticating the SIM to a GSM network and to calculate a cipher key. The card runs the specified algorithms A3 and A8 using a 16 byte random number and the subscriber authentication key Ki, which is stored in the SIM. The function returns the calculated response SRES and the cipher key Kc. The function shall not be executable unless DFGSM or any sub-directory under DFGSM has been selected as the Current Directory and a successful CHV1 verification procedure has been performed (see subclause 11.3.1). Input: - RAND. Output: - SRES, Kc. The contents of Kc shall be presented to algorithm A5 by the ME in its full 64 bit format as delivered by the SIM.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.17 SLEEP
This is an obsolete GSM function which was issued by Phase 1 MEs. The function shall not be used by an ME of Phase 2 or later. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 35 (GSM 11.11 version 6.3.0 Release 1997)
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.18 TERMINAL PROFILE
This function is used by the ME to transmit to the SIM its capabilities concerning the SIM Application Toolkit functionality. Input: - terminal profile. Output: - none.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.19 ENVELOPE
This function is used to transfer data to the SIM Application Toolkit applications in the SIM. Input: - data string. Output: - the structure of the data is defined in GSM 11.14 [27].
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.20 FETCH
This function is used to transfer an Application Toolkit command from the SIM to the ME. Input: - none. Output: - data string containing an SIM Application Toolkit command for the ME.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
8.21 TERMINAL RESPONSE
This function is used to transfer from the ME to the SIM the response to a previously fetched SIM Application Toolkit command. Input: - data string containing the response. Output: - none.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
9 Description of the commands
This clause states the general principles for mapping the functions described in clause 8 onto Application Protocol Data Units which are used by the transmission protocol.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
9.1 Mapping principles
An APDU can be a command APDU or a response APDU. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 36 (GSM 11.11 version 6.3.0 Release 1997) A command APDU has the following general format: CLA INS P1 P2 P3 Data The response APDU has the following general format: Data SW1 SW2 An APDU is transported by the T=0 transmission protocol without any change. Other protocols might embed an APDU into their own transport structure (ISO/IEC 7816-3 [26]). The bytes have the following meaning: - CLA is the class of instruction (ISO/IEC 7816-3 [26]), 'A0' is used in the GSM application; - INS is the instruction code (ISO/IEC 7816-3 [26]) as defined in this subclause for each command; - P1, P2, P3 are parameters for the instruction. They are specified in table 9. 'FF' is a valid value for P1, P2 and P3. P3 gives the length of the data element. P3='00' introduces a 256 byte data transfer from the SIM in an outgoing data transfer command (response direction). In an ingoing data transfer command (command direction), P3='00' introduces no transfer of data; - SW1 and SW2 are the status words indicating the successful or unsuccessful outcome of the command. For some of the functions described in clause 8 it is necessary for T=0 to use a supplementary transport service command (GET RESPONSE) to obtain the output data. For example, the SELECT function needs the following two commands: - the first command (SELECT) has both parameters and data serving as input for the function; - the second command (GET RESPONSE) has a parameter indicating the length of the data to be returned. If the length of the response data is not known beforehand, then its correct length may be obtained by applying the first command and interpreting the status words. SW1 shall be '9F' and SW2 shall give the total length of the data. Other status words may be present in case of an error. The various cases are: Case 1: No input / No output CLA INS P1 P2 P3 SW1 SW2 lgth (='00') '90' '00' Case 2: No input / Output of known length CLA INS P1 P2 P3 DATA with length lgth SW1 SW2 lgth '90' '00' NOTE: lgth='00' causes a data transfer of 256 bytes. Case 3: No Input / Output of unknown length CLA INS P1 P2 P3 SW1 SW2 lgth (='00') '9F' lgth1 GET RESPONSE CLA INS P1 P2 P3 DATA with length lgth2 ≤lgth1 SW1 SW2 lgth2 '90' '00' Case 4: Input / No output CLA INS P1 P2 P3 DATA with length lgth SW1 SW2 lgth '90' '00' ETSI ETSI TS 100 977 V6.3.0 (2000-05) 37 (GSM 11.11 version 6.3.0 Release 1997) Case 5: Input / Output of known or unknown length CLA INS P1 P2 P3 DATA with length lgth SW1 SW2 lgth '9F' lgth1 GET RESPONSE CLA INS P1 P2 P3 DATA with length lgth2 ≤lgth1 SW1 SW2 lgth2 '90' '00' For cases 3 and 5, when SW1/SW2 indicates there is response data (i.e. SW1/SW2 = '9FXX'), then, if the ME requires to get this response data, it shall send a GET RESPONSE command as described in the relevant case above. For case 5, in case of an ENVELOPE for SIM data download, SW1/SW2 may also indicate there is response data with the value '9EXX', and the ME shall then send a GET RESPONSE command to get this response data. If the GSM application is one of several applications in a multi-application card, other commands with CLA not equal to 'A0' may be sent by the terminal. This shall not influence the state of the GSM application. The following diagrams show how the five cases of transmission protocol identified in the above diagrams can all be used to send pro-active SIM commands. For further information on the diagrams below see GSM 11.14 [27]. Case 1: No input / "OK" response with no output, plus additional command from SIM CLA INS P1 P2 P3 SW1 SW2 lgth (='00') '91' lgth1 [Possible "normal GSM operation" command/response pairs] FETCH CLA INS P1 P2 P3 DATA with length lgth1 SW1 SW2 lgth1 '90' '00' NOTE: lgth1='00' causes a data transfer of 256 bytes. Case 2: No input / "OK" response with data of known length, plus additional command from SIM CLA INS P1 P2 P3 DATA with length lgth SW1 SW2 lgth '91' lgth1 [Possible "normal GSM operation" command/response pairs] FETCH CLA INS P1 P2 P3 DATA with length lgth1 SW1 SW2 lgth1 '90' '00' NOTE: lgth='00' causes a data transfer of 256 bytes. The same applies to lgth1. Case 3: No Input / "OK" response with data of unknown length, plus additional command from SIM CLA INS P1 P2 P3 SW1 SW2 lgth (='00') '9F' lgth1 GET RESPONSE CLA INS P1 P2 P3 DATA with length lgth2 ≤lgth1 SW1 SW2 lgth2 '91' lgth3 [Possible "normal GSM operation" command/response pairs] ETSI ETSI TS 100 977 V6.3.0 (2000-05) 38 (GSM 11.11 version 6.3.0 Release 1997) FETCH CLA INS P1 P2 P3 DATA with length lgth3 SW1 SW2 lgth3 '90' '00' Case 4: Input / "OK" response with no output data, plus additional command from SIM CLA INS P1 P2 P3 DATA with length lgth SW1 SW2 lgth '91' lgth1 [Possible "normal GSM operation" command/response pairs] FETCH CLA INS P1 P2 P3 DATA with length lgth1 SW1 SW2 lgth1 '90' '00' Case 5: Input / "OK" response with data of known or unknown length, plus additional command from SIM CLA INS P1 P2 P3 DATA with length lgth SW1 SW2 lgth '9F' lgth1 GET RESPONSE CLA INS P1 P2 P3 DATA with length lgth2≤lgth1 SW1 SW2 lgth2 '91' lgth3 [Possible "normal GSM operation" command/response pairs] FETCH CLA INS P1 P2 P3 DATA with length lgth3 SW1 SW2 lgth3 '90' '00'
7cb4fd1069780e5630834ee9b5bf2c49
100 977
9.2 Coding of the commands
Table 9 gives the coding of the commands. The direction of the data is indicated by (S) and (R), where (S) stands for data sent by the ME while (R) stands for data received by the ME. Offset is coded on 2 bytes where P1 gives the high order byte and P2 the low order byte. '00 00' means no offset and reading/updating starts with the first byte while an offset of '00 01' means that reading/updating starts with the second byte. In addition to the instruction codes specified in table 9 the following codes are reserved: GSM operational phase: '1X' with X even, from X=6 to X=E. Administrative management phase: '2A', 'D0', 'D2', 'DE', 'C4', 'C6', 'C8', 'CA', 'CC', 'B4', 'B6', 'B8', 'BA' and 'BC'. ETSI ETSI TS 100 977 V6.3.0 (2000-05) 39 (GSM 11.11 version 6.3.0 Release 1997) Table 9: Coding of the commands COMMAND INS P1 P2 P3 S/R SELECT 'A4' '00' '00' '02' S/R STATUS 'F2' '00' '00' lgth R READ BINARY 'B0' offset high offset low lgth R UPDATE BINARY 'D6' offset high offset low lgth S READ RECORD 'B2' rec No. mode lgth R UPDATE RECORD 'DC' rec No. mode lgth S SEEK 'A2' '00' type/mode lgth S/R INCREASE '32' '00' '00' '03' S/R VERIFY CHV '20' '00' CHV No. '08' S CHANGE CHV '24' '00' CHV No. '10' S DISABLE CHV '26' '00' '01' '08' S ENABLE CHV '28' '00' '01' '08' S UNBLOCK CHV '2C' '00' see note '10' S INVALIDATE '04' '00' '00' '00' - REHABILITATE '44' '00' '00' '00' - RUN GSM ALGORITHM '88' '00' '00' '10' S/R SLEEP 'FA' '00' '00' '00' - GET RESPONSE 'C0' '00' '00' lgth R TERMINAL PROFILE '10' '00' '00' lgth S ENVELOPE 'C2' '00' '00' lgth S/R FETCH '12' '00' '00' lgth R TERMINAL RESPONSE '14' '00' '00' lgth S NOTE: If the UNBLOCK CHV command applies to CHV1 then P2 is coded '00'; if it applies to CHV2 then P2 is coded '02'. Definitions and codings used in the response parameters/data of the commands are given in subclause 9.3.
7cb4fd1069780e5630834ee9b5bf2c49
100 977
9.2.1 SELECT
COMMAND CLASS INS P1 P2 P3 SELECT 'A0' 'A4' '00' '00' '02' Command parameters/data: Byte(s) Description Length 1 - 2 File ID 2 Response parameters/data in case of an MF or DF: Byte(s) Description Length 1 - 2 RFU 2 3 - 4 Total amount of memory of the selected directory which is not allocated to any of the DFs or EFs under the selected directory 2 5 - 6 File ID 2 7 Type of file (see subclause 9.3) 1 8 - 12 RFU 5 13 Length of the following data (byte 14 to the end) 1 14 - 34 GSM specific data 21 ETSI ETSI TS 100 977 V6.3.0 (2000-05) 40 (GSM 11.11 version 6.3.0 Release 1997) GSM specific data: Byte(s) Description Length 14 File characteristics (see detail 1) 1 15 Number of DFs which are a direct child of the current directory 1 16 Number of EFs which are a direct child of the current directory 1 17 Number of CHVs, UNBLOCK CHVs and administrative codes 1 18 RFU 1 19 CHV1 status (see detail 2) 1 20 UNBLOCK CHV1 status (see detail 2) 1 21 CHV2 status (see detail 2) 1 22 UNBLOCK CHV2 status (see detail 2) 1 23 RFU 1 24 - 34 Reserved for the administrative management 0 ≤lgth ≤11 Bytes 1 - 22 are mandatory and shall be returned by the SIM. Bytes 23 and following are optional and may not be returned by the SIM. NOTE 1: Byte 35 and following are RFU. NOTE 2: The STATUS information of the MF, DFGSM and DFTELECOM provide some identical application specific data, e.g. CHV status. On a multi-application card the MF should not contain any application specific data. Such data is obtained by terminals from the specific application directories. ME manufacturers should take this into account and therefore not use application specific data which may exist in the MF of a mono-application SIM. Similarly, the VERIFY CHV command should not be executed in the MF but in the relevant application directory (e.g. DFGSM). Detail 1: File characteristics b8 b7 b6 b5 b4 b3 b2 b1 Clock stop (see below) For running the authentication algorithm, or the ENVELOPE command for SIM Data Download, a frequency is required of at least 13/8 MHz if b2=0 and 13/4 MHz if b2=1 Clock stop (see below) for coding (see GSM 11.12 [28]) RFU b8=0: CHV1 enabled; b8=1: CHV1 disabled The coding of the conditions for stopping the clock is as follows: Bit b1 Bit b3 Bit b4 1 0 0 clock stop allowed, no preferred level 1 1 0 clock stop allowed, high level preferred 1 0 1 clock stop allowed, low level preferred 0 0 0 clock stop not allowed 0 1 0 clock stop not allowed, unless at high level 0 0 1 clock stop not allowed, unless at low level If bit b1 (column 1) is coded 1, stopping the clock is allowed at high or low level. In this case columns 2 (bit b3) and 3 (bit b4) give information about the preferred level (high or low, respectively) at which the clock may be stopped. If bit b1 is coded 0, the clock may be stopped only if the mandatory condition in column 2 (b3=1, i.e. stop at high level) or column 3 (b4=1, i.e. stop at low level) is fulfilled. If all 3 bits are coded 0, then the clock shall not be stopped. Detail 2: Status byte of a secret code ETSI ETSI TS 100 977 V6.3.0 (2000-05) 41 (GSM 11.11 version 6.3.0 Release 1997) b8 b7 b6 b5 b4 b3 b2 b1 Number of false presentations remaining ('0' means blocked) RFU b8=0: secret code not initialised, b8=1: secret code initialised Response parameters/data in case of an EF: Byte(s) Description Length 1 - 2 RFU 2 3 - 4 File size (for transparent EF: the length of the body part of the EF) (for linear fixed or cyclic EF: record length multiplied by the number of records of the EF) 2 5 - 6 File ID 2 7 Type of file (see 9.3) 1 8 see detail 3 1 9 - 11 Access conditions (see 9.3) 3 12 File status (see 9.3) 1 13 Length of the following data (byte 14 to the end) 1 14 Structure of EF (see 9.3) 1 15 Length of a record (see detail 4) 1 16 and following RFU - Bytes 1-14 are mandatory and shall be returned by the SIM. Byte 15 is mandatory in case of linear fixed or cyclic EFs and shall be returned by the SIM. Byte 15 is optional in case of transparent EFs and may not be returned by the SIM. Byte 16 and following (when defined) are optional and may not be returned by the SIM. Detail 3: Byte 8 For transparent and linear fixed EFs this byte is RFU. For a cyclic EF all bits except bit 7 are RFU; b7=1 indicates that the INCREASE command is allowed on the selected cyclic file. Detail 4: Byte 15 For cyclic and linear fixed EFs this byte denotes the length of a record. For a transparent EF, this byte shall be coded '00', if this byte is sent by the SIM.