src/Handlers/SERVICE/REQUEST.php
public function handle(
        $msgType,
        \fpoirotte\Pssht\Wire\Decoder $decoder,
        \fpoirotte\Pssht\Transport $transport,
        array &$context
    ) {
        $message    = \fpoirotte\Pssht\Messages\SERVICE\REQUEST::unserialize($decoder);
        $service    = $message->getServiceName();

        if ($service === 'ssh-userauth') {
            $response = new \fpoirotte\Pssht\Messages\SERVICE\ACCEPT($service);
            $transport->setHandler(
                \fpoirotte\Pssht\Messages\USERAUTH\REQUEST\Base::getMessageId(),
                $this->userAuthRequestHandler
            );
        } else {
            $response = new DISCONNECT(
                DISCONNECT::SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
                'No such service'
            );
        }
        $transport->writeMessage($response);
        return true;
    }
public function handle(
        $msgType,
        \fpoirotte\Pssht\Wire\Decoder $decoder,
        \fpoirotte\Pssht\Transport $transport,
        array &$context
    ) {
        $message    = \fpoirotte\Pssht\Messages\SERVICE\REQUEST::unserialize($decoder);
        $service    = $message->getServiceName();

        if ($service === 'ssh-userauth') {
            $response = new \fpoirotte\Pssht\Messages\SERVICE\ACCEPT($service);
            $transport->setHandler(
                \fpoirotte\Pssht\Messages\USERAUTH\REQUEST\Base::getMessageId(),
                $this->userAuthRequestHandler
            );
        } else {
            $response = new DISCONNECT(
                DISCONNECT::SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
                'No such service'
            );
        }
        $transport->writeMessage($response);
        return true;
    }
public function handle ( $ msgType , \ fpoirotte \ Pssht \ Wire \ Decoder $ decoder , \ fpoirotte \ Pssht \ Transport $ transport , array & $ context ) { $ message = \ fpoirotte \ Pssht \ Messages \ SERVICE \ REQUEST :: unserialize ( $ decoder ) ; $ service = $ message -> getServiceName ( ) ; if ( $ service === 'ssh-userauth' ) { $ response = new \ fpoirotte \ Pssht \ Messages \ SERVICE \ ACCEPT ( $ service ) ; $ transport -> setHandler ( \ fpoirotte \ Pssht \ Messages \ USERAUTH \ REQUEST \ Base :: getMessageId ( ) , $ this -> userAuthRequestHandler ) ; } else { $ response = new DISCONNECT ( DISCONNECT :: SSH_DISCONNECT_SERVICE_NOT_AVAILABLE , 'No such service' ) ; } $ transport -> writeMessage ( $ response ) ; return true ; }
SSH_MSG_SERVICE_REQUEST = 5
SSH_MSG_SERVICE_REQUEST = 5