From bedab1388d590fccd7fa0bb54a6ea9b19d54a5f7 Mon Sep 17 00:00:00 2001 From: danogentili Date: Thu, 15 Sep 2016 15:00:08 +0200 Subject: [PATCH] Fixed salt --- src/danog/MadelineProto/API.php | 6 ++++-- src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php | 2 +- src/danog/MadelineProto/MTProtoTools/CallHandler.php | 1 - src/danog/MadelineProto/MTProtoTools/MessageHandler.php | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/danog/MadelineProto/API.php b/src/danog/MadelineProto/API.php index 6779a98b..9219b712 100644 --- a/src/danog/MadelineProto/API.php +++ b/src/danog/MadelineProto/API.php @@ -20,10 +20,12 @@ class API { set_error_handler(['\danog\MadelineProto\Exception', 'ExceptionErrorHandler']); $this->session = new MTProto($params); - $future_salts = $this->get_future_salts(3); - var_dump($future_salts); $future_salts = $this->ping(3); var_dump($future_salts); + $future_salts = $this->get_future_salts(3); + var_dump($this->session->incoming_messages); + + var_dump($future_salts); } public function __destruct() diff --git a/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php b/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php index 62b37199..db29c6e2 100644 --- a/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php @@ -213,7 +213,7 @@ class AuthKeyHandler extends AckHandler } $this->log->log('Diffie Hellman key exchange processed successfully'); - $res_authorization = ['server_salt' => $this->struct->unpack(' $this->struct->unpack('log->log('Getting response....'); $last_received = $this->recv_message(); $this->handle_message($last_sent, $last_received); - var_dump($this->incoming_messages); if (isset($this->outgoing_messages[$last_sent]['response']) && isset($this->incoming_messages[$this->outgoing_messages[$last_sent]['response']]['content'])) { $response = $this->incoming_messages[$this->outgoing_messages[$last_sent]['response']]['content']; } diff --git a/src/danog/MadelineProto/MTProtoTools/MessageHandler.php b/src/danog/MadelineProto/MTProtoTools/MessageHandler.php index 098a3e1c..9ee8e59d 100644 --- a/src/danog/MadelineProto/MTProtoTools/MessageHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/MessageHandler.php @@ -30,6 +30,7 @@ class MessageHandler extends Crypt $message = \danog\MadelineProto\Tools::string2bin('\x00\x00\x00\x00\x00\x00\x00\x00').$message_id.$this->struct->pack('generate_seq_no($content_related); + var_dump($this->settings['authorization']['temp_auth_key']['server_salt']); $encrypted_data = $this->struct->pack('settings['authorization']['temp_auth_key']['server_salt']).$this->settings['authorization']['session_id'].$message_id.$this->struct->pack('