FreeCalypso > hg > fc-sim-tools
annotate doc/Sysmocom-SIM-notes @ 40:8f505d413815
serial: full baud/spenh argument parsing implemented
| author | Mychaela Falconia <falcon@freecalypso.org> | 
|---|---|
| date | Sat, 20 Mar 2021 20:23:24 +0000 | 
| parents | da6e9d0b2ee6 | 
| children | b9fc7022f9ac | 
| rev | line source | 
|---|---|
| 18 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 1 The present suite of tools (fc-simtool and fc-uicc-tool) is NOT a good fit for | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 2 programming sysmoUSIM-SJS1 and sysmoISIM-SJA2 cards made by Sysmocom and sold | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 3 in their webshop, because of the following combination of factors: | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 4 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 5 1) These cards are primarily USIM/ISIM, with classic GSM 11.11 SIM support | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 6 regarded as "backward compatibility" - thus they have a lot of important | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 7 files under ADF.USIM and ADF.ISIM which are not accessible via the classic | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 8 GSM 11.11 SIM protocol. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 9 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 10 2) Our main feature-rich tool is fc-simtool, but this tool speaks only the | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 11 classic GSM 11.11 SIM protocol, hence it cannot access any of the USIM/ISIM | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 12 files. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 13 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 14 3) We have fc-uicc-tool which speaks the UICC protocol that is native to these | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 15 Sysmocom cards, but it is only a low-level debug tool, not a feature match | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 16 to fc-simtool. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 17 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 18 The proper long-term solution for our 2G-centric GSM community is to get our own | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 19 SIMs made, either by paying big bucks to Sysmocom to produce a run of custom | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 20 cards (presumably based on their current SJA2 platform) with USIM and ISIM | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 21 removed, leaving only the file system tree under MF that can be fully | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 22 manipulated via the classic SIM protocol, or preferably by resurrecting the | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 23 older Grcard SIM-only platform if possible - it may take a long time to find out | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 24 if the latter option is possible or not. But in the meantime, if someone needs | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 25 to program a SIM right now, when Sysmocom webshop cards are the only available | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 26 option, we do have limited support for programming these SIMs: | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 27 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 28 * It is possible to authenticate with the ADM1 key from within fc-simtool on | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 29 both sysmoUSIM-SJS1 and sysmoISIM-SJA2, as explained below. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 30 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 31 * Once you have authenticated with ADM1, you can use fc-simtool admin write | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 32 commands (write-imsi, SDN phonebook write operations, manual update-bin-imm | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 33 on various small transparent EFs) just as if you were working with a Grcard | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 34 SIM. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 35 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 36 * You can also use fc-uicc-tool to access and program every file on Sysmocom | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 37 cards, including files under ADF.USIM and ADF.ISIM - but in this case you will | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 38 have to do everything manually in raw hex, with a hex data file for every | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 39 update-bin and update-rec command. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 40 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 41 Authenticating with ADM1 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 42 ======================== | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 43 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 44 The method for sending your ADM1 key to the card varies depending on whether | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 45 you are in an fc-simtool or fc-uicc-tool session, and whether your card is | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 46 sysmoUSIM-SJS1 or sysmoISIM-SJA2. There are 3 possibilities: | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 47 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 48 * If you are in an fc-uicc-tool session with either type of card, the command | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 49 to authenticate with ADM1 is as follows: | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 50 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 51 verify-pin 10 xxxxxxxx | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 52 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 53 where xxxxxxxx are the 8 digits of the ADM1 secret code. There are no | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 54 restrictions as to when this command may be given in an fc-uicc-tool session. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 55 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 56 * If you are in an fc-simtool session with sysmoISIM-SJA2, the command becomes: | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 57 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 58 verify-ext 10 xxxxxxxx | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 59 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 60 There are no restrictions as to when this command may be given in an | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 61 fc-simtool session. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 62 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 63 * If you are in an fc-simtool session with sysmoUSIM-SJS1, the command becomes: | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 64 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 65 verify-sjs1-adm1 xxxxxxxx | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 66 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 67 Unlike the other two cases, this command must be issued at the very beginning | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 68 of your fc-simtool session, before any other commands. If you issue this | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 69 command later, after some GSM 11.11 SIM APDUs have already been exchanged, it | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 70 won't work. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 71 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 72 Changing the ADM1 PIN | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 73 ===================== | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 74 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 75 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 | 76 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 | 77 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 | 78 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 79 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 | 80 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 81 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 | 82 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 | 83 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 | 84 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 | 85 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 | 86 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 87 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 | 88 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 | 89 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 | 90 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 | 91 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 92 Thoughts on card (re)formatting | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 93 =============================== | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 94 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 95 ETSI and 3GPP specs give many more degrees of freedom to SIM card issuers than | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 96 just the content of various EFs: the card issuer gets to decide which DFs and | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 97 EFs will be present vs. which ones won't be present at all, and for many EFs | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 98 the size (allocated space) is variable per the specs and up to the card issuer. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 99 In the case of record-based EFs, both the record size and the number of records | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 100 are often left up to card issuers to tune as desired. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 101 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 102 In the Mother's opinion, a truly programmable SIM would be one where every | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 103 downstream owner of each card (not just the initial factory or the party putting | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 104 up big bucks for a large custom production run) can do a full reformat: erase | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 105 the file system and then create whatever tree of DFs and EFs she desires, with | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 106 full control over each file's allocated size, structure and access conditions. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 107 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 108 In the case of Sysmocom webshop SIMs, we (FreeCalypso) are not aware of any | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 109 publicly available documents describing how to perform such a reformat - it | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 110 appears that Sysmocom keeps this knowledge proprietary. In contrast, the older | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 111 Grcard-based SIMs had some publicly documented commands for erasing the card | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 112 and creating new directories and files: | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 113 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 114 https://osmocom.org/projects/cellular-infrastructure/wiki/GrcardSIM | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 115 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 116 It remains to be seen whether we (FreeCalypso) can get new SIMs from Grcard | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 117 which are also freely formattable. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 118 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 119 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 | 120 =================================================== | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 121 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 122 Referring to the previous section regarding formatting degrees of freedom, | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 123 Sysmocom webshop cards have their EF_MSISDN file allocated as 6 records of 34 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 124 bytes each. Record length of 34 bytes translates into 20 bytes of alpha tag | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 125 plus the required 14-byte structure at the end of each record. | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 126 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 127 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 | 128 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 | 129 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 | 130 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 | 131 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 | 132 record size of 34 bytes: | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 133 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 134 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 | 135 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 | 136 20: FF FF | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 137 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 138 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 | 139 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 | 140 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 | 141 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 | 142 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 | 143 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 144 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 | 145 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 | 146 20: FF FF | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 147 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 148 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 | 149 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 | 150 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 | 151 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 | 152 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 | 153 | 
| 
da6e9d0b2ee6
data, doc, scripts: import from previous fc-pcsc-tools repo
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 154 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 | 155 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 | 156 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 | 157 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 | 158 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 | 159 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 | 160 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 | 161 EF_MSISDN is writable without needing ADM1 - it only needs CHV1. | 
