Browse Source

Fix decoding of SQN values in SYSMO_USIMSJS1_FILE_EF_SQNC

for/master/fixoption
Harald Welte 4 years ago
parent
commit
9b3c122329
  1. 8
      sysmo_usimsjs1.py
  2. 6
      tests/08_seq.out

8
sysmo_usimsjs1.py

@ -150,10 +150,10 @@ class SYSMO_USIMSJS1_FILE_EF_SQNC:
return
if len(content) != 15:
raise ValueError("unexpected length of %u bytes", len(content))
self.ind_size_bits = content[0] >> 4
self.sqn_check_enabled = content[0] & 0x08
self.sqn_age_limit_enabled = bool(content[0] & 0x04)
self.sqn_max_delta_enabled = bool(content[0] & 0x02)
self.ind_size_bits = content[0] & 0xf
self.sqn_check_enabled = bool(content[0] & 0x10)
self.sqn_age_limit_enabled = bool(content[0] & 0x20)
self.sqn_max_delta_enabled = bool(content[0] & 0x40)
self.sqnms_offset = list_to_int(content[1:3])
self.max_delta = list_to_int(content[3:9]) >> self.ind_size_bits
self.age_limit = list_to_int(content[9:15]) >> self.ind_size_bits

6
tests/08_seq.out

@ -17,9 +17,9 @@ Reading Milenage Sequence parameters...
* Initalizing...
* Current SQN Configuration:
IND (bits): 5
SQN Check enabled: 0
SQN Age Limit enabled: 1
SQN Max Delta enabled: 0
SQN Check enabled: 1
SQN Age Limit enabled: 0
SQN Max Delta enabled: 1
SQNms Offset: 0
Max Delta: 268435456
Age Limit: 268435456

Loading…
Cancel
Save