Skip to content
Success

Changes

Summary

  1. commands: fix typo (details)
  2. global_platform/scp: fix typo (details)
  3. commands: fix double space character in apidoc (details)
  4. commands: fix apidoc (wrong order of parameters) (details)
  5. pySim-shell_test/utils: print logfile on all types of errors (details)
  6. pySim-shell-test: improve global platform tests (details)
  7. global_platform/scp: mapdu may be undeclared (details)
  8. pySim-shell: allow checking of APDU responses (details)
  9. pySim-shell: fix reset command for no-profile mode (details)
  10. pySim-shell: add new commandline option "--pure" (details)
  11. pySim/transport add support for T=1 protocol and fix APDU/TPDU layer (details)
  12. extend unittest (details)
Commit 5d54f3b8d8b435c1966abf0e22ca03fd01053078 by pmaier@sysmocom.de
commands: fix typo

Change-Id: I4103b7474063a26f09666361aef72abcd35bc12d
The file was modifiedpySim/commands.py
Commit 909b8c1611ebfa710cc9ab3827bf17f4b9944581 by pmaier@sysmocom.de
global_platform/scp: fix typo

Change-Id: Ib26d983c6a80419326de812af2781c5e710dbcfc
The file was modifiedpySim/global_platform/scp.py
Commit 464d1ac2bef05e78909386a97b887421b8dd6968 by pmaier@sysmocom.de
commands: fix double space character in apidoc

Change-Id: Id0dbe4578fd212bc240aac80e1e416cb57e92cc7
The file was modifiedpySim/commands.py
Commit 35b9b3c54239e2c3f39d960b279a92523e3b1429 by pmaier@sysmocom.de
commands: fix apidoc (wrong order of parameters)

Change-Id: I4d17c71c7f992ecd795dd214d34f2e094c0a5b53
The file was modifiedpySim/commands.py
Commit e39e3e391d51a9ec2d66481afd1440d930761950 by pmaier@sysmocom.de
pySim-shell_test/utils: print logfile on all types of errors

When pySim-shell has problems starting up, it exits with an error
code. This is detected by the testsuite, but it also causes an
early exit, so that the log file content are not printed.

Change-Id: Ic0f34eda32a7c557810abcb05a84e343741fdb8a
The file was modifiedtests/pySim-shell_test/utils.py
Commit e4a63b1348184c8e2606afabfbd06ff5182ff544 by pmaier@sysmocom.de
pySim-shell-test: improve global platform tests

The tests that check the establishment of a secure channel currently only test
security level 3. Also the get_data command after it only tests data reception
from the card.

Let's extend the test coverage and test the SCP establishment for security
level 1 as well. Let's also add a get_status command to make sure sending data
to the card also works (without exceptions).

Related: OS#6367
Change-Id: Idff40b414a249e532df1bdce2a8deb9b0cb9718f
The file was modifiedtests/pySim-shell_test/gp/test_est_scp02_direct.template
The file was modifiedtests/pySim-shell_test/gp/test_est_scp03_csv.script
The file was modifiedtests/pySim-shell_test/gp/test_est_scp02_csv.script
The file was modifiedtests/pySim-shell_test/gp/test_est_scp03_direct.template
Commit 5652a4d7d6c2bcae8cff02a45f8467f7524858a6 by pmaier@sysmocom.de
global_platform/scp: mapdu may be undeclared

when we sign and encrypt the APDU in _wrap_cmd_apdu (SCP03) we return an "mapdu"
at the end. However, in the (unlikely?) case where self.do_cencand
self.do_cmac are false, mapdu will be undeclared. In _wrap_cmd_apdu for SCP02
we just re-use the apdu variable and return it at the end, so when no
encryption and no signing is applied, the APDU falls just through without any
modifications. We should have the same mechanism for the SCP03 wrapping as
well.

Related: OS#6367

Change-Id: Ic7089a69dffd7313572c5b3e5953200be5925766
The file was modifiedpySim/global_platform/scp.py
Commit 1d1745a57c91e03c29291b79e9745c77a9169785 by pmaier@sysmocom.de
pySim-shell: allow checking of APDU responses

