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.
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
Modern SIM cards may come with multiple applications installed (e.g. an
additional ISIM application along with a regular USIM application). In
some debug cases it may be helpful to be able to list those
applications. Lets add some functionality for that.
Related: SYS#4817
sysmoUSIM-SJS1 features enableing/disableing its USIM application to
switch beween classic SIM and USIM mode. If the usim mode gets disabled
by excidant the testsuite would fail. Lets make sure that USIM mode is
always enabled before the testsuite is executed.
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.
The commandline option -S states that the SQN parameters are reset to
default. Actually only the SQN counters are reset. Lets also reset the
related configuration parameters as well.
Change-Id: Ia1f298a00b0c4f0399afd60fefb8b3c8f3a514ba
The SQN parameters may be changed by previous tests. Lets reset them
before running the testsuite.
Change-Id: I3caa0983a9494d1e22c0a9beae346bc0d7130ed2
The ICCID is not programmable on sysmo-usim-sja2 cards. Lets remove the
related parameters and variables from the test script
Change-Id: Ib22098b94dd2b8526e74b6d8b1cd7b2162f6307a
The run-tests script that runs the two testsuites for the two different
supported card models returns 0, even when the tests fail. This tricks
jenkins into thinking everything were ok. Lets make sure the script is
stopped immediately and returns with 1 when the tests fail.
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
At the moment we can only print single line hexdumps. This works fine
for short data. However, if data becomes longer we should be able to
display it over multiple lines.
Related: SYS#4466
Change-Id: Id553df7c579bd648cb724fb1bbf906d9b50a357e
The module sysmo-usimsjs1.py contains a lot of functions that could also
be methods of a class. Lets refactor those functions into class. This is
also an intermediate step towords support for different card models in
the future.
Related: SYS#4466
Change-Id: I2230f50b9d3c85a0d23b29ba5ed0af2471d22e8c
It may not be immediately obvious what int_to_list() does, lets add a
comment to clarify
elated: SYS#4466
Change-Id: I82639a7333c3d805f6242aa58a3d42800a804820
To find out which algorithm ID corresponds to which string and vice
versa we currently use tables and dictionaries. However, this way can be
generalized and other parts of the program can profit from that
Change-Id: I68388ae27d05fcd1bc9de100e040da0c2bb8e799
Related: SYS#4466
ef_mlngc currently has no encoding method at the moment. Instead it
reads and writes the parameters directly using offsets. This is a bit
complicated, lets rather read and write the file in a single go and
encode/decode the contents using class methods (like we already do with
the other files)
Change-Id: Ia5c64710306b763804254cf9807e81627a699728
Related: SYS#4466
The length of the ADM1 key is currently not checked. The key is 8
digits long for all sysmo-usim-sjs1 cards. Lets make sure that the
length is checked before trying to authenticate.
Change-Id: I10a89d8343c889f6c1b2cf3fc67d08dcf08790cf
The file EF.AD contains the length of the MNC, this allows to phone to
distinguish where MCC/MNC end and where the MSIN number of the IMSI
begins. All cards are shipped with an MNC length of 2, which is fine for
the most situations, but when a MNC with 3 digits is needed the MNC
length value has to be updated. Otherwise the phone will recognize the
third digit of the MNC as part of the MSIN.
Related: OS#3850
when programming the 3G authentication (EF_AUTH), the parameter for 2G
is used.
- make sure that parameter algo_3g_str is used to select the 3g
authentication algorithem, do not use algo_2g_str here.
Change-Id: I6aaf49062f6faf36455dc48639dc58f3da8e804d
Updated the test-data to the ADM1 key of the test card we currently have
in use. Developers must change this ADM1 key to match theur own
testcards.
Change-Id: I68e7a739fa093d255006bf427c0a332610935800
Related: OS#3376
All tests need a physical card to be inserted in a reader. This card may
have a different IMSI and/or ICCID id set than the one that is expected
by the tests. Since sysmo-usim-tool.sjs1.py unconditionally displays
IMSI and ICCID we find those parameters in every .out file.
In order to run the unit-tests without changing the .out files very often
or having to manually prepare a test card we should write the expected
IMSI and ICCID before each testsuite is executed.
- Add a script to the testsuite that prepares the testcard, run this
script from run-tests before the actual tests are executed.
Change-Id: I470f4f7d5facab277b6e78252bac7cc4d1fbc6bb
Related: OS#3376
the resetting of the SEQ/SQN parameters is currently not tested, we
currently only read out the parameters. Lets test resetting as well.
Change-Id: Ie3e386a79f69cd5e35782f593c3a30e1d2b50afb
Related: OS#3376
At the moment we only read the milenage parameters but we do not write
them. Lets extend the unit test so that we test writing as well.
Change-Id: I81dd27b3e65510db931188171093f0e909cde16f
Related: OS#3376
The log output for writing the SQN parameters has changed. Update the
.out file accordingly
Change-Id: I58e7c44d3ff0a1c4fea7b8edaa4ca7326a4fd88a
Related: OS#3376
The use of == with test seems to cause problems when comparing the
return code in line 20. Lets use -eq instead.
Change-Id: I92905770f3a96a632a51858952a82180303d6c05
Related: OS#3376
The concatenation
ALGOS=+"MILENAGE:...
seems to cause problems. Lets replace it with:
ALGOS=$ALGOS"MILENAGE:...
Change-Id: I8d946c47502305be77595cd45a64708d03441dd5
Related OS#3376
We unconditionally display the IMSI but we still lack support for
writing it. Lets support writing the IMSI as well in order to be more
complete.
- Add support for writing the IMSI
Change-Id: I1b3d1e1aae953663c13e78217de2a8ec3282b969
Related: OS#3376
The test 04_algo.sh suggests that an algorithm should also be
identified by its number (this is the old way). Since we upgraded
the commandline interface to accept the names of the algorithms the
support for the old way that used numbers had been removed. However,
we should stay compatible with the old method to keep legacy scripts
of customers working.
- Check if the given parameter that references tha algorithem is
a number. If yes, us it, otherwise lookup the number by the
given string name.
Change-Id: Ib41e4870d05820b6967f648eeeba416113bbc120
Related: OS#3376
When working in an environment with multiple card terminals, then it
might be helpful to make sure that only the intended target simcard
(sysmo-usim-sjs1) is accessed.
- Add atr parameter to the ICC, SIM and USIM classes. When no atr
is given, then ICC will pick any card as it was before
- Make sure to pass the ATR when the sim object is created
Change-Id: I874aae92d29a7e1051e4cebefd85592c5fb78a2e
Related: OS#3376
When using the -T option the user has to supply two authentication
alogorithms. One for 2G and one for 3G. The authentication algorithms
used to be symbolized by integer numbeers. This was later changed so
that the user could use the clear names of the algorithms. Unfortunately
the usage text was not changed.
- Update usage description
Change-Id: I6a47e4fc24f4b3f0664050032cc15d81703f30c5
Collapse two functions of if-cascades into a data structure matching algo
numbers with string names. Use dicts produced from the initial tuple defining
the relation, to re-implement the functions.
When printing out algos, also print out the numbers set on the USIM.
This prepares for printing a list of available algos by commandline switch.
The SQNms offset is a *byte* index into the SQNA file, let's divide
this by 6 before showing it to the user, so he can immediately
make the connection into the SQN array dumped below