mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 17:36:34 +03:00
Add missing nonce check during authentication
This commit is contained in:
parent
d5e6dbe36b
commit
e20203785a
|
@ -78,6 +78,8 @@ def _do_step2(data: Step1, response: bytes, random_bytes: bytes) -> Tuple[bytes,
|
||||||
nonce = data.nonce
|
nonce = data.nonce
|
||||||
res_pq = ResPq.from_bytes(response)
|
res_pq = ResPq.from_bytes(response)
|
||||||
|
|
||||||
|
check_nonce(res_pq.nonce, nonce)
|
||||||
|
|
||||||
if len(res_pq.pq) != 8:
|
if len(res_pq.pq) != 8:
|
||||||
raise ValueError(f"invalid pq size: {len(res_pq.pq)}")
|
raise ValueError(f"invalid pq size: {len(res_pq.pq)}")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user