Lines Matching refs:self

208      * @see self::getErrors()
209 * @see self::getLastError()
217 * @see self::getServerIdentification()
225 * @see self::getKexAlgorithims()
233 * @see self::getMethodsNegotiated()
241 * @see self::_key_exchange()
249 * @see self::_key_exchange()
257 * @see self::_key_exchange()
265 * @see self::getServerHostKeyAlgorithms()
277 * @see self::privatekey_login()
285 * @see self::getEncryptionAlgorithmsClient2Server()
293 * @see self::getEncryptionAlgorithmsServer2Client()
301 * @see self::getMACAlgorithmsClient2Server()
309 * @see self::getMACAlgorithmsServer2Client()
317 * @see self::getCompressionAlgorithmsClient2Server()
325 * @see self::getCompressionAlgorithmsServer2Client()
333 * @see self::getLanguagesServer2Client()
341 * @see self::getLanguagesClient2Server()
349 * @see self::setPreferredAlgorithms()
364 * @see self::__construct()
365 * @see self::_send_binary_packet()
373 * @see self::__construct()
374 * @see self::_get_binary_packet()
382 * @see self::_get_binary_packet()
415 * @see self::_get_binary_packet()
423 * @see self::_send_binary_packet()
456 * @see self::_send_binary_packet()
464 * @see self::_send_binary_packet()
486 * @see self::_get_binary_packet()
512 * @see self::_get_binary_packet()
520 * @see self::getServerPublicHostKey()
534 * @see self::_key_exchange()
544 * @see self::_key_exchange()
552 * @see self::__construct()
561 * @see self::__construct()
570 * @see self::__construct()
580 * @see self::__construct()
590 * @see self::__construct()
601 * @see self::_send_binary_packet()
611 * @see self::_get_binary_packet()
621 * @see self::get_channel_packet()
622 * @see self::exec()
633 * @see self::get_channel_packet()
634 * @see self::exec()
644 * @see self::get_channel_packet()
652 * @see self::getInteractiveChannelId()
662 * @see self::send_channel_packet()
670 * @see self::getLog()
678 * @see self::getLog()
689 * @see self::send_channel_packet()
690 * @see self::exec()
702 * @see self::_send_channel_packet()
703 * @see self::exec()
712 * @see self::send_channel_packet()
722 * @see self::get_channel_packet()
732 * @see self::getServerPublicHostKey()
742 * @see self::getServerPublicHostKey()
750 * @see self::read()
758 * Should never exceed self::LOG_MAX_SIZE
760 * @see self::_send_binary_packet()
761 * @see self::_get_binary_packet()
769 * @see self::setTimeout()
776 * @see self::get_channel_packet()
783 * @see self::setKeepAlive()
790 * @see self::_append_log()
798 * @see self::_append_log()
806 * @see self::getServerPublicHostKey()
814 * @see self::_append_log()
822 * @see self::enableQuietMode()
844 * @see self::enablePTY()
858 * @see self::_keyboard_interactive_process()
866 * @see self::_keyboard_interactive_process()
877 * @see self::_filter()
878 * @see self::getBannerMessage()
886 * @see self::isTimeout()
894 * @see self::_format_log()
902 * @see self::_format_log()
910 * @see self::_format_log()
918 * @see self::__construct()
919 * @see self::_connect()
927 * @see self::__construct()
928 * @see self::_connect()
936 * @see self::getWindowColumns()
937 * @see self::setWindowColumns()
938 * @see self::setWindowSize()
946 * @see self::getWindowRows()
947 * @see self::setWindowRows()
948 * @see self::setWindowSize()
956 * @see self::setCryptoEngine()
957 * @see self::_key_exchange()
1046 private $compress = self::NET_SSH2_COMPRESSION_NONE;
1053 private $decompress = self::NET_SSH2_COMPRESSION_NONE;
1125 * @see self::login()
1129 if (empty(self::$message_numbers)) {
1130 self::$message_numbers = [
1162 self::$disconnect_reasons = [
1179 self::$channel_open_failure_reasons = [
1182 self::$terminal_modes = [
1185 self::$channel_extended_data_type_codes = [
1189 self::define_array(
1190 self::$message_numbers,
1191 self::$disconnect_reasons,
1192 self::$channel_open_failure_reasons,
1193 self::$terminal_modes,
1194 self::$channel_extended_data_type_codes,
1215 self::$connections[$this->getResourceId()] = class_exists('WeakReference')
1242 self::$crypto_engine = $engine;
1331 if ($this->bitmap & self::MASK_CONSTRUCTOR) {
1335 $this->bitmap |= self::MASK_CONSTRUCTOR;
1473 $this->bitmap |= self::MASK_CONNECTED;
1656 $decrypt = self::array_intersect_first($s2c_encryption_algorithms, $this->encryption_algorithms_server_to_client);
1663 $encrypt = self::array_intersect_first($c2s_encryption_algorithms, $this->encryption_algorithms_client_to_server);
1671 $this->kex_algorithm = self::array_intersect_first($kex_algorithms, $this->kex_algorithms);
1677 $server_host_key_algorithm = self::array_intersect_first($server_host_key_algorithms, $this->server_host_key_algorithms);
1683 $mac_algorithm_out = self::array_intersect_first($c2s_mac_algorithms, $this->mac_algorithms_client_to_server);
1689 $mac_algorithm_in = self::array_intersect_first($s2c_mac_algorithms, $this->mac_algorithms_server_to_client);
1696 'none' => self::NET_SSH2_COMPRESSION_NONE,
1697 'zlib' => self::NET_SSH2_COMPRESSION_ZLIB,
1698 'zlib@openssh.com' => self::NET_SSH2_COMPRESSION_ZLIB_AT_OPENSSH
1701 $compression_algorithm_in = self::array_intersect_first($s2c_compression_algorithms, $this->compression_algorithms_server_to_client);
1708 $compression_algorithm_out = self::array_intersect_first($c2s_compression_algorithms, $this->compression_algorithms_client_to_server);
1909 $this->encrypt = self::encryption_algorithm_to_crypt_instance($encrypt);
1911 if (self::$crypto_engine) {
1912 $this->encrypt->setPreferredEngine(self::$crypto_engine);
1947 $this->lengthEncrypt = self::encryption_algorithm_to_crypt_instance($encrypt);
1954 $this->decrypt = self::encryption_algorithm_to_crypt_instance($decrypt);
1956 if (self::$crypto_engine) {
1957 $this->decrypt->setPreferredEngine(self::$crypto_engine);
1993 $this->lengthDecrypt = self::encryption_algorithm_to_crypt_instance($decrypt);
2015 list($this->hmac_create, $createKeyLength) = self::mac_algorithm_to_hash_instance($mac_algorithm_out);
2034 list($this->hmac_check, $checkKeyLength) = self::mac_algorithm_to_hash_instance($mac_algorithm_in);
2067 if ($this->bad_key_size_fix && self::bad_algorithm_candidate($algorithm)) {
2215 * @see self::_login()
2242 * @see self::_login_helper()
2246 if (!($this->bitmap & self::MASK_CONSTRUCTOR)) {
2343 if (!($this->bitmap & self::MASK_CONNECTED)) {
2347 if (!($this->bitmap & self::MASK_LOGIN_REQ)) {
2384 $this->bitmap |= self::MASK_LOGIN_REQ;
2401 $this->bitmap |= self::MASK_LOGIN;
2423 $this->bitmap |= self::MASK_LOGIN;
2481 $this->bitmap |= self::MASK_LOGIN;
2488 $this->bitmap |= self::MASK_LOGIN;
2657 $algo = self::array_intersect_first($algos, $this->supported_private_key_algorithms);
2739 $this->bitmap |= self::MASK_LOGIN;
2766 $this->bitmap |= self::MASK_LOGIN;
2821 * If $callback is set to false then \phpseclib3\Net\SSH2::get_channel_packet(self::CHANNEL_EXEC) will need to be called manually.
2843 $this->open_channel(self::CHANNEL_EXEC);
2850 $this->server_channels[self::CHANNEL_EXEC],
2863 $this->channel_status[self::CHANNEL_EXEC] = NET_SSH2_MSG_CHANNEL_REQUEST;
2864 if (!$this->get_channel_packet(self::CHANNEL_EXEC)) {
2882 $this->server_channels[self::CHANNEL_EXEC],
2889 $this->channel_status[self::CHANNEL_EXEC] = NET_SSH2_MSG_CHANNEL_REQUEST;
2891 if (!$this->get_channel_packet(self::CHANNEL_EXEC)) {
2895 $this->channel_status[self::CHANNEL_EXEC] = NET_SSH2_MSG_CHANNEL_DATA;
2898 $this->channel_id_last_interactive = self::CHANNEL_EXEC;
2904 $temp = $this->get_channel_packet(self::CHANNEL_EXEC);
2913 $this->close_channel(self::CHANNEL_EXEC);
2983 * @see self::isShellOpen()
2984 * @see self::read()
2985 * @see self::write()
2997 $this->open_channel(self::CHANNEL_SHELL);
3003 $this->server_channels[self::CHANNEL_SHELL],
3016 $this->channel_status[self::CHANNEL_SHELL] = NET_SSH2_MSG_CHANNEL_REQUEST;
3018 if (!$this->get_channel_packet(self::CHANNEL_SHELL)) {
3025 $this->server_channels[self::CHANNEL_SHELL],
3031 $response = $this->get_channel_packet(self::CHANNEL_SHELL);
3036 $this->channel_status[self::CHANNEL_SHELL] = NET_SSH2_MSG_CHANNEL_DATA;
3038 $this->channel_id_last_interactive = self::CHANNEL_SHELL;
3040 $this->bitmap |= self::MASK_SHELL;
3050 * @see self::read()
3051 * @see self::write()
3057 case $this->is_channel_status_data(self::CHANNEL_SUBSYSTEM):
3058 return self::CHANNEL_SUBSYSTEM;
3059 case $this->is_channel_status_data(self::CHANNEL_EXEC):
3060 return self::CHANNEL_EXEC;
3062 return self::CHANNEL_SHELL;
3084 $channel = self::CHANNEL_EXEC;
3089 } while ($channel++ < self::CHANNEL_SUBSYSTEM);
3131 * if $mode == self::READ_REGEX, a regular expression.
3140 * @see self::write()
3142 * @param int $mode One of the self::READ_* constants
3143 * @param int|null $channel Channel id returned by self::getInteractiveChannelId()
3148 public function read($expect = '', $mode = self::READ_SIMPLE, $channel = null)
3162 if ($channel != self::CHANNEL_SHELL) {
3169 if ($mode == self::READ_NEXT) {
3175 if ($mode == self::READ_REGEX) {
3204 * @param int|null $channel Channel id returned by self::getInteractiveChannelId()
3220 if ($channel != self::CHANNEL_SHELL) {
3239 * @see self::stopSubsystem()
3245 $this->open_channel(self::CHANNEL_SUBSYSTEM);
3250 $this->server_channels[self::CHANNEL_SUBSYSTEM],
3257 $this->channel_status[self::CHANNEL_SUBSYSTEM] = NET_SSH2_MSG_CHANNEL_REQUEST;
3259 if (!$this->get_channel_packet(self::CHANNEL_SUBSYSTEM)) {
3263 $this->channel_status[self::CHANNEL_SUBSYSTEM] = NET_SSH2_MSG_CHANNEL_DATA;
3265 $this->channel_id_last_interactive = self::CHANNEL_SUBSYSTEM;
3273 * @see self::startSubsystem()
3278 if ($this->isInteractiveChannelOpen(self::CHANNEL_SUBSYSTEM)) {
3279 $this->close_channel(self::CHANNEL_SUBSYSTEM);
3295 * @param int|null $channel Channel id returned by self::getInteractiveChannelId()
3329 unset(self::$connections[$this->getResourceId()]);
3366 return ($this->bitmap & self::MASK_CONNECTED) && is_resource($this->fsock) && !feof($this->fsock);
3372 $this->open_channel(self::CHANNEL_KEEP_ALIVE);
3373 $this->close_channel(self::CHANNEL_KEEP_ALIVE);
3388 return (bool) ($this->bitmap & self::MASK_LOGIN);
3398 return $this->isInteractiveChannelOpen(self::CHANNEL_SHELL);
3408 return $this->isInteractiveChannelOpen(self::CHANNEL_EXEC);
3414 * @param int $channel Channel id returned by self::getInteractiveChannelId()
3426 * @see self::isInteractiveChannelOpen()
3451 $this->open_channel(self::CHANNEL_KEEP_ALIVE);
3456 $this->close_channel(self::CHANNEL_KEEP_ALIVE);
3500 * @see self::_send_binary_packet()
3701 case self::NET_SSH2_COMPRESSION_ZLIB_AT_OPENSSH:
3706 case self::NET_SSH2_COMPRESSION_ZLIB:
3741 $message_number = isset(self::$message_numbers[ord($payload[0])]) ? self::$message_numbers[ord($payload[0])] : 'UNKNOWN (' . ord($payload[0]) . ')';
3754 * @see self::get_binary_packet()
3781 if (!$this->bad_key_size_fix && self::bad_algorithm_candidate($this->decrypt ? $this->decryptName : '') && !($this->bitmap & SSH2::MASK_LOGIN)) {
3812 * @see self::_get_binary_packet()
3823 $this->errors[] = 'SSH_MSG_DISCONNECT: ' . self::$disconnect_reasons[$reason_code] . "\r\n$message";
3851 if (($this->bitmap & self::MASK_CONNECTED) && !$this->isAuthenticated() && !is_bool($payload) && ord($payload[0]) == NET_SSH2_MSG_USERAUTH_BANNER) {
3858 if (($this->bitmap & self::MASK_CONNECTED) && $this->isAuthenticated()) {
3905 $new_channel = self::CHANNEL_AGENT_FORWARD;
3957 $payload = ($this->bitmap & self::MASK_WINDOW_ADJUST) ? true : $this->get_binary_packet($skip_channel_filter);
3989 * @see self::enableQuietMode()
3990 * @see self::disableQuietMode()
4014 $this->close_channel(self::CHANNEL_EXEC);
4022 * @see self::enablePTY()
4023 * @see self::disablePTY()
4077 if ($client_channel == self::CHANNEL_EXEC && !$this->request_pty) {
4109 if ($client_channel == self::CHANNEL_EXEC) {
4220 if ($channel == self::CHANNEL_EXEC) {
4230 if ($channel == self::CHANNEL_AGENT_FORWARD) {
4275 * @see self::_get_binary_packet()
4290 case self::NET_SSH2_COMPRESSION_ZLIB_AT_OPENSSH:
4295 case self::NET_SSH2_COMPRESSION_ZLIB:
4401 $message_number = isset(self::$message_numbers[ord($logged[0])]) ? self::$message_numbers[ord($logged[0])] : 'UNKNOWN (' . ord($logged[0]) . ')';
4462 case self::LOG_SIMPLE:
4465 case self::LOG_SIMPLE_REALTIME:
4472 case self::LOG_COMPLEX:
4476 while ($log_size > self::LOG_MAX_SIZE) {
4484 case self::LOG_REALTIME:
4497 // basically the same thing as self::LOG_REALTIME with the caveat that NET_SSH2_LOG_REALTIME_FILENAME
4498 // needs to be defined and that the resultant log file will be capped out at self::LOG_MAX_SIZE.
4501 case self::LOG_REALTIME_FILE:
4518 if ($realtime_log_size > self::LOG_MAX_SIZE) {
4540 $this->bitmap ^= self::MASK_WINDOW_ADJUST;
4543 $this->bitmap ^= self::MASK_WINDOW_ADJUST;
4612 case self::CHANNEL_SHELL:
4615 if ($this->bitmap & self::MASK_SHELL) {
4616 $this->bitmap &= ~self::MASK_SHELL;
4630 if ($this->bitmap & self::MASK_CONNECTED) {
4672 * Returns a string if NET_SSH2_LOGGING == self::LOG_COMPLEX, an array if NET_SSH2_LOGGING == self::LOG_SIMPLE and false if !defined('NET_SSH2_LOGGING')
4683 case self::LOG_SIMPLE:
4685 case self::LOG_COMPLEX:
4941 if (self::$crypto_engine) {
4942 $engines = [self::$crypto_engine];
4958 $obj = self::encryption_algorithm_to_crypt_instance($algo);
5044 self::NET_SSH2_COMPRESSION_NONE => 'none',
5045 self::NET_SSH2_COMPRESSION_ZLIB => 'zlib',
5046 self::NET_SSH2_COMPRESSION_ZLIB_AT_OPENSSH => 'zlib@openssh.com'
5192 if (!($this->bitmap & self::MASK_CONSTRUCTOR)) {
5369 if (isset(self::$connections[$id])) {
5370 return self::$connections[$id] instanceof \WeakReference ? self::$connections[$id]->get() : self::$connections[$id];
5384 return self::$connections;
5387 foreach (self::$connections as $key => $ref) {
5401 if (defined('NET_SSH2_LOGGING') && NET_SSH2_LOGGING == self::LOG_COMPLEX) {