From b42b4bb3267bcbce297d79fc2f292f0fc548fb87 Mon Sep 17 00:00:00 2001 From: Maxim Smirnov Date: Fri, 24 Nov 2017 20:47:36 +0300 Subject: [PATCH] Add OpenSSL assertion on authenticator.py (#453) aes_ige.c(88): OpenSSL internal error, assertion failed --- telethon/network/authenticator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/telethon/network/authenticator.py b/telethon/network/authenticator.py index 1accf493..8c508ef9 100644 --- a/telethon/network/authenticator.py +++ b/telethon/network/authenticator.py @@ -113,6 +113,8 @@ def _do_authentication(connection): key, iv = utils.generate_key_data_from_nonce( res_pq.server_nonce, new_nonce ) + if server_dh_params.encrypted_answer % 16 != 0: + raise SecurityError('AES block size missmatch') plain_text_answer = AES.decrypt_ige( server_dh_params.encrypted_answer, key, iv )