FreeCalypso > hg > fc-sim-tools
annotate doc/Sysmocom-SIM-notes @ 56:b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 22 Mar 2021 21:30:42 +0000 |
parents | da6e9d0b2ee6 |
children | 6ccc4d952830 |
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 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
56 integrated support for this database into fc-simtool. (Replicating the same |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
57 functionality in fc-uicc-tool, as would be appropriate for these UICC-native |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
58 cards, is on the to-do list.) |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
59 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
60 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
|
61 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
|
62 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
|
63 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
|
64 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
65 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
|
66 base64. |
18
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 |
56
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
68 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
|
69 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
|
70 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
|
71 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
|
72 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
|
73 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
|
74 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
|
75 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
|
76 block in the batch. |
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 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
|
79 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
80 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
|
81 |
56
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
82 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
|
83 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
84 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
|
85 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
|
86 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
|
87 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
|
88 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
89 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
|
90 ================================================== |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
91 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
92 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
|
93 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
|
94 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
|
95 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
|
96 |
56
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
97 verify-ext 10 xxxxxxxx |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
98 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
99 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
|
100 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
|
101 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
102 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
|
103 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
|
104 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
|
105 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
|
106 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
107 sws-auth-adm1 |
18
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 |
56
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
109 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
|
110 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
|
111 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
|
112 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
|
113 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
114 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
|
115 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
116 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
|
117 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
|
118 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
|
119 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
|
120 |
56
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
121 sysmoUSIM-SJS1 difference |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
122 ========================= |
18
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 |
56
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
124 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
|
125 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
|
126 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
|
127 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
|
128 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
|
129 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
|
130 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
|
131 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
|
132 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
|
133 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
|
134 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
|
135 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
|
136 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
|
137 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
|
138 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
|
139 |
56
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
140 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
|
141 requires is as follows: |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
142 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
143 verify-sjs1-adm1 xxxxxxxx |
18
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 |
56
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
145 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
|
146 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
|
147 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
|
148 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
|
149 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
|
150 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
|
151 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
|
152 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
|
153 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
|
154 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
|
155 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
|
156 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
|
157 |
56
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
158 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
|
159 ============================================== |
18
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 |
56
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
161 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
|
162 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
|
163 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
|
164 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
|
165 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
|
166 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
|
167 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
|
168 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
|
169 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
|
170 |
56
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
171 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
|
172 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
|
173 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
|
174 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
|
175 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
|
176 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
|
177 would be more appropriate. |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
178 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
179 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
|
180 ================================================= |
18
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 |
56
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
182 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
|
183 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
|
184 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
185 verify-pin 10 xxxxxxxx |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
186 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
187 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
|
188 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
|
189 |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
190 sws-auth-* commands have not been ported over fc-uicc-tool yet, but this |
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
191 omission will be easy to fill. |
18
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
192 |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 Changing the ADM1 PIN |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
194 ===================== |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
195 |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
196 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
|
197 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
|
198 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
|
199 |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
200 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
|
201 |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
202 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
|
203 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
|
204 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
|
205 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
|
206 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
|
207 |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 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
|
209 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
|
210 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
|
211 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
|
212 |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 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
|
214 =================================================== |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 |
56
b9fc7022f9ac
doc/Sysmocom-SIM-notes: update for current situation
Mychaela Falconia <falcon@freecalypso.org>
parents:
18
diff
changeset
|
216 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
|
217 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
|
218 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
|
219 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
|
220 |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
221 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
|
222 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
|
223 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
|
224 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
|
225 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
|
226 record size of 34 bytes: |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 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
|
229 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
|
230 20: FF FF |
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 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
|
233 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
|
234 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
|
235 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
|
236 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
|
237 |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 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
|
239 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
|
240 20: FF FF |
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 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
|
243 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
|
244 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
|
245 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
|
246 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
|
247 |
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 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
|
249 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
|
250 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
|
251 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
|
252 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
|
253 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
|
254 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
|
255 EF_MSISDN is writable without needing ADM1 - it only needs CHV1. |