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
This commit is contained in:
Harald Welte
2023-12-23 17:23:52 +01:00
parent 722c11a7e9
commit dffe7af578
2 changed files with 4 additions and 4 deletions

View File

@@ -267,6 +267,7 @@ class ADF_SD(CardADF):
# 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)