Change in pysim[master]: cards: rename class "Card" to "SimCard"
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/24142 ) Change subject: cards: rename class "Card" to "SimCard" .. cards: rename class "Card" to "SimCard" There are the classes IsimCard and UsimCard, which inheret from Card, which is the base class for a normal non ISIM/USIM simcard. Card also has methods in it that are related to simcards, so it is not just any "Card", it is a SimCard and should be called that way. Change-Id: I2077ded44bc2297b8d478c5bd1895951b494efcc --- M pySim-read.py M pySim-shell.py M pySim/cards.py 3 files changed, 11 insertions(+), 11 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim-read.py b/pySim-read.py index 1f2e123..00194b4 100755 --- a/pySim-read.py +++ b/pySim-read.py @@ -34,7 +34,7 @@ from pySim.commands import SimCardCommands from pySim.transport import init_reader, argparse_add_reader_args -from pySim.cards import card_detect, Card, UsimCard, IsimCard +from pySim.cards import card_detect, SimCard, UsimCard, IsimCard from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid, dec_msisdn from pySim.utils import format_xplmn_w_act, dec_st from pySim.utils import h2s, format_ePDGSelection @@ -75,7 +75,7 @@ print("Reading ...") # Initialize Card object by auto detecting the card - card = card_detect("auto", scc) or Card(scc) + card = card_detect("auto", scc) or SimCard(scc) # Read all AIDs on the UICC card.read_aids() diff --git a/pySim-shell.py b/pySim-shell.py index 59bfa28..7977ff5 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -37,7 +37,7 @@ from pySim.exceptions import * from pySim.commands import SimCardCommands from pySim.transport import init_reader, ApduTracer, argparse_add_reader_args -from pySim.cards import card_detect, Card +from pySim.cards import card_detect, SimCard from pySim.utils import h2b, swap_nibbles, rpad, b2h, h2s, JsonEncoder, bertlv_parse_one from pySim.utils import dec_st, sanitize_pin_adm, tabulate_str_list, is_hex, boxed_heading_str from pySim.card_handler import card_handler diff --git a/pySim/cards.py b/pySim/cards.py index c41f343..c38b185 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -50,7 +50,7 @@ res += "\t%s # %s\n" % (addr_hex, addr) return res -class Card(object): +class SimCard(object): name = 'SIM' @@ -310,7 +310,7 @@ len = self._scc.record_size(ef) self._scc.update_record(ef, rec_no, "ff" * len, force_len=False, verify=True) -class UsimCard(Card): +class UsimCard(SimCard): name = 'USIM' @@ -388,7 +388,7 @@ (res, sw) = self._scc.update_binary(EF_USIM_ADF_map['UST'], content) return sw -class IsimCard(Card): +class IsimCard(SimCard): name = 'ISIM' @@ -516,7 +516,7 @@ uiari_recs += "UICC IARI: Can't read, response code = %s\n" % (sw) return uiari_recs -class MagicSimBase(abc.ABC, Card): +class MagicSimBase(abc.ABC, SimCard): """ Theses cards uses several record based EFs to store the provider infos, each possible provider uses a specific record number in each EF. The @@ -664,7 +664,7 @@ _ki_file = '6f1b' -class FakeMagicSim(Card): +class FakeMagicSim(SimCard): """ Theses cards have a record based EF 3f00/000c that contains the provider information. See the program method for its format. The records go from @@ -731,7 +731,7 @@ self._scc.update_record('000c', 1+i, entry) -class GrcardSim(Card): +class GrcardSim(SimCard): """ Greencard (grcard.cn) HZCOS GSM SIM These cards have a much more regular ISO 7816-4 / TS 11.11 structure, @@ -834,7 +834,7 @@ data, sw = self._scc._tp.send_apdu_checksw("009933" + par) -class SysmoSIMgr2(Card): +class SysmoSIMgr2(SimCard): """ sysmocom sysmoSIM-GR2 """ @@ -1157,7 +1157,7 @@ if sw != '9000': print("Programming ACC failed with code %s"%sw) -class OpenCellsSim(Card): +class OpenCellsSim(SimCard): """ OpenCellsSim -- To view, visit https://gerrit.osmocom.org/c/pysim/+/24142 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I2077ded44bc2297b8d478c5bd1895951b494efcc Gerrit-Change-Number: 24142 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: pespin Gerrit-MessageType: merged
Change in pysim[master]: cards: rename class "Card" to "SimCard"
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/24142 ) Change subject: cards: rename class "Card" to "SimCard" .. Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/24142 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I2077ded44bc2297b8d478c5bd1895951b494efcc Gerrit-Change-Number: 24142 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: pespin Gerrit-Comment-Date: Wed, 30 Jun 2021 08:17:09 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in pysim[master]: cards: rename class "Card" to "SimCard"
Hello Jenkins Builder, laforge, fixeria, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/24142 to look at the new patch set (#4). Change subject: cards: rename class "Card" to "SimCard" .. cards: rename class "Card" to "SimCard" There are the classes IsimCard and UsimCard, which inheret from Card, which is the base class for a normal non ISIM/USIM simcard. Card also has methods in it that are related to simcards, so it is not just any "Card", it is a SimCard and should be called that way. Change-Id: I2077ded44bc2297b8d478c5bd1895951b494efcc --- M pySim-read.py M pySim-shell.py M pySim/cards.py 3 files changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/42/24142/4 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/24142 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I2077ded44bc2297b8d478c5bd1895951b494efcc Gerrit-Change-Number: 24142 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: pespin Gerrit-MessageType: newpatchset
Change in pysim[master]: cards: rename class "Card" to "SimCard"
Hello Jenkins Builder, laforge, fixeria, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/24142 to look at the new patch set (#3). Change subject: cards: rename class "Card" to "SimCard" .. cards: rename class "Card" to "SimCard" There are the classes IsimCard and UsimCard, which inheret from Card, which is the base class for a normal non ISIM/USIM simcard. Card also has methods in it that are related to simcards, so it is not just any "Card", it is a SimCard and should be called that way. Change-Id: I2077ded44bc2297b8d478c5bd1895951b494efcc --- M pySim-read.py M pySim-shell.py M pySim/cards.py 3 files changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/42/24142/3 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/24142 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I2077ded44bc2297b8d478c5bd1895951b494efcc Gerrit-Change-Number: 24142 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: pespin Gerrit-MessageType: newpatchset
Change in pysim[master]: cards: rename class "Card" to "SimCard"
Hello Jenkins Builder, laforge, fixeria, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/24142 to look at the new patch set (#2). Change subject: cards: rename class "Card" to "SimCard" .. cards: rename class "Card" to "SimCard" There are the classes IsimCard and UsimCard, which inheret from Card, which is the base class for a normal non ISIM/USIM simcard. Card also has methods in it that are related to simcards, so it is not just any "Card", it is a SimCard and should be called that way. Change-Id: I2077ded44bc2297b8d478c5bd1895951b494efcc --- M pySim-read.py M pySim-shell.py M pySim/cards.py 3 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/42/24142/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/24142 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I2077ded44bc2297b8d478c5bd1895951b494efcc Gerrit-Change-Number: 24142 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: pespin Gerrit-MessageType: newpatchset
Change in pysim[master]: cards: rename class "Card" to "SimCard"
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/24142 ) Change subject: cards: rename class "Card" to "SimCard" .. Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/24142 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I2077ded44bc2297b8d478c5bd1895951b494efcc Gerrit-Change-Number: 24142 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: pespin Gerrit-Comment-Date: Thu, 06 May 2021 18:37:33 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in pysim[master]: cards: rename class "Card" to "SimCard"
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/24142 ) Change subject: cards: rename class "Card" to "SimCard" .. Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/24142 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I2077ded44bc2297b8d478c5bd1895951b494efcc Gerrit-Change-Number: 24142 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge Gerrit-Comment-Date: Thu, 06 May 2021 16:41:20 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in pysim[master]: cards: rename class "Card" to "SimCard"
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/24142 ) Change subject: cards: rename class "Card" to "SimCard" .. cards: rename class "Card" to "SimCard" There are the classes IsimCard and UsimCard, which inheret from Card, which is the base class for a normal non ISIM/USIM simcard. Card also has methods in it that are related to simcards, so it is not just any "Card", it is a SimCard and should be called that way. Change-Id: I2077ded44bc2297b8d478c5bd1895951b494efcc --- M pySim-read.py M pySim-shell.py M pySim/cards.py 3 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/42/24142/1 diff --git a/pySim-read.py b/pySim-read.py index ebe0e29..a138698 100755 --- a/pySim-read.py +++ b/pySim-read.py @@ -34,7 +34,7 @@ from pySim.commands import SimCardCommands from pySim.transport import init_reader, argparse_add_reader_args -from pySim.cards import card_detect, Card, UsimCard, IsimCard +from pySim.cards import card_detect, SimCard, UsimCard, IsimCard from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid, dec_msisdn from pySim.utils import format_xplmn_w_act, dec_spn, dec_st, dec_addr_tlv from pySim.utils import h2s, format_ePDGSelection @@ -75,7 +75,7 @@ print("Reading ...") # Initialize Card object by auto detecting the card - card = card_detect("auto", scc) or Card(scc) + card = card_detect("auto", scc) or SimCard(scc) # Read all AIDs on the UICC card.read_aids() diff --git a/pySim-shell.py b/pySim-shell.py index bbfe7e9..8efbf14 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -37,7 +37,7 @@ from pySim.exceptions import * from pySim.commands import SimCardCommands from pySim.transport import init_reader, ApduTracer, argparse_add_reader_args -from pySim.cards import card_detect, Card +from pySim.cards import card_detect, SimCard from pySim.utils import h2b, swap_nibbles, rpad, b2h, h2s, JsonEncoder, bertlv_parse_one from pySim.utils import dec_st, sanitize_pin_adm, tabulate_str_list, is_hex, boxed_heading_str from pySim.card_handler import card_handler diff --git a/pySim/cards.py b/pySim/cards.py index ac2545e..0fb7357 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -32,7 +32,7 @@ from smartcard.util import toBytes from pytlv.TLV import * -class Card(object): +class SimCard(object): name = 'SIM' @@ -283,7 +283,7 @@ len = self._scc.record_size(ef) self._scc.update_record(ef, rec_no, "ff" * len, force_len=False, verify=True) -class UsimCard(Card): +class UsimCard(SimCard): name = 'USIM' @@ -479,7 +479,7 @@ uiari_recs += "UICC IARI: Can't read, response code = %s\n" % (sw) return uiari_recs -class MagicSimBase(abc.ABC, Card): +class MagicSimBase(abc.ABC, SimCard): """ Theses cards uses several record based EFs to store the provider infos, each possible provider uses a specific record number in each EF. The @@ -627,7 +627,7 @@ _ki_file = '6f1b' -class FakeMagicSim(Card): +class FakeMagicSim(SimCard): """ Theses cards have a record based EF 3f00/000c that contains the provider information. See the program method for its format. The records go from @@ -694,7 +694,7 @@ self._scc.update_record('000c', 1+i, entry) -class GrcardSim(Card): +class GrcardSim(SimCard): """ Greencard (grcard.cn) HZCOS GSM SIM These cards have a much more regular ISO 7816-4 / TS 11.11 structure, @@ -797,7 +797,7 @@ data, sw = self._scc._tp.send_apdu_checksw("009933" + par) -class SysmoSIMgr2(Card): +class SysmoSIMgr2(SimCard): """ sysmocom sysmoSIM-GR2 """ @@ -1134,7 +1134,7 @@ self._scc.cla_byte = cla_byte_orig self._scc.sel_ctrl = sel_ctrl_orig -class OpenCellsSim(Card): +class OpenCellsSim(SimCard): """ OpenCellsSim -- To view, visit https://gerrit.osmocom.org/c/pysim/+/24142 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I2077ded44bc2297b8d478c5bd1895951b494efcc Gerrit-Change-Number: 24142 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-MessageType: newchange