From fe30f63d5d6f3a295e233cc2720d54ee0a61b4d5 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Thu, 28 Sep 2017 11:36:51 +0200 Subject: [PATCH] Use autogen code on the authenticator instead hardcoding requests --- telethon/crypto/auth_key.py | 1 + telethon/crypto/rsa.py | 3 +- telethon/helpers.py | 8 +- telethon/network/authenticator.py | 269 +++++++++++++----------------- 4 files changed, 125 insertions(+), 156 deletions(-) diff --git a/telethon/crypto/auth_key.py b/telethon/crypto/auth_key.py index 710ebed8..17a7f8ca 100644 --- a/telethon/crypto/auth_key.py +++ b/telethon/crypto/auth_key.py @@ -18,5 +18,6 @@ class AuthKey: """Calculates the new nonce hash based on the current class fields' values """ + new_nonce = new_nonce.to_bytes(32, 'little', signed=True) data = new_nonce + struct.pack('