[chuni] Add correct endpoint iter_counts for all versions with encryption

This commit is contained in:
beerpsi 2024-06-12 16:08:12 +07:00
parent eaab3728c4
commit c3efc36be2

View File

@ -107,8 +107,23 @@ class ChuniServlet(BaseServlet):
iter_count = 36
elif version == ChuniConstants.VER_CHUNITHM_SUN:
iter_count = 70
else:
elif version == ChuniConstants.VER_CHUNITHM_NEW_PLUS:
iter_count = 25
elif version == ChuniConstants.VER_CHUNITHM_NEW:
iter_count = 54
elif version == ChuniConstants.VER_CHUNITHM_PARADISE:
iter_count = 44
elif version == ChuniConstants.VER_CHUNITHM_CRYSTAL_PLUS:
iter_count = 67
else:
disp_version = (
ChuniConstants.VERSION_NAMES[version]
if version in ChuniConstants.VERSION_NAMES
else str(version)
)
self.logger.warning("Version %s does not support encryption", disp_version)
continue
hash = PBKDF2(
method_fixed,
@ -313,4 +328,4 @@ class ChuniServlet(BaseServlet):
bytes.fromhex(self.game_cfg.crypto.keys[internal_ver][1]),
)
return Response(crypt.encrypt(padded))
return Response(crypt.encrypt(padded))