annotate doc/GrcardSIM2-WEKI-file @ 207:fc0ab2b0c56e

doc/Low-level-commands: fill byte argument is always hex
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 07 Mar 2021 05:23:10 +0000
parents c804f2f8c138
children 8c151bb01d28
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
196
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 GrcardSIM2 cards have a proprietary EF under DF_GSM with file ID 0x0001;
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 Osmocom wiki page for this card model gives EF.WEKI as the name for this
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 proprietary file. We (FreeCalypso) have no idea as to where this name came
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 from, and where and how the people who wrote that wiki page (Sysmocom staff or
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 not - unknown) got this knowledge. This file is important because it stores Ki
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 and the selection of COMP128 algorithm version, but the same file also appears
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 to have other fields serving other purposes which are not currently understood.
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 The total length of this transparent EF is 35 bytes, out of which only the first
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 19 bytes are documented in the Osmocom wiki page and written by their pySim-prog
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 tool. Let us now break down this file according to our currently available
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 limited understanding:
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 * The first two bytes are always 00 10 - these byte values appear in "blank"
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 unprogrammed cards as shipped by Grcard, they also appear in the Osmocom wiki
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 page, and are programmed by pySim-prog. The purpose and meaning of these two
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 bytes are completely unknown, and we have never tried writing anything
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 different into them.
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 * The next byte gives COMP128 algorithm selection plus something else that is
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 not understood:
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 - The low nibble of this byte selects COMP128 algorithm version as follows:
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 0 = COMP128v1
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 1 = COMP128v2
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 2 = COMP128v3
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 Note that the Osmocom wiki page is wrong in its description of this nibble:
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 setting this nibble to 3 ends up selecting COMP128v2 rather than v3.
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 (pySim-prog is unaffected because it always writes 0 for COMP128v1.)
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 - The high nibble of this byte is not understood. Osmocom wiki page tells
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 people to write 0 into this nibble and so does pySim-prog, but the "blank"
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 unprogrammed cards we got from Grcard have it set to 2. Setting this nibble
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 to either 0 or 2 does not seem to affect the result of RUN GSM ALGORITHM
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 operations, thus it probably controls something else.
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 * The next 16 bytes store Ki - this part is straightforward.
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 * The last 16 bytes are not understood; our "blank" unprogrammed cards from
c804f2f8c138 doc/GrcardSIM2-WEKI-file article written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 Grcard have all FFs in these bytes.