mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 03:42:40 +00:00
SSH1: Fix E_NOTICE (thanks nosx!)
This commit is contained in:
parent
a890c6d127
commit
10d9671601
@ -1018,19 +1018,11 @@ class Net_SSH1 {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined('NET_SSH1_LOGGING')) {
|
|
||||||
$temp = isset($this->protocol_flags[ord($data[0])]) ? $this->protocol_flags[ord($data[0])] : 'UNKNOWN';
|
|
||||||
$this->protocol_flags_log[] = '-> ' . $temp .
|
|
||||||
' (' . round($stop - $start, 4) . 's)';
|
|
||||||
if (NET_SSH1_LOGGING == NET_SSH1_LOG_COMPLEX) {
|
|
||||||
$this->message_log[] = substr($data, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$length = strlen($data) + 4;
|
$length = strlen($data) + 4;
|
||||||
|
|
||||||
$padding = crypt_random_string(8 - ($length & 7));
|
$padding = crypt_random_string(8 - ($length & 7));
|
||||||
|
|
||||||
|
$orig = $data;
|
||||||
$data = $padding . $data;
|
$data = $padding . $data;
|
||||||
$data.= pack('N', $this->_crc($data));
|
$data.= pack('N', $this->_crc($data));
|
||||||
|
|
||||||
@ -1044,6 +1036,15 @@ class Net_SSH1 {
|
|||||||
$result = strlen($packet) == fputs($this->fsock, $packet);
|
$result = strlen($packet) == fputs($this->fsock, $packet);
|
||||||
$stop = strtok(microtime(), ' ') + strtok('');
|
$stop = strtok(microtime(), ' ') + strtok('');
|
||||||
|
|
||||||
|
if (defined('NET_SSH1_LOGGING')) {
|
||||||
|
$temp = isset($this->protocol_flags[ord($orig[0])]) ? $this->protocol_flags[ord($orig[0])] : 'UNKNOWN';
|
||||||
|
$this->protocol_flags_log[] = '-> ' . $temp .
|
||||||
|
' (' . round($stop - $start, 4) . 's)';
|
||||||
|
if (NET_SSH1_LOGGING == NET_SSH1_LOG_COMPLEX) {
|
||||||
|
$this->message_log[] = substr($orig, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user