mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Extend new_algo.salt1 to fix edit_2fa (#1072)
The salt1 that is sent to the server requires an additional 32 bytes of random data. It's easy to miss this requirement from reading the tdesktop source, because this extension is done in a function called `ValidateNewCloudPasswordAlgo`. https://github.com/telegramdesktop/tdesktop/blob/2e5a0e056cdb40d61d487c6062bffe1a835f 6ddd/Telegram/SourceFiles/core/core_cloud_password.cpp#L210-L211
This commit is contained in:
parent
deb6ca0da0
commit
b0e0bc3701
|
@ -467,6 +467,7 @@ class AuthMethods(MessageParseMethods, UserMethods):
|
|||
return False
|
||||
|
||||
pwd = await self(functions.account.GetPasswordRequest())
|
||||
pwd.new_algo.salt1 += os.urandom(32)
|
||||
assert isinstance(pwd, types.account.Password)
|
||||
if not pwd.has_password and current_password:
|
||||
current_password = None
|
||||
|
|
Loading…
Reference in New Issue
Block a user