The "apdu" command allows us to send custom APDUs to a card. This command is
often used in low level initialization scripts or tests. To stop the script
execution in case of an error, the command allows us to specify a status word
that must match the status word of the response. But we have no such mechanism
for the response itsself. Let's add another parameter where we can pass a regex
that the response must match.

Related: OS#6367
Change-Id: I97bbcdf37bdcf00ad50a875b96940c211de7073d
The file was modifiedpySim-shell.py
Commit 167ba5d3148e4be963e416f13814fae7747703d8 by pmaier@sysmocom.de
pySim-shell: fix reset command for no-profile mode

There are situations where no card profile can be determined. In this case no
RuntimeState will be present. This is in particular the case when pySim-shell
is used on a card that is not provisioned/initialized yet. In those cases we
have to go the direct route and reset the card directly.

Related: OS#6367
Change-Id: I27bf9fdb131d8bdeba07f4dfd2b76b38f9bfdd17
The file was modifiedpySim-shell.py
Commit 77f15834194d85a1db40304fc8e179d37096285c by pmaier@sysmocom.de
pySim-shell: add new commandline option "--pure"

by default pySim-shell does all kinds of probing and file selection
on startup. This is to determine the card type and to find a suitable
card profile. However, in case the card is non yet provisioned this
probing may cause a error messages and even might upset the cards
internal state. So let's have a commandline option thrugh which we
can instruct pySim-shell to skip any initialization and to give us
a prompt immediately, so that we can enter custom APDUs

Related: OS#6367
Change-Id: I1d8a57de201fe7ad7cbcbc6f72969ea8521e821d
The file was modifiedpySim-shell.py
The file was modifiedpySim/app.py
The file was modifiedpySim/cards.py
Commit 97fdfdfffe2c5ce9382129d954241e0cb6f9c5b8 by pmaier@sysmocom.de
pySim/transport add support for T=1 protocol and fix APDU/TPDU layer conflicts

ETSI TS 102 221, section 7.3 specifies that UICCs (and eUICCs) may support two
different transport protocols: T=0 or T=1 or both. The spec also says that the
terminal must support both protocols.

This patch adds the necessary functionality to support the T=1 protocol
alongside the T=0 protocol. However, this also means that we have to sharpen
the lines between APDUs and TPDUs.

Change-Id: I8b56d7804a2b4c392f43f8540e0b6e70001a8970
The file was modifiedpySim/transport/pcsc.py
The file was addedtests/pySim-shell_test/apdu/test_apdu_legacy_scp02.script
The file was modifiedtests/unittests/test_utils.py
The file was modifiedpySim/global_platform/scp.py
The file was modifiedpySim/transport/modem_atcmd.py
The file was addedtests/pySim-shell_test/apdu/__init__.py
The file was modifiedpySim-trace.py
The file was modifiedpySim-shell.py
The file was addedtests/pySim-shell_test/apdu/test_apdu_legacy.script
The file was addedtests/pySim-shell_test/apdu/test_apdu_scp02.script
The file was modifiedpySim/utils.py
The file was modifiedpySim/commands.py
The file was modifiedpySim/global_platform/__init__.py
The file was modifiedpySim/euicc.py
The file was addedtests/pySim-shell_test/apdu/test_apdu_scp03.script
The file was modifiedtests/pySim-shell_test/config.yaml
The file was modifiedtests/unittests/test_globalplatform.py
The file was addedtests/pySim-shell_test/apdu/test_apdu.script
The file was modifiedtests/pySim-shell_test/lchan/test.ok
The file was modifiedpySim/transport/serial.py
The file was modifiedpySim-read.py
The file was addedtests/pySim-shell_test/apdu/test_apdu_legacy_scp03.script
The file was modifiedpySim/transport/__init__.py
The file was modifiedpySim/transport/calypso.py
The file was addedtests/pySim-shell_test/apdu/test.py
Commit bd65122d411d7f6f97688ca53e200604e85a94c1 by pmaier@sysmocom.de
extend unittest

Change-Id: I99cd1f5d8156861531cd4ebd159ff5c273203a9a
The file was modifiedtests/unittests/test_globalplatform.py