Project

General

Profile

Actions

Bug #6485

open

pySim-shell: cannot read MF/EF_ICCID for a pure SIM card

Added by fixeria 11 days ago.

Status:
New
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
06/10/2024
Due date:
% Done:

0%

Spec Reference:

Description

I stumbled upon a pure SIM card in my collection, for which I am unable to read ICCID using pySim-shell:

(env) fixeria@LEGION:/home/fixeria/projects/osmocom/pysim$ pySim-shell.py -p0 
Using reader PCSC[SCM Microsystems Inc. SCR 3310 [CCID Interface] (21120804300805) 00 00]
Waiting for card...
Info: Card is of type: SIM
Welcome to pySim-shell!
(C) 2021-2023 by Harald Welte, sysmocom - s.f.m.c. GmbH and contributors
Online manual available at https://downloads.osmocom.org/docs/pysim/master/html/shell.html

pySIM-shell (00:MF)> cardinfo 
Card info:
 Name: SIM
 ATR: 3b9e96801fc7803100731a211b66d0017b490d003a
 ICCID: None
 Class-Byte: a0
 Select-Ctrl: 0000
 AIDs:

pySIM-shell (00:MF)> select MF/EF.ICCID
EXCEPTION of type 'ValueError' occurred with message: Cannot select unknown file by name EF.ICCID, only hexadecimal 4 digit FID is allowed
To enable full traceback, run the following command: 'set debug true'

I can manually select the file by FID and read it as raw binary:

pySIM-shell (00:MF)> select 2fe2
{
    "file_descriptor": {
        "file_descriptor_byte": {
            "file_type": "working_ef",
            "structure": "transparent" 
        }
    },
    "proprietary_info": {},
    "file_id": "2fe2",
    "file_size": 10,
    "access_conditions": "0700",
    "life_cycle_status_int": "terminated" 
}
pySIM-shell (00:MF/EF.2FE2)> read_binary
98997757110141812920

pySim-read.py can also read ICCID just fine.

01:52 < fixeria> LaF0rge: the problem is that EF_ICCID is missing in files_in_mf[] for class CardProfileSIM
01:52 < LaF0rge> fixeria: ah, that should be easy to fix
01:52 < fixeria> LaF0rge: I can manually select the file (2fe2) and read it 
01:54 < fixeria> LaF0rge: we define EF_ICCID() in pySim/ts_102_221.py.  to fix the problem, we'll also need it in pySim/ts_51_011.py.  I think we should move the definition to some shared file.

pysim.git 0cb0e02c5cb6feaafe28a1ea291a5a7838f9d58e

No data to display

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)