laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/37532?usp=email )


Change subject: pySim.apdu: Fix APDU CLA matching
......................................................................

pySim.apdu: Fix APDU CLA matching

The cla values as hex strings must be compared in case insensitive manner

Change-Id: I890bc385d6209e6cfe9b0c38bd9deee7ae50e5f5
---
M pySim/apdu/__init__.py
1 file changed, 13 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/32/37532/1

diff --git a/pySim/apdu/__init__.py b/pySim/apdu/__init__.py
index 6613e91..fbe7e6b 100644
--- a/pySim/apdu/__init__.py
+++ b/pySim/apdu/__init__.py
@@ -272,7 +272,7 @@
         """Does the given CLA match the CLA list of the command?."""
         if not isinstance(cla, str):
             cla = '%02X' % cla
-        cla = cla.lower()
+        cla = cla.upper()
         # see https://github.com/PyCQA/pylint/issues/7219
         # pylint: disable=no-member
         for cla_match in cls._cla:
@@ -282,7 +282,7 @@
                     cla_masked += 'X'
                 else:
                     cla_masked += cla[i]
-            if cla_masked == cla_match:
+            if cla_masked == cla_match.upper():
                 return True
         return False


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37532?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: I890bc385d6209e6cfe9b0c38bd9deee7ae50e5f5
Gerrit-Change-Number: 37532
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <lafo...@osmocom.org>
Gerrit-MessageType: newchange

Reply via email to