laforge submitted this change.
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
---
M pySim/sysmocom_sja2.py
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/pySim/sysmocom_sja2.py b/pySim/sysmocom_sja2.py
index 8b1fc04..1bd4a8a 100644
--- a/pySim/sysmocom_sja2.py
+++ b/pySim/sysmocom_sja2.py
@@ -207,7 +207,7 @@
'tuak_cfg'/TuakCfgByte,
'num_of_keccak_iterations'/Int8ub,
'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:
if raw_bin_data[0] & 0x0F == 0x06:
To view, visit change 33234. To unsubscribe, or for help writing mail filters, visit settings.