mirror of
https://gitea.tendokyu.moe/Hay1tsme/artemis.git
synced 2026-02-12 02:37:28 +08:00
sao: fix length calculation
This commit is contained in:
@@ -135,7 +135,7 @@ class SaoServlet(BaseServlet):
|
|||||||
|
|
||||||
cipher = Blowfish.new(self.game_cfg.crypt.key.encode(), Blowfish.MODE_CBC, iv)
|
cipher = Blowfish.new(self.game_cfg.crypt.key.encode(), Blowfish.MODE_CBC, iv)
|
||||||
data_crypt = cipher.encrypt(data_to_crypt)
|
data_crypt = cipher.encrypt(data_to_crypt)
|
||||||
crypt_data_len = len(data_crypt)
|
crypt_data_len = len(data_crypt) + len(iv)
|
||||||
tmp = struct.pack("!I", crypt_data_len) # does it want the length of the encrypted response??
|
tmp = struct.pack("!I", crypt_data_len) # does it want the length of the encrypted response??
|
||||||
resp = resp[:20] + tmp + iv + data_crypt
|
resp = resp[:20] + tmp + iv + data_crypt
|
||||||
self.logger.debug(f"Encrypted Response: {resp.hex()}")
|
self.logger.debug(f"Encrypted Response: {resp.hex()}")
|
||||||
|
|||||||
Reference in New Issue
Block a user