mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-16 18:38:32 +03:00
Fix format for 'SuperSim'
The Ki is at the very start for that card and not in a special EF Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
34
pySim.py
34
pySim.py
@@ -406,26 +406,32 @@ class _MagicSimBase(Card):
|
|||||||
hplmn = self._e_plmn(p['mcc'], p['mnc'])
|
hplmn = self._e_plmn(p['mcc'], p['mnc'])
|
||||||
|
|
||||||
# Operator name ( 3f00/7f4d/8f0c )
|
# Operator name ( 3f00/7f4d/8f0c )
|
||||||
self._sl.update_record('8f0c', 2,
|
self._sl.update_record(self._files['name'][0], 2,
|
||||||
rpad(b2h(p['name']), 32) + ('%02x' % len(p['name'])) + '01'
|
rpad(b2h(p['name']), 32) + ('%02x' % len(p['name'])) + '01'
|
||||||
)
|
)
|
||||||
|
|
||||||
# ICCID/IMSI/Ki/HPLMN ( 3f00/7f4d/8f0d )
|
# ICCID/IMSI/Ki/HPLMN ( 3f00/7f4d/8f0d )
|
||||||
self._sl.update_record('8f0d', 1,
|
v = ''
|
||||||
rpad(
|
|
||||||
# ICCID
|
|
||||||
'3f00' + '2fe2' + '0a' + self._e_iccid(p['iccid']) +
|
|
||||||
|
|
||||||
# IMSI
|
# inline Ki
|
||||||
'7f20' + '6f07' + '09' + self._e_imsi(p['imsi']) +
|
if self._ki_file is None:
|
||||||
|
v += p['ki']
|
||||||
|
|
||||||
# Ki
|
# ICCID
|
||||||
'6f1b' + '10' + p['ki'] +
|
v += '3f00' + '2fe2' + '0a' + self._e_iccid(p['iccid'])
|
||||||
|
|
||||||
# PLMN_Sel
|
# IMSI
|
||||||
'6f30' + '18' + rpad(hplmn, 36)
|
v += '7f20' + '6f07' + '09' + self._e_imsi(p['imsi'])
|
||||||
|
|
||||||
, self._files['b_ef'][1]*2)
|
# Ki
|
||||||
|
if self._ki_file:
|
||||||
|
v += self._ki_file + '10' + p['ki']
|
||||||
|
|
||||||
|
# PLMN_Sel
|
||||||
|
v+= '6f30' + '18' + rpad(hplmn, 36)
|
||||||
|
|
||||||
|
self._sl.update_record(self._files['b_ef'][0], 1,
|
||||||
|
rpad(v, self._files['b_ef'][1]*2)
|
||||||
)
|
)
|
||||||
|
|
||||||
# SMSP ( 3f00/7f4d/8f0e )
|
# SMSP ( 3f00/7f4d/8f0e )
|
||||||
@@ -465,6 +471,8 @@ class SuperSim(_MagicSimBase):
|
|||||||
'r_ef' : ('8f0e', 50, True),
|
'r_ef' : ('8f0e', 50, True),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_ki_file = None
|
||||||
|
|
||||||
|
|
||||||
class MagicSim(_MagicSimBase):
|
class MagicSim(_MagicSimBase):
|
||||||
|
|
||||||
@@ -476,6 +484,8 @@ class MagicSim(_MagicSimBase):
|
|||||||
'r_ef' : ('8f0e', 102, False),
|
'r_ef' : ('8f0e', 102, False),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_ki_file = '6f1b'
|
||||||
|
|
||||||
|
|
||||||
class FakeMagicSim(Card):
|
class FakeMagicSim(Card):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user