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.
This commit is contained in:
Holger Hans Peter Freyther
2012-03-22 14:28:38 +01:00
parent 8ca49e9ca8
commit 4d91bf449f

View File

@@ -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 ]