mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-09 15:20:58 +00:00
addresses low hanging fruit comments from terrafrost and bantu
This commit is contained in:
parent
aca4ba3286
commit
dd0b3e6bd5
@ -101,8 +101,6 @@ define('NET_SSH2_CHANNEL_SHELL', 1);
|
||||
define('NET_SSH2_CHANNEL_SUBSYSTEM', 2);
|
||||
define('NET_SSH2_CHANNEL_AGENT_REQUEST', 3);
|
||||
define('NET_SSH2_CHANNEL_AGENT_FORWARD', 4);
|
||||
|
||||
|
||||
/**#@-*/
|
||||
|
||||
/**#@+
|
||||
@ -2248,7 +2246,6 @@ class Net_SSH2
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set Timeout
|
||||
*
|
||||
@ -2825,8 +2822,6 @@ class Net_SSH2
|
||||
}
|
||||
$payload = $this->_get_binary_packet();
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// see http://tools.ietf.org/html/rfc4252#section-5.4; only called when the encryption has been activated and when we haven't already logged in
|
||||
@ -3007,7 +3002,7 @@ class Net_SSH2
|
||||
}
|
||||
|
||||
switch ($this->channel_status[$channel]) {
|
||||
case NET_SSH2_MSG_CHANNEL_OPEN:;
|
||||
case NET_SSH2_MSG_CHANNEL_OPEN:
|
||||
switch ($type) {
|
||||
case NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION:
|
||||
extract(unpack('Nserver_channel', $this->_string_shift($response, 4)));
|
||||
|
@ -437,7 +437,7 @@ class System_SSH_Agent
|
||||
function _forward_data($data)
|
||||
{
|
||||
if ($this->expected_bytes > 0) {
|
||||
$this->socket_buffer .= $data;
|
||||
$this->socket_buffer.= $data;
|
||||
$this->expected_bytes -= strlen($data);
|
||||
} else {
|
||||
$agent_data_bytes = current(unpack('N', $data));
|
||||
|
@ -46,7 +46,9 @@ class Functional_Net_SSH2AgentTest extends PhpseclibFunctionalTestCase
|
||||
|
||||
$agent->startSSHForwarding($ssh);
|
||||
$this->assertEquals($username, trim($ssh->exec("ssh " . $username . "@" . $hostname . ' \'whoami\'')));
|
||||
|
||||
$agent->stopSSHForwarding($ssh);
|
||||
$this->assertEquals($username, 'failure');
|
||||
|
||||
return $args;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user