usim/opc: Add support to write completely random OPC

Allow to set the OPC, write it out to the state, generate it randomly.
This commit is contained in:
Harald Welte
2012-03-22 14:31:36 +01:00
committed by Holger Hans Peter Freyther
parent 4d91bf449f
commit 93b38cd0f5
2 changed files with 18 additions and 3 deletions

View File

@@ -337,9 +337,8 @@ class SysmoUSIMgr1(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
p['opc'] + # 32b OPC
self._e_iccid(p['iccid']) + # 10b ICCID
self._e_imsi(p['imsi']) # 9b IMSI_len + id_type(9) + IMSI
)