diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2022-04-22 00:18:59 +0300 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2023-03-22 09:57:32 +0000 |
commit | 1dd5cb540da0b7346482a16698ef8f5d74487fdb (patch) | |
tree | 3d17a877fcf6197148c787cbf5776eb394e1c8a6 | |
parent | 41fbf12dba06450b60d05fa363ad1a8fdb395153 (diff) |
fix SimCardCommands.run_gsm(): always use CLA=0xa0
Depending on the card type (SIM or USIM/ISUM), self.cla_byte may
be either 0xa0 or 0x00. Sending RUN GSM ALGORITHM with CLA=0x00
fails with SW=6985 (Command not allowed), so let's make sure
that we always use CLA=0xa0 regardless of the card type.
Change-Id: Ia0abba136dbd4cdea8dbbc3c4d6abe12c2863680
-rw-r--r-- | pySim/commands.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pySim/commands.py b/pySim/commands.py index d123e67..ba37876 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -407,7 +407,7 @@ class SimCardCommands: if len(rand) != 32: raise ValueError('Invalid rand') self.select_path(['3f00', '7f20']) - return self._tp.send_apdu(self.cla_byte + '88000010' + rand) + return self._tp.send_apdu('a0' + '88000010' + rand) def authenticate(self, rand: str, autn: str, context='3g'): """Execute AUTHENTICATE (USIM/ISIM). |