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:
Harald Welte 2023-06-08 17:18:31 +02:00
parent 7ec822373e
commit 19b4a971e9
1 changed files with 1 additions and 1 deletions

View File

@ -207,7 +207,7 @@ class EF_USIM_AUTH_KEY(TransparentEF):
'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: