mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 13:29:47 +00:00
Use autogen code on the authenticator instead hardcoding requests
This commit is contained in:
@@ -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('<BQ', number, self.aux_hash)
|
||||
return utils.calc_msg_key(data)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import struct
|
||||
from hashlib import sha1
|
||||
try:
|
||||
import rsa
|
||||
@@ -37,7 +38,7 @@ def _compute_fingerprint(key):
|
||||
n = TLObject.serialize_bytes(get_byte_array(key.n))
|
||||
e = TLObject.serialize_bytes(get_byte_array(key.e))
|
||||
# Telegram uses the last 8 bytes as the fingerprint
|
||||
return sha1(n + e).digest()[-8:]
|
||||
return struct.unpack('<q', sha1(n + e).digest()[-8:])[0]
|
||||
|
||||
|
||||
def add_key(pub):
|
||||
|
Reference in New Issue
Block a user