laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/36776?usp=email )
Change subject: filesystem: Enforce lower-case hex AID ......................................................................
filesystem: Enforce lower-case hex AID
our utils.b2h() returns values in lower-case hex string notation, so let's make sure the CardADF and CardApplication AID values are also stored in lower case notation, othewise the matching baesd on AIDs returned from the card will not work, specifically as we use uppercase AIDs in pySim.euicc for CardApplicationECASD and CardApplicationISDR.
Rather than change those two instances, let's solve it in a generic way.
We already do the same for the CardFile.fid member.
Change-Id: Ie42392412d9eb817fbc563d9165faab198ffa7a9 --- M pySim/filesystem.py 1 file changed, 22 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/76/36776/1
diff --git a/pySim/filesystem.py b/pySim/filesystem.py index 4d5fde9..77482cc 100644 --- a/pySim/filesystem.py +++ b/pySim/filesystem.py @@ -512,7 +512,7 @@ super().__init__(**kwargs) # reference to CardApplication may be set from CardApplication constructor self.application = None # type: Optional[CardApplication] - self.aid = aid # Application Identifier + self.aid = aid.lower() # Application Identifier self.has_fs = has_fs # Flag to tell whether the ADF supports a filesystem or not mf = self.get_mf() if mf: @@ -1294,6 +1294,8 @@ adf : ADF name sw : Dict of status word conversions """ + if aid: + aid = aid.lower() self.name = name self.adf = adf self.sw = sw or {}