Remove last reference
This commit is contained in:
parent
6b0aaca08c
commit
e78be0ba49
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
namespace danog\MadelineProto\Stream\MTProtoTransport;
|
namespace danog\MadelineProto\Stream\MTProtoTransport;
|
||||||
|
|
||||||
use danog\MadelineProto\Stream\Async\Stream;
|
|
||||||
use danog\MadelineProto\Stream\BufferedProxyStreamInterface;
|
use danog\MadelineProto\Stream\BufferedProxyStreamInterface;
|
||||||
use danog\MadelineProto\Stream\Common\CtrStream;
|
use danog\MadelineProto\Stream\Common\CtrStream;
|
||||||
use danog\MadelineProto\Stream\ConnectionContext;
|
use danog\MadelineProto\Stream\ConnectionContext;
|
||||||
@ -33,7 +32,6 @@ use danog\MadelineProto\Stream\ConnectionContext;
|
|||||||
*/
|
*/
|
||||||
class ObfuscatedStream extends CtrStream implements BufferedProxyStreamInterface
|
class ObfuscatedStream extends CtrStream implements BufferedProxyStreamInterface
|
||||||
{
|
{
|
||||||
use Stream;
|
|
||||||
private $stream;
|
private $stream;
|
||||||
private $extra;
|
private $extra;
|
||||||
/**
|
/**
|
||||||
@ -47,7 +45,7 @@ class ObfuscatedStream extends CtrStream implements BufferedProxyStreamInterface
|
|||||||
{
|
{
|
||||||
if (isset($this->extra['address'])) {
|
if (isset($this->extra['address'])) {
|
||||||
$ctx = $ctx->getCtx();
|
$ctx = $ctx->getCtx();
|
||||||
$ctx->setUri('tcp://' . $this->extra['address'] . ':' . $this->extra['port']);
|
$ctx->setUri('tcp://'.$this->extra['address'].':'.$this->extra['port']);
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
$random = \danog\MadelineProto\Tools::random(64);
|
$random = \danog\MadelineProto\Tools::random(64);
|
||||||
@ -55,14 +53,14 @@ class ObfuscatedStream extends CtrStream implements BufferedProxyStreamInterface
|
|||||||
if (\strlen($header) === 1) {
|
if (\strlen($header) === 1) {
|
||||||
$header = \str_repeat($header, 4);
|
$header = \str_repeat($header, 4);
|
||||||
}
|
}
|
||||||
$random = \substr_replace($random, $header . \substr($random, 56 + \strlen($header)), 56);
|
$random = \substr_replace($random, $header.\substr($random, 56 + \strlen($header)), 56);
|
||||||
$random = \substr_replace($random, \pack('s', $ctx->getIntDc()) . \substr($random, 60 + 2), 60);
|
$random = \substr_replace($random, \pack('s', $ctx->getIntDc()).\substr($random, 60 + 2), 60);
|
||||||
$reversed = \strrev($random);
|
$reversed = \strrev($random);
|
||||||
$key = \substr($random, 8, 32);
|
$key = \substr($random, 8, 32);
|
||||||
$keyRev = \substr($reversed, 8, 32);
|
$keyRev = \substr($reversed, 8, 32);
|
||||||
if (isset($this->extra['secret'])) {
|
if (isset($this->extra['secret'])) {
|
||||||
$key = \hash('sha256', $key . $this->extra['secret'], true);
|
$key = \hash('sha256', $key.$this->extra['secret'], true);
|
||||||
$keyRev = \hash('sha256', $keyRev . $this->extra['secret'], true);
|
$keyRev = \hash('sha256', $keyRev.$this->extra['secret'], true);
|
||||||
}
|
}
|
||||||
$iv = \substr($random, 40, 16);
|
$iv = \substr($random, 40, 16);
|
||||||
$ivRev = \substr($reversed, 40, 16);
|
$ivRev = \substr($reversed, 40, 16);
|
||||||
|
Loading…
Reference in New Issue
Block a user