Browse Source

Divide SQNms Offset by 6

The SQNms offset is a *byte* index into the SQNA file, let's divide
this by 6 before showing it to the user, so he can immediately
make the connection into the SQN array dumped below
for/master/fixoption
Harald Welte 4 years ago
parent
commit
5c15b238f5
  1. 4
      sysmo_usimsjs1.py
  2. 2
      tests/08_seq.out

4
sysmo_usimsjs1.py

@ -154,7 +154,7 @@ class SYSMO_USIMSJS1_FILE_EF_SQNC:
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.sqnms_offset = list_to_int(content[1:3])/6
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
@ -166,7 +166,7 @@ class SYSMO_USIMSJS1_FILE_EF_SQNC:
dump += "%sSQN Check enabled: %u\n" % (pfx, self.sqn_check_enabled)
dump += "%sSQN Age Limit enabled: %u\n" % (pfx, self.sqn_age_limit_enabled)
dump += "%sSQN Max Delta enabled: %u\n" % (pfx, self.sqn_max_delta_enabled)
dump += "%sSQNms Offset: %u\n" % (pfx, self.sqnms_offset)
dump += "%sSQNms Offset (into SQN array): %u\n" % (pfx, self.sqnms_offset)
dump += "%sMax Delta: %u\n" % (pfx, self.max_delta)
dump += "%sAge Limit: %u\n" % (pfx, self.age_limit)
return dump

2
tests/08_seq.out

@ -20,7 +20,7 @@ Reading Milenage Sequence parameters...
SQN Check enabled: 1
SQN Age Limit enabled: 0
SQN Max Delta enabled: 1
SQNms Offset: 0
SQNms Offset (into SQN array): 0
Max Delta: 268435456
Age Limit: 268435456

Loading…
Cancel
Save