chuni: fixing the network encryption for Sun Plus

This commit is contained in:
Midorica 2023-12-15 22:22:36 -05:00
parent 37b1f41b44
commit bf7d709b49

View File

@ -101,8 +101,14 @@ class ChuniServlet(BaseServlet):
]
for method in method_list:
method_fixed = inflection.camelize(method)[6:-7]
# number of iterations was changed to 70 in SUN
iter_count = 70 if version >= ChuniConstants.VER_CHUNITHM_SUN else 44
# number of iterations was changed to 70 in SUN and then to 36
if version == ChuniConstants.VER_CHUNITHM_SUN_PLUS:
iter_count = 36
elif version == ChuniConstants.VER_CHUNITHM_SUN:
iter_count = 70
else:
iter_count = 44
hash = PBKDF2(
method_fixed,
bytes.fromhex(keys[2]),