laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35440?usp=email )
Change subject: Fix enumeration of GlobbalPlatformISDR during card_init()
......................................................................
Fix enumeration of GlobbalPlatformISDR during card_init()
We used __subclasses__(), but this only returns the immediate
subclasses and not all further/nested subclasses. Instead, we must
use the pySim.utils.all_subclasses() function to really get all of them.
The hack to use the method signature of the constructor to determine if
it's an intermediate class didn't work, as even GlobbalPlatformISDR
has a optional argument for non-default AIDs. So let's introduce an
explicit class attribute for that purpose.
Change-Id: I7fb1637f8f7a149b536c4d77dac92736c526aa6c
---
M pySim/app.py
M pySim/global_platform.py
2 files changed, 23 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/40/35440/1
diff --git a/pySim/app.py b/pySim/app.py
index b0df85f..421cb4d 100644
--- a/pySim/app.py
+++ b/pySim/app.py
@@ -14,7 +14,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import inspect
from typing import Tuple
from pySim.transport import LinkBase
@@ -26,6 +25,7 @@
from pySim.profile import CardProfile
from pySim.cdma_ruim import CardProfileRUIM
from pySim.ts_102_221 import CardProfileUICC
+from pySim.utils import all_subclasses
# we need to import this module so that the SysmocomSJA2 sub-class of
# CardModel is created, which will add the ATR-based matching and
@@ -87,10 +87,9 @@
# We cannot do it within pySim/profile.py as that would create circular
# dependencies between the individual profiles and profile.py.
if isinstance(profile, CardProfileUICC):
- for app_cls in CardApplication.__subclasses__():
- constr_sig = inspect.signature(app_cls.__init__)
+ for app_cls in all_subclasses(CardApplication):
# skip any intermediary sub-classes such as CardApplicationSD
- if len(constr_sig.parameters) != 1:
+ if hasattr(app_cls, 'intermediate') and app_cls.intermediate:
continue
profile.add_application(app_cls())
# We have chosen SimCard() above, but we now know it actually is an UICC
diff --git a/pySim/global_platform.py b/pySim/global_platform.py
index 136cccc..5382f93 100644
--- a/pySim/global_platform.py
+++ b/pySim/global_platform.py
@@ -253,11 +253,13 @@
# Card Application of a Security Domain
class CardApplicationSD(CardApplication):
+ intermediate = True
def __init__(self, aid: str, name: str, desc: str):
super().__init__(name, adf=ADF_SD(aid, name, desc), sw=sw_table)
# Card Application of Issuer Security Domain
class CardApplicationISD(CardApplicationSD):
+ intermediate = False
# FIXME: ISD AID is not static, but could be different. One can select the empty
# application using '00a4040000' and then parse the response FCI to get the ISD AID
def __init__(self, aid='a000000003000000'):
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35440?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I7fb1637f8f7a149b536c4d77dac92736c526aa6c
Gerrit-Change-Number: 35440
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/35439?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: filesystem: use pySim.utils.build_construct()
......................................................................
filesystem: use pySim.utils.build_construct()
We recently introduced a pySim.utils.build_construct() wrapper around
the raw call of the construct.build() method. So far, this wrapper
was only used from pySim.tlv, but let's also use it from
pySim.filesystem.
Basically, whenever we use parse_construct(), we should use
build_construct() as the inverse operation.
Change-Id: Ibfd61cd87edc72882aa66d6ff17861a3e918affb
---
M pySim/filesystem.py
M pySim/sysmocom_sja2.py
2 files changed, 26 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/39/35439/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35439?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ibfd61cd87edc72882aa66d6ff17861a3e918affb
Gerrit-Change-Number: 35439
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset
Attention is currently required from: dexter, fixeria.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35363?usp=email )
The change is no longer submittable: Code-Review is unsatisfied now.
Change subject: decode security attributes compact field in FCP
......................................................................
Patch Set 6: -Code-Review
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35363?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iaa1167349027222e69a561d20a4c595fba2fdd2b
Gerrit-Change-Number: 35363
Gerrit-PatchSet: 6
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Sat, 23 Dec 2023 13:24:56 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: dexter, fixeria, laforge.
laforge has uploaded a new patch set (#6) to the change originally created by dexter. ( https://gerrit.osmocom.org/c/pysim/+/35363?usp=email )
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: decode security attributes compact field in FCP
......................................................................
decode security attributes compact field in FCP
When we select files, we currently display the security attributes
compact field as raw bytes only. Let's decode this field using construct
so that it gets displayed in human readable form.
Change-Id: Iaa1167349027222e69a561d20a4c595fba2fdd2b
Related: OS#6211
---
M pySim/ts_102_221.py
1 file changed, 44 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/63/35363/6
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35363?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iaa1167349027222e69a561d20a4c595fba2fdd2b
Gerrit-Change-Number: 35363
Gerrit-PatchSet: 6
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: dexter, fixeria, laforge.
laforge has uploaded a new patch set (#5) to the change originally created by dexter. ( https://gerrit.osmocom.org/c/pysim/+/35363?usp=email )
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: decode security attributes compact field in FCP
......................................................................
decode security attributes compact field in FCP
When we select files, we currently display the security attributes
compact field as raw bytes only. Let's decode this field using construct
so that it gets displayed in human readable form.
Change-Id: Iaa1167349027222e69a561d20a4c595fba2fdd2b
Related: OS#6211
---
M pySim/ts_102_221.py
1 file changed, 44 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/63/35363/5
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35363?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iaa1167349027222e69a561d20a4c595fba2fdd2b
Gerrit-Change-Number: 35363
Gerrit-PatchSet: 5
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35438?usp=email )
Change subject: pySim-trace_test.sh: Force termcolor to suppress color generation
......................................................................
pySim-trace_test.sh: Force termcolor to suppress color generation
on some systems, the output would otherwise contain colored status
words, which in turn mean the test otuput no longer matches the expected
output.
Change-Id: Icb700f6e85a285748e00367a398975aa5e75dec5
---
M tests/pySim-trace_test.sh
1 file changed, 15 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/tests/pySim-trace_test.sh b/tests/pySim-trace_test.sh
index f7b97e8..3e200c3 100755
--- a/tests/pySim-trace_test.sh
+++ b/tests/pySim-trace_test.sh
@@ -25,6 +25,8 @@
TEMPFILE=temp.tmp
export PYSIM_INTEGRATION_TEST=1
+# to avoid termcolor.colored generating colors; https://github.com/termcolor/termcolor
+export ANSI_COLORS_DISABLED=1
echo "pySim-trace_test - a test program to test pySim-trace.py"
echo "========================================================"
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35438?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Icb700f6e85a285748e00367a398975aa5e75dec5
Gerrit-Change-Number: 35438
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged