Fix decoding of SQN values in SYSMO_USIMSJS1_FILE_EF_SQNC

This commit is contained in:
Harald Welte 2017-08-17 13:15:39 +02:00
parent d7da172cbf
commit 9b3c122329
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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