Update Telegram's RSA keys

This commit is contained in:
Lonami Exo
2019-10-03 20:51:45 +02:00
parent 72dd36bc17
commit 09f27f0dd7
2 changed files with 59 additions and 8 deletions

View File

@@ -56,6 +56,14 @@ async def do_authentication(sender):
target_fingerprint = fingerprint
break
if cipher_text is None:
# Second attempt, but now we're allowed to use old keys
for fingerprint in res_pq.server_public_key_fingerprints:
cipher_text = rsa.encrypt(fingerprint, pq_inner_data, use_old=True)
if cipher_text is not None:
target_fingerprint = fingerprint
break
if cipher_text is None:
raise SecurityError(
'Step 2 could not find a valid key for fingerprints: {}'