Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 1 | # coding=utf-8 |
Harald Welte | 0489ae6 | 2023-05-24 10:28:34 +0200 | [diff] [blame] | 2 | """Utilities / Functions related to sysmocom SJA2/SJA5 cards |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 3 | |
Harald Welte | 0489ae6 | 2023-05-24 10:28:34 +0200 | [diff] [blame] | 4 | (C) 2021-2023 by Harald Welte <laforge@osmocom.org> |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 5 | |
| 6 | This program is free software: you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation, either version 2 of the License, or |
| 9 | (at your option) any later version. |
| 10 | |
| 11 | This program is distributed in the hope that it will be useful, |
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | GNU General Public License for more details. |
| 15 | |
| 16 | You should have received a copy of the GNU General Public License |
| 17 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | """ |
| 19 | |
| 20 | from pytlv.TLV import * |
| 21 | from struct import pack, unpack |
| 22 | from pySim.utils import * |
| 23 | from pySim.filesystem import * |
| 24 | from pySim.ts_102_221 import CardProfileUICC |
| 25 | from pySim.construct import * |
| 26 | from construct import * |
| 27 | import pySim |
| 28 | |
| 29 | key_type2str = { |
| 30 | 0: 'kic', |
| 31 | 1: 'kid', |
| 32 | 2: 'kik', |
| 33 | 3: 'any', |
| 34 | } |
| 35 | |
| 36 | key_algo2str = { |
| 37 | 0: 'des', |
| 38 | 1: 'aes' |
| 39 | } |
| 40 | |
| 41 | mac_length = { |
| 42 | 0: 8, |
| 43 | 1: 4 |
| 44 | } |
| 45 | |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 46 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 47 | class EF_PIN(TransparentEF): |
| 48 | def __init__(self, fid, name): |
| 49 | super().__init__(fid, name=name, desc='%s PIN file' % name) |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 50 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 51 | def _decode_bin(self, raw_bin_data): |
| 52 | u = unpack('!BBB8s', raw_bin_data[:11]) |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 53 | res = {'enabled': (True, False)[u[0] & 0x01], |
| 54 | 'initialized': (True, False)[u[0] & 0x02], |
| 55 | 'disable_able': (False, True)[u[0] & 0x10], |
| 56 | 'unblock_able': (False, True)[u[0] & 0x20], |
| 57 | 'change_able': (False, True)[u[0] & 0x40], |
| 58 | 'valid': (False, True)[u[0] & 0x80], |
| 59 | 'attempts_remaining': u[1], |
| 60 | 'maximum_attempts': u[2], |
| 61 | 'pin': u[3].hex(), |
| 62 | } |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 63 | if len(raw_bin_data) == 21: |
| 64 | u2 = unpack('!BB8s', raw_bin_data[11:10]) |
| 65 | res['attempts_remaining_puk'] = u2[0] |
| 66 | res['maximum_attempts_puk'] = u2[1] |
| 67 | res['puk'] = u2[2].hex() |
| 68 | return res |
| 69 | |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 70 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 71 | class EF_MILENAGE_CFG(TransparentEF): |
| 72 | def __init__(self, fid='6f21', name='EF.MILENAGE_CFG', desc='Milenage connfiguration'): |
| 73 | super().__init__(fid, name=name, desc=desc) |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 74 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 75 | def _decode_bin(self, raw_bin_data): |
| 76 | u = unpack('!BBBBB16s16s16s16s16s', raw_bin_data) |
| 77 | return {'r1': u[0], 'r2': u[1], 'r3': u[2], 'r4': u[3], 'r5': u[4], |
| 78 | 'c1': u[5].hex(), |
| 79 | 'c2': u[6].hex(), |
| 80 | 'c3': u[7].hex(), |
| 81 | 'c4': u[8].hex(), |
| 82 | 'c5': u[9].hex(), |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 83 | } |
| 84 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 85 | |
| 86 | class EF_0348_KEY(LinFixedEF): |
| 87 | def __init__(self, fid='6f22', name='EF.0348_KEY', desc='TS 03.48 OTA Keys'): |
Harald Welte | 99e4cc0 | 2022-07-21 15:25:47 +0200 | [diff] [blame] | 88 | super().__init__(fid, name=name, desc=desc, rec_len=(27, 35)) |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 89 | |
Harald Welte | f6b37af | 2023-01-24 15:42:26 +0100 | [diff] [blame] | 90 | def _decode_record_bin(self, raw_bin_data, **kwargs): |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 91 | u = unpack('!BBB', raw_bin_data[0:3]) |
| 92 | key_algo = (u[2] >> 6) & 1 |
| 93 | key_length = ((u[2] >> 3) & 3) * 8 |
| 94 | return {'sec_domain': u[0], |
| 95 | 'key_set_version': u[1], |
| 96 | 'key_type': key_type2str[u[2] & 3], |
| 97 | 'key_length': key_length, |
| 98 | 'algorithm': key_algo2str[key_algo], |
| 99 | 'mac_length': mac_length[(u[2] >> 7)], |
| 100 | 'key': raw_bin_data[3:key_length].hex() |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 101 | } |
| 102 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 103 | |
| 104 | class EF_0348_COUNT(LinFixedEF): |
| 105 | def __init__(self, fid='6f23', name='EF.0348_COUNT', desc='TS 03.48 OTA Counters'): |
Harald Welte | 99e4cc0 | 2022-07-21 15:25:47 +0200 | [diff] [blame] | 106 | super().__init__(fid, name=name, desc=desc, rec_len=(7, 7)) |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 107 | |
Harald Welte | f6b37af | 2023-01-24 15:42:26 +0100 | [diff] [blame] | 108 | def _decode_record_bin(self, raw_bin_data, **kwargs): |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 109 | u = unpack('!BB5s', raw_bin_data) |
| 110 | return {'sec_domain': u[0], 'key_set_version': u[1], 'counter': u[2]} |
| 111 | |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 112 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 113 | class EF_SIM_AUTH_COUNTER(TransparentEF): |
| 114 | def __init__(self, fid='af24', name='EF.SIM_AUTH_COUNTER'): |
| 115 | super().__init__(fid, name=name, desc='Number of remaining RUN GSM ALGORITHM executions') |
| 116 | self._construct = Struct('num_run_gsm_algo_remain'/Int32ub) |
| 117 | |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 118 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 119 | class EF_GP_COUNT(LinFixedEF): |
| 120 | def __init__(self, fid='6f26', name='EF.GP_COUNT', desc='GP SCP02 Counters'): |
Harald Welte | 99e4cc0 | 2022-07-21 15:25:47 +0200 | [diff] [blame] | 121 | super().__init__(fid, name=name, desc=desc, rec_len=(5, 5)) |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 122 | |
Harald Welte | f6b37af | 2023-01-24 15:42:26 +0100 | [diff] [blame] | 123 | def _decode_record_bin(self, raw_bin_data, **kwargs): |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 124 | u = unpack('!BBHB', raw_bin_data) |
| 125 | return {'sec_domain': u[0], 'key_set_version': u[1], 'counter': u[2], 'rfu': u[3]} |
| 126 | |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 127 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 128 | class EF_GP_DIV_DATA(LinFixedEF): |
| 129 | def __init__(self, fid='6f27', name='EF.GP_DIV_DATA', desc='GP SCP02 key diversification data'): |
Harald Welte | 99e4cc0 | 2022-07-21 15:25:47 +0200 | [diff] [blame] | 130 | super().__init__(fid, name=name, desc=desc, rec_len=(12, 12)) |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 131 | |
Harald Welte | f6b37af | 2023-01-24 15:42:26 +0100 | [diff] [blame] | 132 | def _decode_record_bin(self, raw_bin_data, **kwargs): |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 133 | u = unpack('!BB8s', raw_bin_data) |
| 134 | return {'sec_domain': u[0], 'key_set_version': u[1], 'key_div_data': u[2].hex()} |
| 135 | |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 136 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 137 | class EF_SIM_AUTH_KEY(TransparentEF): |
| 138 | def __init__(self, fid='6f20', name='EF.SIM_AUTH_KEY'): |
| 139 | super().__init__(fid, name=name, desc='USIM authentication key') |
Harald Welte | cfa3015 | 2022-07-22 17:12:27 +0200 | [diff] [blame] | 140 | CfgByte = BitStruct(Padding(2), |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 141 | 'use_sres_deriv_func_2'/Bit, |
| 142 | 'use_opc_instead_of_op'/Bit, |
| 143 | 'algorithm'/Enum(Nibble, milenage=4, comp128v1=1, comp128v2=2, comp128v3=3)) |
| 144 | self._construct = Struct('cfg'/CfgByte, |
Harald Welte | 3c98d5e | 2022-07-20 07:40:05 +0200 | [diff] [blame] | 145 | 'key'/HexAdapter(Bytes(16)), |
Philipp Maier | 4f888a0 | 2022-12-02 12:30:12 +0100 | [diff] [blame] | 146 | 'op_opc' /HexAdapter(Bytes(16))) |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 147 | |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 148 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 149 | class DF_SYSTEM(CardDF): |
| 150 | def __init__(self): |
| 151 | super().__init__(fid='a515', name='DF.SYSTEM', desc='CardOS specifics') |
| 152 | files = [ |
| 153 | EF_PIN('6f01', 'EF.CHV1'), |
| 154 | EF_PIN('6f81', 'EF.CHV2'), |
| 155 | EF_PIN('6f0a', 'EF.ADM1'), |
| 156 | EF_PIN('6f0b', 'EF.ADM2'), |
| 157 | EF_PIN('6f0c', 'EF.ADM3'), |
| 158 | EF_PIN('6f0d', 'EF.ADM4'), |
| 159 | EF_MILENAGE_CFG(), |
| 160 | EF_0348_KEY(), |
| 161 | EF_SIM_AUTH_COUNTER(), |
| 162 | EF_SIM_AUTH_KEY(), |
| 163 | EF_0348_COUNT(), |
| 164 | EF_GP_COUNT(), |
| 165 | EF_GP_DIV_DATA(), |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 166 | ] |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 167 | self.add_files(files) |
| 168 | |
| 169 | def decode_select_response(self, resp_hex): |
Philipp Maier | 5998a3a | 2021-11-16 15:16:39 +0100 | [diff] [blame] | 170 | return pySim.ts_102_221.CardProfileUICC.decode_select_response(resp_hex) |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 171 | |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 172 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 173 | class EF_USIM_SQN(TransparentEF): |
| 174 | def __init__(self, fid='af30', name='EF.USIM_SQN'): |
| 175 | super().__init__(fid, name=name, desc='SQN parameters for AKA') |
| 176 | Flag1 = BitStruct('skip_next_sqn_check'/Bit, 'delta_max_check'/Bit, |
| 177 | 'age_limit_check'/Bit, 'sqn_check'/Bit, |
| 178 | 'ind_len'/BitsInteger(4)) |
| 179 | Flag2 = BitStruct('rfu'/BitsRFU(5), 'dont_clear_amf_for_macs'/Bit, |
| 180 | 'aus_concealed'/Bit, 'autn_concealed'/Bit) |
| 181 | self._construct = Struct('flag1'/Flag1, 'flag2'/Flag2, |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 182 | 'delta_max' / |
| 183 | BytesInteger(6), 'age_limit'/BytesInteger(6), |
Harald Welte | eb45838 | 2021-10-16 10:44:23 +0200 | [diff] [blame] | 184 | 'freshness'/GreedyRange(BytesInteger(6))) |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 185 | |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 186 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 187 | class EF_USIM_AUTH_KEY(TransparentEF): |
| 188 | def __init__(self, fid='af20', name='EF.USIM_AUTH_KEY'): |
| 189 | super().__init__(fid, name=name, desc='USIM authentication key') |
Harald Welte | cfa3015 | 2022-07-22 17:12:27 +0200 | [diff] [blame] | 190 | CfgByte = BitStruct(Padding(1), 'only_4bytes_res_in_3g'/Bit, |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 191 | 'use_sres_deriv_func_2_in_3g'/Bit, |
| 192 | 'use_opc_instead_of_op'/Bit, |
| 193 | 'algorithm'/Enum(Nibble, milenage=4, sha1_aka=5, xor=15)) |
| 194 | self._construct = Struct('cfg'/CfgByte, |
Harald Welte | 3c98d5e | 2022-07-20 07:40:05 +0200 | [diff] [blame] | 195 | 'key'/HexAdapter(Bytes(16)), |
Philipp Maier | 4f888a0 | 2022-12-02 12:30:12 +0100 | [diff] [blame] | 196 | 'op_opc' /HexAdapter(Bytes(16))) |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 197 | |
| 198 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 199 | class EF_USIM_AUTH_KEY_2G(TransparentEF): |
| 200 | def __init__(self, fid='af22', name='EF.USIM_AUTH_KEY_2G'): |
| 201 | super().__init__(fid, name=name, desc='USIM authentication key in 2G context') |
Harald Welte | cfa3015 | 2022-07-22 17:12:27 +0200 | [diff] [blame] | 202 | CfgByte = BitStruct(Padding(1), 'only_4bytes_res_in_3g'/Bit, |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 203 | 'use_sres_deriv_func_2_in_3g'/Bit, |
| 204 | 'use_opc_instead_of_op'/Bit, |
| 205 | 'algorithm'/Enum(Nibble, milenage=4, comp128v1=1, comp128v2=2, comp128v3=3)) |
| 206 | self._construct = Struct('cfg'/CfgByte, |
Harald Welte | 3c98d5e | 2022-07-20 07:40:05 +0200 | [diff] [blame] | 207 | 'key'/HexAdapter(Bytes(16)), |
Philipp Maier | 4f888a0 | 2022-12-02 12:30:12 +0100 | [diff] [blame] | 208 | 'op_opc' /HexAdapter(Bytes(16))) |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 209 | |
| 210 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 211 | class EF_GBA_SK(TransparentEF): |
| 212 | def __init__(self, fid='af31', name='EF.GBA_SK'): |
| 213 | super().__init__(fid, name=name, desc='Secret key for GBA key derivation') |
| 214 | self._construct = GreedyBytes |
| 215 | |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 216 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 217 | class EF_GBA_REC_LIST(TransparentEF): |
| 218 | def __init__(self, fid='af32', name='EF.GBA_REC_LIST'): |
| 219 | super().__init__(fid, name=name, desc='Secret key for GBA key derivation') |
| 220 | # integers representing record numbers in EF-GBANL |
| 221 | self._construct = GreedyRange(Int8ub) |
| 222 | |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 223 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 224 | class EF_GBA_INT_KEY(LinFixedEF): |
| 225 | def __init__(self, fid='af33', name='EF.GBA_INT_KEY'): |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 226 | super().__init__(fid, name=name, |
Harald Welte | 99e4cc0 | 2022-07-21 15:25:47 +0200 | [diff] [blame] | 227 | desc='Secret key for GBA key derivation', rec_len=(32, 32)) |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 228 | self._construct = GreedyBytes |
| 229 | |
| 230 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 231 | class SysmocomSJA2(CardModel): |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 232 | _atrs = ["3B 9F 96 80 1F 87 80 31 E0 73 FE 21 1B 67 4A 4C 75 30 34 05 4B A9", |
| 233 | "3B 9F 96 80 1F 87 80 31 E0 73 FE 21 1B 67 4A 4C 75 31 33 02 51 B2", |
| 234 | "3B 9F 96 80 1F 87 80 31 E0 73 FE 21 1B 67 4A 4C 52 75 31 04 51 D5"] |
| 235 | |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 236 | @classmethod |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 237 | def add_files(cls, rs: RuntimeState): |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 238 | """Add sysmocom SJA2 specific files to given RuntimeState.""" |
| 239 | rs.mf.add_file(DF_SYSTEM()) |
| 240 | # optional USIM application |
| 241 | if 'a0000000871002' in rs.mf.applications: |
| 242 | usim_adf = rs.mf.applications['a0000000871002'] |
| 243 | files_adf_usim = [ |
| 244 | EF_USIM_AUTH_KEY(), |
| 245 | EF_USIM_AUTH_KEY_2G(), |
| 246 | EF_GBA_SK(), |
| 247 | EF_GBA_REC_LIST(), |
| 248 | EF_GBA_INT_KEY(), |
| 249 | EF_USIM_SQN(), |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 250 | ] |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 251 | usim_adf.add_files(files_adf_usim) |
| 252 | # optional ISIM application |
| 253 | if 'a0000000871004' in rs.mf.applications: |
| 254 | isim_adf = rs.mf.applications['a0000000871004'] |
| 255 | files_adf_isim = [ |
| 256 | EF_USIM_AUTH_KEY(name='EF.ISIM_AUTH_KEY'), |
| 257 | EF_USIM_AUTH_KEY_2G(name='EF.ISIM_AUTH_KEY_2G'), |
| 258 | EF_USIM_SQN(name='EF.ISIM_SQN'), |
Harald Welte | c91085e | 2022-02-10 18:05:45 +0100 | [diff] [blame] | 259 | ] |
Harald Welte | f44256c | 2021-10-14 15:53:39 +0200 | [diff] [blame] | 260 | isim_adf.add_files(files_adf_isim) |
Harald Welte | 0489ae6 | 2023-05-24 10:28:34 +0200 | [diff] [blame] | 261 | |
| 262 | class SysmocomSJA5(CardModel): |
| 263 | _atrs = ["3B 9F 96 80 1F 87 80 31 E0 73 FE 21 1B 67 4A 35 75 30 35 02 51 CC", |
| 264 | "3B 9F 96 80 1F 87 80 31 E0 73 FE 21 1B 67 4A 35 75 30 35 02 65 F8", |
| 265 | "3B 9F 96 80 1F 87 80 31 E0 73 FE 21 1B 67 4A 35 75 30 35 02 59 C4"] |
| 266 | |
| 267 | @classmethod |
| 268 | def add_files(cls, rs: RuntimeState): |
| 269 | """Add sysmocom SJA2 specific files to given RuntimeState.""" |
| 270 | rs.mf.add_file(DF_SYSTEM()) |
| 271 | # optional USIM application |
| 272 | if 'a0000000871002' in rs.mf.applications: |
| 273 | usim_adf = rs.mf.applications['a0000000871002'] |
| 274 | files_adf_usim = [ |
| 275 | EF_USIM_AUTH_KEY(), |
| 276 | EF_USIM_AUTH_KEY_2G(), |
| 277 | EF_GBA_SK(), |
| 278 | EF_GBA_REC_LIST(), |
| 279 | EF_GBA_INT_KEY(), |
| 280 | EF_USIM_SQN(), |
| 281 | ] |
| 282 | usim_adf.add_files(files_adf_usim) |
| 283 | # optional ISIM application |
| 284 | if 'a0000000871004' in rs.mf.applications: |
| 285 | isim_adf = rs.mf.applications['a0000000871004'] |
| 286 | files_adf_isim = [ |
| 287 | EF_USIM_AUTH_KEY(name='EF.ISIM_AUTH_KEY'), |
| 288 | EF_USIM_AUTH_KEY_2G(name='EF.ISIM_AUTH_KEY_2G'), |
| 289 | EF_USIM_SQN(name='EF.ISIM_SQN'), |
| 290 | ] |
| 291 | isim_adf.add_files(files_adf_isim) |