Fix dd mode in MTProxies (#1157)

This commit is contained in:
yegor 2019-04-19 23:09:22 +03:00 committed by Lonami
parent a7b4794585
commit 8edbfbdced

View File

@ -36,7 +36,7 @@ class MTProxyIO:
if is_dd and not is_rand_codec: if is_dd and not is_rand_codec:
raise ValueError( raise ValueError(
"Only RandomizedIntermediate can be used with dd-secrets") "Only RandomizedIntermediate can be used with dd-secrets")
secret = secret[:-1] if is_dd else secret secret = secret[1:] if is_dd else secret
if len(secret) != 16: if len(secret) != 16:
raise ValueError( raise ValueError(
"MTProxy secret must be a hex-string representing 16 bytes") "MTProxy secret must be a hex-string representing 16 bytes")