Project

General

Profile

Actions

Bug #5451

closed

sysmoISIM-SJA2: EF.IMSConfigData - Failing on retrieve_tags command in pyshell with error - Command incompatible with file structure

Added by herlesupreeth about 2 years ago. Updated about 2 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
02/10/2022
Due date:
% Done:

100%

Spec Reference:
Tags:

Description

As per the spec. EF.IMSConfigData must be of type Structure: BER-TLV, but when trying to access/retrieve the tags in that EF I get the following error:

EXCEPTION of type 'SwMatchError' occurred with message: 'SW match failed! Expected 9000 and got 6981: Command not allowed - Command incompatible with file structure'

So I tried to read the EF via read_binary (by programming in pySim-read.py) and it was successful. So I am suspecting that file structure is Structure: transparent rather than Structure: BER-TLV. Could anyone please let me know where I could start looking for a fix to this issue?

Following my git log:

commit 6113fe99291605cd4a05416df1a3ef75d5493636 (HEAD -> upstream_master, upstream/master, gerrit/master)
Author: Harald Welte <>
Date: Fri Jan 21 15:51:35 2022 +0100

ts_51_011: Fix typo in EF_MMSUP
The TLV decoder class must be in self._tlv, not self.tlv
Change-Id: Ide6f6c823d5a16e375c324ba9bfa92e02c3b3c89

Thanks in advance

Actions #1

Updated by laforge about 2 years ago

  • Subject changed from EF.IMSConfigData - Failing on retrieve_tags command in pyshell with error - Command incompatible with file structure to sysmoISIM-SJA2: EF.IMSConfigData - Failing on retrieve_tags command in pyshell with error - Command incompatible with file structure
  • Status changed from New to Rejected
  • Assignee set to laforge
  • % Done changed from 0 to 100

Hi Supreeth,

can you share the IMSI of the card? This way we can determine the card profile version.

I have tried it with two cards: One with IMSI suffix 56259 (internally called ISIM-SJA2v2) and one with IMSI suffix 46728 (internally called ISIM-SJA2 or SJA2v1). The SJA2v2 has this bug fixed.

The file structure is part of the FCP which is returned when you select the file (structure transparent vs structure ber-tlv):

newer, correct card/profile:

pySIM-shell (MF/ADF.ISIM)> select EF.IMSConfigData 
{
    "file_descriptor": {
        "shareable": true,
        "file_type": "df",
        "structure": "ber_tlv" 
    },
    "file_identifier": "6FF8",
    "proprietary_info": {
        "available_memory": 298,
        "file_details": "01",
        "reserved_file_size": "012C",
        "maximum_file_size": "012C",
        "proprietary_D0": "30",
        "proprietary_D2": "0F" 
    },
    "life_cycle_status_int": "operational_activated",
    "security_attrib_ref_expanded": "6F0603",
    "file_size": 0,
    "short_file_id": "" 
}

older, incorrect card/profile:

pySIM-shell (MF/ADF.ISIM)> select EF.IMSConfigData 
{
    "file_descriptor": {
        "shareable": true,
        "file_type": "working_ef",
        "structure": "transparent" 
    },
    "file_identifier": "6FF8",
    "proprietary_info": {
        "proprietary_D0": "20",
        "proprietary_D2": "0F" 
    },
    "life_cycle_status_int": "operational_activated",
    "security_attrib_ref_expanded": "6F0603",
    "file_size": 255,
    "short_file_id": "" 
}

So this is a bug in older sysmoISIM-SJA2, not in pysim. Hence rejecting it here.

Actions #2

Updated by herlesupreeth about 2 years ago

Sure, IMSI: 901700000048260, ICCID: 8988211000000482607

For me its shows the following in pyshell

Using PC/SC reader interface
Waiting for card...
Autodetected card type: sysmoISIM-SJA2
Info: Card is of type: UICC-SIM
AIDs on card:
 USIM: a0000000871002ffffffff8907090000 (EF.DIR)
 ISIM: a0000000871004ffffffff8907090000 (EF.DIR)
 ARA-M: a00000015141434c00
Detected CardModel: SysmocomSJA2
Welcome to pySim-shell!
pySIM-shell (MF)> select ADF.ISIM 
{
    "file_descriptor": {
        "shareable": true,
        "file_type": "df",
        "structure": "no_info_given" 
    },
    "file_identifier": "FF01",
    "df_name": "A0000000871004FFFFFFFF8907090000",
    "proprietary_info": {
        "uicc_characteristics": "71",
        "available_memory": 100616
    },
    "life_cycle_status_int": "operational_activated",
    "security_attrib_compact": "00",
    "pin_status_template_do": "90017083010183018183010A83010B" 
}
pySIM-shell (MF/ADF.ISIM)> select EF.IMSConfigData 
{
    "file_descriptor": {
        "shareable": true,
        "file_type": "working_ef",
        "structure": "transparent" 
    },
    "file_identifier": "6FF8",
    "proprietary_info": {
        "proprietary_D0": "20",
        "proprietary_D2": "0F" 
    },
    "life_cycle_status_int": "operational_activated",
    "security_attrib_ref_expanded": "6F0603",
    "file_size": 255,
    "short_file_id": "" 
}
Actions #3

Updated by laforge about 2 years ago

herlesupreeth wrote in #note-2:

Sure, IMSI: 901700000048260, ICCID: 8988211000000482607

That's a sysmoISIM-SJA2v1, which does not yet support BER-TLV files. This was only introduced with the v2 in September 2021, as can be seen in the v2 changelog of the user manual, sorry :(

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)