Extend new_algo.salt1 to fix edit_2fa

Apparently the salt1 you send 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`.

2e5a0e056c/Telegram/SourceFiles/core/core_cloud_password.cpp (L210-L211)
This commit is contained in:
Aaron Gallagher 2018-12-24 12:10:32 -08:00 committed by GitHub
parent deb6ca0da0
commit 58e5feaf7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -467,6 +467,7 @@ class AuthMethods(MessageParseMethods, UserMethods):
return False return False
pwd = await self(functions.account.GetPasswordRequest()) pwd = await self(functions.account.GetPasswordRequest())
pwd.new_algo.salt1 += os.urandom(32)
assert isinstance(pwd, types.account.Password) assert isinstance(pwd, types.account.Password)
if not pwd.has_password and current_password: if not pwd.has_password and current_password:
current_password = None current_password = None