Skip to content
Success

Changes

Summary

  1. pySim-shell-test: improve global platform tests (details)
  2. global_platform/scp: mapdu may be undeclared (details)
Commit 59593e0f28b7b10d667c87a6d6d7c5a515f97a69 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_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_scp02_direct.template
The file was modifiedtests/pySim-shell_test/gp/test_est_scp03_direct.template
Commit f4c156ae575a6cd0da434150292bb7cd665a64df 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