From 4d91bf449fb60138ae68c1efad96ea89af674f93 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 22 Mar 2012 14:28:38 +0100 Subject: sysmoUSIM-GR1: Add basic (hacky) support for the sysmoUSIM-GR1 Right now we are only to program the KI, OPC, ICCID and IMSI. This is done in a direct way and through the card abstraction. --- pySim/cards.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/pySim/cards.py b/pySim/cards.py index 35cd046..fe8a6c9 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -318,5 +318,35 @@ class SysmoSIMgr1(GrcardSim): name = 'sysmosim-gr1' # In order for autodetection ... + +class SysmoUSIMgr1(Card): + """ + sysmocom sysmoUSIM-GR1 + """ + name = 'sysmoUSIM-GR1' + + @classmethod + def autodetect(kls, scc): + # TODO: Access the ATR + return None + + def program(self, p): + # TODO: check if verify_chv could be used or what it needs + # self._scc.verify_chv(0x0A, [0x33,0x32,0x32,0x31,0x33,0x32,0x33,0x32]) + # Unlock the card.. + data, sw = self._scc._tp.send_apdu_checksw("0020000A083332323133323332") + + # TODO: move into SimCardCommands + # TODO: Add OPC support support to pySIM + par = ( p['ki'] + # 16b K + 32*"F" + # 32b OPC + self._e_iccid(p['iccid']) + # 10b ICCID + self._e_imsi(p['imsi']) # 9b IMSI_len + id_type(9) + IMSI + ) + data, sw = self._scc._tp.send_apdu_checksw("0099000033" + par) + + def erase(self): + return + _cards_classes = [ FakeMagicSim, SuperSim, MagicSim, GrcardSim, - SysmoSIMgr1 ] + SysmoSIMgr1, SysmoUSIMgr1 ] -- cgit v1.2.3