mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-30 12:25:17 +03:00
SJA5: EF.USIM_AUTH_KEY: Display / enforce proper length TUAK K
The K value in case of TUAK can be 16 or 32 bytes long. We used to permit/parse/display 32 bytes even if only 16 bytes was configured. Let's enforce the correct length of "K". Fixes: OS#6053 Change-Id: Ia0f9a2138f16dce72f3118001e95baa1c80f23ce
This commit is contained in:
@@ -207,7 +207,7 @@ class EF_USIM_AUTH_KEY(TransparentEF):
|
|||||||
'tuak_cfg'/TuakCfgByte,
|
'tuak_cfg'/TuakCfgByte,
|
||||||
'num_of_keccak_iterations'/Int8ub,
|
'num_of_keccak_iterations'/Int8ub,
|
||||||
'op_opc'/HexAdapter(Bytes(32)),
|
'op_opc'/HexAdapter(Bytes(32)),
|
||||||
'k'/HexAdapter(Bytes(32)))
|
'k'/HexAdapter(Bytes(this.cfg.key_length//8)))
|
||||||
|
|
||||||
def _decode_bin(self, raw_bin_data: bytearray) -> dict:
|
def _decode_bin(self, raw_bin_data: bytearray) -> dict:
|
||||||
if raw_bin_data[0] & 0x0F == 0x06:
|
if raw_bin_data[0] & 0x0F == 0x06:
|
||||||
|
|||||||
Reference in New Issue
Block a user