SonderXiaoming/kanna_connection_redive

绑定失败未知错误:未知错误Incorrect AES key length (0 bytes)

moeKedama opened this issue · 1 comments

尝试绑定账号的时候失败了,上个月还好的,可能是key有更改?(不是很懂,猜的)

2023-12-23 23:45:10.841 | INFO     | hoshino.modules.kanna_connection_redive.bsgamesdk:login:67 - 无需验证码登录成功
2023-12-23 23:45:10.841 | INFO     | hoshino.modules.kanna_connection_redive.bsgamesdk:b_login:90 - geetest or captcha succeed
2023-12-23 23:45:10.967 | INFO     | hoshino.modules.kanna_connection_redive.pcrclient:login:175 - using manifest ver = 202312131906
Traceback (most recent call last):
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\hoshino\modules\kanna_connection_redive\pcrclient.py", line 114, in callapi
    response = pcrclient.unpack(
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\hoshino\modules\kanna_connection_redive\pcrclient.py", line 99, in unpack
    aes = AES.new(data[-32:], AES.MODE_CBC, b'ha4nBYA2APUD6Uv1')
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\venv\lib\site-packages\Crypto\Cipher\AES.py", line 228, in new
    return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs)
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\venv\lib\site-packages\Crypto\Cipher\__init__.py", line 79, in _create_cipher
    return modes[mode](factory, **kwargs)
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\venv\lib\site-packages\Crypto\Cipher\_mode_cbc.py", line 274, in _create_cbc_cipher
    cipher_state = factory._create_base_cipher(kwargs)
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\venv\lib\site-packages\Crypto\Cipher\AES.py", line 90, in _create_base_cipher
    raise ValueError("Incorrect AES key length (%d bytes)" % len(key))
ValueError: Incorrect AES key length (0 bytes)

[2023-12-23 23:45:11,984 nonebot] INFO: Traceback (most recent call last):
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\hoshino\modules\kanna_connection_redive\pcrclient.py", line 114, in callapi
    response = pcrclient.unpack(
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\hoshino\modules\kanna_connection_redive\pcrclient.py", line 99, in unpack
    aes = AES.new(data[-32:], AES.MODE_CBC, b'ha4nBYA2APUD6Uv1')
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\venv\lib\site-packages\Crypto\Cipher\AES.py", line 228, in new
    return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs)
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\venv\lib\site-packages\Crypto\Cipher\__init__.py", line 79, in _create_cipher
    return modes[mode](factory, **kwargs)
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\venv\lib\site-packages\Crypto\Cipher\_mode_cbc.py", line 274, in _create_cbc_cipher
    cipher_state = factory._create_base_cipher(kwargs)
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\venv\lib\site-packages\Crypto\Cipher\AES.py", line 90, in _create_base_cipher
    raise ValueError("Incorrect AES key length (%d bytes)" % len(key))
ValueError: Incorrect AES key length (0 bytes)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\hoshino\modules\kanna_connection_redive\login.py", line 77, in query
    await client.login()
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\hoshino\modules\kanna_connection_redive\pcrclient.py", line 181, in login
    await self.callapi('/check/check_agreement', {})
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\hoshino\modules\kanna_connection_redive\pcrclient.py", line 136, in callapi
    raise ApiException("未知错误" + str(e), 501)
hoshino.modules.kanna_connection_redive.pcrclient.ApiException: 未知错误Incorrect AES key length (0 bytes)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\hoshino\modules\kanna_connection_redive\login.py", line 97, in bind_support
    client = await query([acccount.copy()], True)
  File "C:\Users\Administrator\kedama-bots\HoshinoBot\hoshino\modules\kanna_connection_redive\login.py", line 83, in query
    raise Exception(f"未知错误:{e}")
Exception: 未知错误:未知错误Incorrect AES key length (0 bytes)

原来pcrjjc_huannai2下已经改了
注释掉pcrclient.py中的await self.callapi('/check/check_agreement', {})就解决了

问题已解决