Commit Graph

15 Commits

Author SHA1 Message Date
Philipp Maier de8db1c189 sysmo_isim_sja2: improve class model
In the current form we assume that the files that store the key material
and the related configuration parameters have the same layout for all
algorithms. This assumption makes sense since for the currently
supported algorithms (not TUAK) this is indeed true.

(With the exception that there may be RFU bits still set to 1, even
though the spec clearly state those bits should be 0. However, this does
not matter in practice)

With the advent of TUAK longer keys were introduced. This made a new file
layout necessary. Unfortunately this also means that we can not rely on
the coincidence described above. This means we have to be more specific
when reading and writing the files.

This patch adds classes to model the file layout for each algorithm.

We also print the key (and OP/OPc) for each location individually
(2g,3g,4g5g). Even though the programmed key should be the same in all
locations, this allows better diagnosis. Also with the advent of TUAK we
may have different key material in 4g5g location.

Related: SYS#6473
2023-06-23 12:36:43 +02:00
Philipp Maier b8c465a72d sysmo-isim-tool: allow selection of 4g5g auth algo individually
At the moment we set the algorithm type for 4g5g to the same algorithm
type we use for 3g. There is no way to select the algorithm type for
4g5g individually.

With the Advent of TUAK users might need to set the 4g5g algorithm to
TUAK and the Algorithm used for 3g to something else (e.g. Milenage). So
let's allow to select the algorithm for 4g5g individually, but only if
the user explicitly defines it.

Related: SYS#6473
2023-06-23 11:28:43 +02:00
Philipp Maier 86a6bb6ea5 tests: restore incorrect ADM PIN
The test data, which was submitted with the previous patch also
contained incorrect ADM PIN data, which was not intended. This patch
fixes this.

Related: SYS#6473
2023-06-22 21:53:32 +02:00
Philipp Maier 4e196ceaf4 cosmetic: rename Ki to Key
sysmo-isim-sja2 and sysmo-isim-sjs1 support multiple different
authentication algorithms. The commandline options and the log output
always speaks of "Ki", this is only correct when COMP128 is used. So
lets be more generic and call it "Key" rather then "Ki".

Related: OS#6473
2023-06-22 21:46:24 +02:00
Philipp Maier 513de41913 tests: Fixup test results ("XOR-2G" bacame "COMP128v3")
in 82a785d27f we correct the algorithm
name string for COMP128v2 from XOR-2G to COMP128v2. Since the wrong
naming also appears in the test scripts and the related .out files, we
need to fix those locations as well.
2023-06-05 15:00:48 +02:00
Harald Welte ba5a5ce6e7 tests: Fixup test results ('3' is COMP128v3, not XOR-2G) 2023-05-26 17:29:42 +02:00
Harald Welte 5af5ace55d test: update copyright statement after recent change 2023-05-26 16:43:14 +02:00
Philipp Maier ee5c2d77b4 tests/sja2: change card in test rig
The sysmo-usim-sja2 which is currently used for testing somewhat old. In
order to have a defined state here lets exchange it with a new card.
This will also ensure that we have a card with the most recent card
profile in the tester.
2021-04-21 11:59:35 +02:00
Philipp Maier fd95de36de sysmo-isim-sja2: change tests to match current card profile
The current card profile uses a different ATR, and ADM pin.
2020-09-10 21:37:37 +02:00
Philipp Maier 77d68b84b3 sysmo_isim_sja2: reset SQN configuration to the current profile
The profile of sysmo_isim_sja2 has changed the content of the SQN
confugrantion file. Lets update the .out files of the tests and the
default values inside the program as well.
2020-03-17 14:26:57 +01:00
Philipp Maier 00241b4423 sysmoUSIM-SJA2: detect installed applications (ISIM/USIM)
Depending on the card profile the sysmoUSIM-SJA2 may come with an USIM
application or with an USIM and an ISIM application installed. If the
ISIM application is not present the related application must not get
selected and the related files must not accessed. At the moment the
presence of the ISIM application is detected by checking the ATR,
however the ATR only identifies a certain OS version or type, not an
application. Lets look at the EF.DIR first and dtermine the presence of
the applications by looking for the related AID.

Related: SYS#4817
2020-03-17 11:13:52 +01:00
Philipp Maier 633d158eff sysmoUSIM-SJA2: remove abandonned 0 byte test output files
The directory with the test scripts for the SJA2 simcards contains
0-byte .out files which are unused. Presumably those files were
excidantly added to the repository, lets remove them.
2020-03-11 13:21:49 +01:00
Philipp Maier 59c1f0eab2 prepare: also reset SQN parameters
The SQN parameters may be changed by previous tests. Lets reset them
before running the testsuite.

Change-Id: I3caa0983a9494d1e22c0a9beae346bc0d7130ed2
2020-02-18 15:30:09 +01:00
Philipp Maier f745baa551 prepare: remove ICCID from prepare script and from test-data
The ICCID is not programmable on sysmo-usim-sja2 cards. Lets remove the
related parameters and variables from the test script

Change-Id: Ib22098b94dd2b8526e74b6d8b1cd7b2162f6307a
2020-02-18 15:29:59 +01:00
Philipp Maier 8dd52e04ac sja2: Add support for new simcard model
Adding support for the new SJA2 simcard type requires comprensive
refactoring of sysmo-usim-tool. We resolve the commonalities of
both simcard models in a class based approach so that code duplication
is reduced to a minium.

- Refactor sysmo-usim-tool into a class based model
- Add support for SJA2 simcard models
- Add tests for SJA2 simcard models

Change-Id: I0feab71bdaab079b35737bb4e0e2a417c4a1f96b
Related: SYS#4466
2020-01-06 11:09:21 +01:00