From c3efc36be2556551afaa8a88504bfe6b52eb8a7c Mon Sep 17 00:00:00 2001 From: beerpsi Date: Wed, 12 Jun 2024 16:08:12 +0700 Subject: [PATCH] [chuni] Add correct endpoint `iter_count`s for all versions with encryption --- titles/chuni/index.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/titles/chuni/index.py b/titles/chuni/index.py index f0f1eac..e030004 100644 --- a/titles/chuni/index.py +++ b/titles/chuni/index.py @@ -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)) \ No newline at end of file + return Response(crypt.encrypt(padded))