annotate doc/Sysmocom-SIM-notes @ 95:c06c0e2da24c

fc-simtool terminal-resp command implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 21 Apr 2021 06:40:33 +0000
parents 6ccc4d952830
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
1 The current programmable SIM card model sold by Sysmocom in their webshop
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
2 (sysmoISIM-SJA2) is probably good for people who run their own cellular networks
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
3 of the LTE/5G kind, but it is NOT a good choice for those of us who are only
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
4 interested in GSM/2G, to the exclusion of all later G's:
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
5
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
6 * The triple-cut physical form factor is inferior (compared to solid-piece 2FF
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
7 without 3FF or 4FF cuts) for use in classic GSM/2G phones with 2FF SIM
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
8 sockets.
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
9
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
10 * The presence of unwanted USIM and ISIM applications with their associated
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
11 ADF.USIM and ADF.ISIM file systems is very unpleasant: it forces us to either
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
12 study up on completely unwanted-to-us USIM and ISIM specs and program all
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
13 those files to something sensible (and just what would be sensible programming
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
14 of USIM and ISIM files for a 2G-only network that exists solely to provide
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
15 service to classic GSM/2G phones?), plus expend oodles of time and effort to
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
16 develop the necessary programming tools that can write all those files under
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
17 ADF.USIM and ADF.ISIM, or leave all those files unprogrammed, and take a
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
18 gamble if someone sticks the partially-programmed card (classic SIM
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
19 programmed, USIM and ISIM left unprogrammed) into a phone that knows about
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
20 USIM and/or ISIM.
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
22 * Some of the advertising which Sysmocom prints on their current webshop cards,
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
23 plus the very name sysmoISIM (emphasizing and glorifying ISIM rather than
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
24 plain SIM) is offensive at least to me (Mother Mychaela), and should be
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
25 offensive to any truly devoted lover of classic GSM/2G technology.
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
27 Because of the above considerations, we (FreeCalypso) are currently in the
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
28 process of getting our own community SIMs made, to serve as an alternative to
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
29 Sysmocom webshop product. Our FreeCalypso community SIMs are currently as of
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
30 this writing (2021-03) being made for us by Grcard in China, they are a GSM-only
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
31 SIM card model (GrcardSIM2) without USIM/ISIM (they don't speak UICC protocol
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
32 at all, yay!), and we are having them made in a 2FF-only cut, meaning that the
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
33 2FF piece is fully solid.
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
35 However, despite our general dislike of Sysmocom's current USIM/ISIM-centric
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
36 product and our ongoing effort to produce a GSM/2G-centric alternative, we do
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
37 have some support in FC SIM tools for Sysmocom's current sysmoISIM-SJA2 card
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
38 and for their previous sysmoUSIM-SJS1 model. This limited support exists
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
39 because these webshop cards are very readily and inexpensively available, and
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
40 because of natural human curiosity - we've been playing with these readily
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
41 available Sysmocom webshop cards while enduring the long delays involved in our
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
42 Grcard-based quest for a better alternative.
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
43
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
44 Sysmocom webshop card database
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
45 ==============================
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
47 Whenever you buy a 10-pack of sysmoUSIM-SJS1 or sysmoISIM-SJA2 cards from
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
48 Sysmocom webshop, they send you an email with per-card identities and keys.
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
49 The information in that email is essential for doing any kind of admin writes
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
50 to the cards (the necessary ADM1 key is randomly assigned per card), and also
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
51 for any CHV2 operations: the randomly assigned PIN1 and PUK1 are printed on the
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
52 plastic, but not PIN2 or PUK2, which are also randomly assigned.
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
53
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
54 To reduce the need for manual lookups in email data, we have implemented a tool
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
55 that converts Sysmocom webshop emails into our own database format, and we have
62
6ccc4d952830 doc/Sysmocom-SIM-notes: sws-* command updates
Mychaela Falconia <falcon@freecalypso.org>
parents: 56
diff changeset
56 integrated support for this database into fc-simtool and fc-uicc-tool.
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
57
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
58 Sysmocom webshop emails with USIM/ISIM card key material feature a MIME
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
59 multipart/alternative structure with text/plain and text/html parts, with each
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
60 part further encoded in base64. To extract the bits of interest and convert
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
61 them into our sws-card-db format, follow these steps:
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
62
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
63 1) Extract the text/plain portion from the MIME structure and decode it from
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
64 base64.
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
66 2) Open the extracted and decoded text/plain email portion in your favourite
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
67 text editor and find the heading block of 19 lines, beginning with a line
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
68 that reads "IMSI" and ending with a line that reads "KIK3". (If you bought
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
69 the cheaper option without ADM and OTA keys, there will only be 9 lines here,
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
70 starting with IMSI and ending with OPC.) Then there should be a blank line,
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
71 followed by 19 lines of data per card (or 9 lines for sans-ADM/OTA variant),
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
72 with blank lines separating each card data block from the next. Extract the
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
73 portion beginning with the heading block and ending with the last card data
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
74 block in the batch.
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
75
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
76 3) Feed the data extract from the previous step to our sws-email2db utility.
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
77
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
78 sms-email2db sends its output to stdout, thus you should run it like this
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
80 sws-email2db email_extract.txt >> /opt/freecalypso/sim-data/sws-card-db
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
81
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
82 If you have bought multiple card batches from Sysmocom over the years, you will
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
83 need to collect those old emails and repeat the extraction procedure for each of
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
84 them, using the '>>' form of output redirection to gather all data in one
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
85 sws-card-db file. Edit the finished database file with vi if necessary.
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
86
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
87 Using fc-simtool to program Sysmocom webshop cards
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
88 ==================================================
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
89
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
90 Even though it is a UICC-native card that clearly prefers being admin-programmed
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
91 via the UICC protocol, sysmoISIM-SJA2 allows its ADM1 PIN to be entered in a
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
92 GSM 11.11 SIM protocol session with a VERIFY CHV command with P2=0x0A.
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
93 Therefore, the command to enter sysmoISIM-SJA2 ADM1 manually in fc-simtool is:
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
95 verify-ext 10 xxxxxxxx
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
96
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
97 Unlike the situation with sysmoUSIM-SJS1 (see below), there are no restrictions
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
98 as to when this command may be given in an fc-simtool session.
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
99
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
100 The above is the manual command, requiring the operator to manually look up the
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
101 correct ADM1 key for the card being programmed. However, if you have your
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
102 sws-card-db file initialized with data from email per above instructions, you
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
103 can authenticate with ADM1 as simply as:
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
104
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
105 sws-auth-adm1
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
107 This command reads the ICCID record from the card (totally immutable on SJA2
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
108 cards, and always readable without depending on CHV1 status), looks up this
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
109 ICCID in sws-card-db, and sends a VERIFY CHV P2=0x0A command to the card with
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
110 ADM1 extracted from the card db record.
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
111
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
112 The following additional commands are available that work in a similar manner:
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
113
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
114 sws-auth-pin1 -- send VERIFY CHV1 with PIN1 from sws-card-db
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
115 sws-auth-pin2 -- send VERIFY CHV2 with PIN2 from sws-card-db
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
116 sws-pin1-disable -- send DISABLE CHV with PIN1 from sws-card-db
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
117 sws-pin1-enable -- send ENABLE CHV with PIN1 from sws-card-db
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118
62
6ccc4d952830 doc/Sysmocom-SIM-notes: sws-* command updates
Mychaela Falconia <falcon@freecalypso.org>
parents: 56
diff changeset
119 There is also a generic sws-lookup command that looks up arbitrary sws-card-db
6ccc4d952830 doc/Sysmocom-SIM-notes: sws-* command updates
Mychaela Falconia <falcon@freecalypso.org>
parents: 56
diff changeset
120 fields for the current card - examples:
6ccc4d952830 doc/Sysmocom-SIM-notes: sws-* command updates
Mychaela Falconia <falcon@freecalypso.org>
parents: 56
diff changeset
121
6ccc4d952830 doc/Sysmocom-SIM-notes: sws-* command updates
Mychaela Falconia <falcon@freecalypso.org>
parents: 56
diff changeset
122 sws-lookup puk1 -- look up and display PUK1 for this card
6ccc4d952830 doc/Sysmocom-SIM-notes: sws-* command updates
Mychaela Falconia <falcon@freecalypso.org>
parents: 56
diff changeset
123 sws-lookup ki opc -- look up and display Ki and OPc for this card
6ccc4d952830 doc/Sysmocom-SIM-notes: sws-* command updates
Mychaela Falconia <falcon@freecalypso.org>
parents: 56
diff changeset
124
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
125 sysmoUSIM-SJS1 difference
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
126 =========================
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
128 Both sysmoUSIM-SJS1 and sysmoISIM-SJA2 are UICC-native cards, and both really
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
129 prefer to be admin-programmed via the UICC protocol, rather than GSM 11.11 SIM
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
130 protocol. Both cards do allow ADM1 authentication to be performed in a GSM
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
131 11.11 SIM protocol session, but sysmoUSIM-SJS1 is less "happy" about it, and
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
132 imposes a more burdensome restriction. sysmoISIM-SJA2 allows its ADM1 key to
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
133 be submitted via a VERIFY CHV (CLA=A0, P2=0A) APDU in a GSM 11.11 SIM session,
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
134 but sysmoUSIM-SJS1 does not allow the same. sysmoUSIM-SJS1 accepts its ADM1 key
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
135 only via UICC-style (CLA=00) VERIFY PIN APDUs, thus at first it appears that
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
136 these cards cannot be admin-programmed via the classic GSM 11.11 SIM protocol.
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
137 They do have one open loophole, however: if the UICC-style VERIFY PIN command
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
138 for ADM1 is sent as the very first command in a card session, it can be followed
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
139 by other UICC protocol commands (making a regular UICC session), or it can be
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
140 followed by GSM 11.11 SIM protocol commands with CLA=A0, thus allowing one
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
141 special exception to the general rule which prohibits mixing these two protocols
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
142 in the same card session.
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
144 Our fc-simtool command for sending SJS1 ADM1 keys in the manner this card model
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
145 requires is as follows:
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
146
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
147 verify-sjs1-adm1 xxxxxxxx
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
149 The really big restriction is that this command must be issued at the very
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
150 beginning of your fc-simtool session, before any other commands. If you issue
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
151 this command later, after some GSM 11.11 SIM APDUs have already been exchanged,
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
152 it won't work. For this reason, our sws-auth-adm1 "macro" command cannot be
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
153 used in fc-simtool with SJS1 cards: in order to use sws-card-db, one has to read
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
154 the ICCID record to identify the specific card out of the pool, and once some
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
155 APDUs have been exchanged to make that ICCID read, the special exception to the
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
156 protocol mixing prohibition is no longer available. One could develop a more
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
157 complicated system where you read the ICCID, then reset the card and have a new
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
158 card session beginning with ADM1 authentication - but because this
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
159 sysmoUSIM-SJS1 card model is no longer sold by Sysmocom, there is no
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
160 justification for expending the effort.
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
162 Using fc-uicc-tool with Sysmocom webshop cards
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
163 ==============================================
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
165 The UICC protocol is native to both sysmoUSIM-SJS1 and sysmoISIM-SJA2, thus
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
166 fc-uicc-tool works like a charm with both card models. The problem, however,
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
167 is that fc-uicc-tool is only a low-level debug and manual tinkering tool: it
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
168 can do "everything", but only 100% manually in raw hex. Most of the high-level
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
169 functions of fc-simtool are not replicated in fc-uicc-tool, and furthermore, an
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
170 approach of mindlessly translating fc-simtool high-level functions to use the
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
171 UICC protocol for card file access won't work either: the USIM spec definition
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
172 of many important files is quite different from the original DF_GSM and
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
173 DF_TELECOM definitions for classic SIM.
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
175 The issue is ultimately one of project purpose and direction: FreeCalypso
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
176 focuses on GSM/2G to the exclusion of later G's, our preferred SIM cards are
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
177 our own FCSIM1, our primary SIM card manipulation tool is fc-simtool, and
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
178 fc-uicc-tool exists only as a bounded-effort side utility. For people who
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
179 prefer to work with USIM/ISIM cards natively, programming all of their new
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
180 files for later-G functionality, other software tool projects like pysim-shell
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
181 would be more appropriate.
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
182
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
183 ADM1 and other PIN authentication in fc-uicc-tool
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
184 =================================================
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
186 If you are in an fc-uicc-tool session with either sysmoUSIM-SJS1 or
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
187 sysmoISIM-SJA2, the command to authenticate with ADM1 is as follows:
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
188
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
189 verify-pin 10 xxxxxxxx
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
190
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
191 where xxxxxxxx are the 8 digits of the ADM1 secret code. There are no
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
192 restrictions as to when this command may be given in an fc-uicc-tool session.
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
193
62
6ccc4d952830 doc/Sysmocom-SIM-notes: sws-* command updates
Mychaela Falconia <falcon@freecalypso.org>
parents: 56
diff changeset
194 sws-auth-* and sws-lookup commands work in fc-uicc-tool exactly the same way as
6ccc4d952830 doc/Sysmocom-SIM-notes: sws-* command updates
Mychaela Falconia <falcon@freecalypso.org>
parents: 56
diff changeset
195 in fc-simtool.
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 Changing the ADM1 PIN
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 =====================
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200 Experiments show that when speaking the UICC protocol to the card, the standard
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 CHANGE PIN command does work on ADM1 on both sysmoUSIM-SJS1 and sysmoISIM-SJA2,
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202 thus you can do the following in fc-uicc-tool:
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 change-pin 10 old-ADM1 new-ADM1
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 However, given that Sysmocom already assigns individual per-card random ADM1 and
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 communicates these secret codes securely to webshop customers, there does not
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 seem to be any practical need for changing ADM1 further downstream. Thus our
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 recommendation is that if you are going to change your ADM1 PIN just to prove
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 that you can do it, you should then change it back to the original.
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 We can only surmise that there probably exist some secret commands that can
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213 reset PUK1 and PUK2 after you've authenticated with ADM1, but they will probably
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 remain forever proprietary to Sysmocom, especially given the lack of any
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215 practical need for such downstream changing of PUK1/PUK2.
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 MSISDN misprogramming on early sysmoUSIM-SJS1 cards
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 ===================================================
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219
56
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
220 Sysmocom webshop cards (both sysmoUSIM-SJS1 and sysmoISIM-SJA2) have their
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
221 EF_MSISDN file allocated as 6 records of 34 bytes each. Record length of 34
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
222 bytes translates into 20 bytes of alpha tag plus the required 14-byte structure
b9fc7022f9ac doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents: 18
diff changeset
223 at the end of each record.
18
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225 When Sysmocom made their early sysmoUSIM-SJS1 cards, they intended to program
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 the first record of EF_MSISDN as +882110xxxxx, where xxxxx are equal to the last
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227 5 digits of their 901-70 IMSI and also to the last 5 content digits (before the
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 Luhn check digit) of their 8988211 ICCID. A correctly structured EF_MSISDN
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229 phonebook record with a +882110xxxxx phone number would look like this, for the
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230 record size of 34 bytes:
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232 00: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 10: FF FF FF FF 07 91 88 12 01 xx xx Fx FF FF FF FF
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234 20: FF FF
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236 The first 20 bytes are all FF because that is the space reserved for the alpha
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237 tag, then the phone number is encoded in 8 bytes as 07 91 88 12 01 xx xx Fx,
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 and the rest of the required 14-byte structure is filled with FF bytes.
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239 However, the actual programming of this MSISDN record on early sysmoUSIM-SJS1
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 cards (at least on the 10-pack I bought in 2017) looks like this:
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242 00: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243 10: FF FF 07 91 88 12 01 xx xx Fx FF FF FF FF FF FF
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244 20: FF FF
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246 The not-all-FF field of 8 bytes is written into the wrong location, two bytes
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 earlier than where it should be. When I saw this misprogramming early in the
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 course of developing fc-simtool, I finally understood why the AT+CNUM command
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249 on a FreeCalypso modem with this SIM inserted reported a 10xxxxx number instead
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 of the +882110xxxxx listed in the sysmoUSIM manual. :-)
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252 When I saw this misprogramming, I also added a fix-sysmo-msisdn command to
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253 fc-simtool: this command checks for this particular misprogramming, and if it
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 finds such, it rewrites the MSISDN record with the 8-byte phone number field
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255 moved to its correct place. However, this fix-sysmo-msisdn command probably
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256 won't get much use: the factory-programmed EF_MSISDN is now completely blank on
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257 Sysmocom's current sysmoISIM-SJA2 cards, and also on the late sysmoUSIM-SJS1
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 cards - or at least it is blank on the last-stock cards I bought in 2020-11.
da6e9d0b2ee6 data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259 EF_MSISDN is writable without needing ADM1 - it only needs CHV1.