mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-30 12:50:38 +00:00
Multiline phpdoc for extract to one liner
This commit is contained in:
parent
c705e7d9c6
commit
62ee1a5747
@ -292,9 +292,7 @@ abstract class ASN1
|
|||||||
$current+= ['headerlength' => $length + 2];
|
$current+= ['headerlength' => $length + 2];
|
||||||
$start+= $length;
|
$start+= $length;
|
||||||
extract(unpack('Nlength', substr(str_pad($temp, 4, chr(0), STR_PAD_LEFT), -4)));
|
extract(unpack('Nlength', substr(str_pad($temp, 4, chr(0), STR_PAD_LEFT), -4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
} else {
|
} else {
|
||||||
$current+= ['headerlength' => 2];
|
$current+= ['headerlength' => 2];
|
||||||
}
|
}
|
||||||
|
@ -341,9 +341,7 @@ class BCMath extends Engine
|
|||||||
public function gcd(BCMath $n)
|
public function gcd(BCMath $n)
|
||||||
{
|
{
|
||||||
extract($this->extendedGCD($n));
|
extract($this->extendedGCD($n));
|
||||||
/**
|
/** @var BCMath $gcd */
|
||||||
* @var BCMath $gcd
|
|
||||||
*/
|
|
||||||
return $gcd;
|
return $gcd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,9 +192,7 @@ class PHP32 extends PHP
|
|||||||
*/
|
*/
|
||||||
public function gcd(PHP32 $n)
|
public function gcd(PHP32 $n)
|
||||||
{
|
{
|
||||||
$gcd = $this->extendedGCD($n)['gcd'];
|
return $this->extendedGCD($n)['gcd'];
|
||||||
|
|
||||||
return $gcd;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -192,8 +192,7 @@ class PHP64 extends PHP
|
|||||||
*/
|
*/
|
||||||
public function gcd(PHP64 $n)
|
public function gcd(PHP64 $n)
|
||||||
{
|
{
|
||||||
$gcd=$this->extendedGCD($n)['gcd'];
|
return $this->extendedGCD($n)['gcd'];
|
||||||
return $gcd;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -307,9 +307,8 @@ class SCP
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', $response[SSH1::RESPONSE_DATA]));
|
extract(unpack('Nlength', $response[SSH1::RESPONSE_DATA]));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
return Strings::shift($response[SSH1::RESPONSE_DATA], $length);
|
return Strings::shift($response[SSH1::RESPONSE_DATA], $length);
|
||||||
case NET_SSH1_SMSG_STDERR_DATA:
|
case NET_SSH1_SMSG_STDERR_DATA:
|
||||||
break;
|
break;
|
||||||
|
@ -494,26 +494,22 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nversion', Strings::shift($response, 4)));
|
extract(unpack('Nversion', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $version */
|
||||||
* @var integer $version
|
|
||||||
*/
|
|
||||||
$this->version = $version;
|
$this->version = $version;
|
||||||
while (!empty($response)) {
|
while (!empty($response)) {
|
||||||
if (strlen($response) < 4) {
|
if (strlen($response) < 4) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
$key = Strings::shift($response, $length);
|
$key = Strings::shift($response, $length);
|
||||||
if (strlen($response) < 4) {
|
if (strlen($response) < 4) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
$value = Strings::shift($response, $length);
|
$value = Strings::shift($response, $length);
|
||||||
$this->extensions[$key] = $value;
|
$this->extensions[$key] = $value;
|
||||||
@ -648,18 +644,14 @@ class SFTP extends SSH2
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $status */
|
||||||
* @var integer $status
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$error = $this->status_codes[$status];
|
$error = $this->status_codes[$status];
|
||||||
|
|
||||||
if ($this->version > 2 || strlen($response) < 4) {
|
if ($this->version > 2 || strlen($response) < 4) {
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
$this->sftp_errors[] = $error . ': ' . Strings::shift($response, $length);
|
$this->sftp_errors[] = $error . ': ' . Strings::shift($response, $length);
|
||||||
} else {
|
} else {
|
||||||
@ -705,9 +697,7 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
return Strings::shift($response, $length);
|
return Strings::shift($response, $length);
|
||||||
case NET_SFTP_STATUS:
|
case NET_SFTP_STATUS:
|
||||||
@ -948,27 +938,21 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Ncount', Strings::shift($response, 4)));
|
extract(unpack('Ncount', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $count */
|
||||||
* @var integer $count
|
|
||||||
*/
|
|
||||||
|
|
||||||
for ($i = 0; $i < $count; $i++) {
|
for ($i = 0; $i < $count; $i++) {
|
||||||
if (strlen($response) < 4) {
|
if (strlen($response) < 4) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
$shortname = Strings::shift($response, $length);
|
$shortname = Strings::shift($response, $length);
|
||||||
if (strlen($response) < 4) {
|
if (strlen($response) < 4) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
$longname = Strings::shift($response, $length);
|
$longname = Strings::shift($response, $length);
|
||||||
$attributes = $this->parseAttributes($response);
|
$attributes = $this->parseAttributes($response);
|
||||||
@ -999,9 +983,7 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $status */
|
||||||
* @var integer $status
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ($status != NET_SFTP_STATUS_EOF) {
|
if ($status != NET_SFTP_STATUS_EOF) {
|
||||||
$this->logError($response, $status);
|
$this->logError($response, $status);
|
||||||
@ -1604,9 +1586,8 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $status */
|
||||||
* @var integer $status
|
|
||||||
*/
|
|
||||||
if ($status != NET_SFTP_STATUS_OK) {
|
if ($status != NET_SFTP_STATUS_OK) {
|
||||||
$this->logError($response, $status);
|
$this->logError($response, $status);
|
||||||
return false;
|
return false;
|
||||||
@ -1723,9 +1704,7 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Ncount', Strings::shift($response, 4)));
|
extract(unpack('Ncount', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $count */
|
||||||
* @var integer $count
|
|
||||||
*/
|
|
||||||
// the file isn't a symlink
|
// the file isn't a symlink
|
||||||
if (!$count) {
|
if (!$count) {
|
||||||
return false;
|
return false;
|
||||||
@ -1735,9 +1714,7 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
return Strings::shift($response, $length);
|
return Strings::shift($response, $length);
|
||||||
}
|
}
|
||||||
@ -1777,9 +1754,8 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $status */
|
||||||
* @var integer $status
|
|
||||||
*/
|
|
||||||
if ($status != NET_SFTP_STATUS_OK) {
|
if ($status != NET_SFTP_STATUS_OK) {
|
||||||
$this->logError($response, $status);
|
$this->logError($response, $status);
|
||||||
return false;
|
return false;
|
||||||
@ -1849,9 +1825,8 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $status */
|
||||||
* @var integer $status
|
|
||||||
*/
|
|
||||||
if ($status != NET_SFTP_STATUS_OK) {
|
if ($status != NET_SFTP_STATUS_OK) {
|
||||||
$this->logError($response, $status);
|
$this->logError($response, $status);
|
||||||
return false;
|
return false;
|
||||||
@ -1893,9 +1868,8 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $status */
|
||||||
* @var integer $status
|
|
||||||
*/
|
|
||||||
if ($status != NET_SFTP_STATUS_OK) {
|
if ($status != NET_SFTP_STATUS_OK) {
|
||||||
// presumably SSH_FX_NO_SUCH_FILE or SSH_FX_PERMISSION_DENIED?
|
// presumably SSH_FX_NO_SUCH_FILE or SSH_FX_PERMISSION_DENIED?
|
||||||
$this->logError($response, $status);
|
$this->logError($response, $status);
|
||||||
@ -2134,9 +2108,8 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $status */
|
||||||
* @var integer $status
|
|
||||||
*/
|
|
||||||
if ($status != NET_SFTP_STATUS_OK) {
|
if ($status != NET_SFTP_STATUS_OK) {
|
||||||
$this->logError($response, $status);
|
$this->logError($response, $status);
|
||||||
break;
|
break;
|
||||||
@ -2172,9 +2145,8 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $status */
|
||||||
* @var integer $status
|
|
||||||
*/
|
|
||||||
if ($status != NET_SFTP_STATUS_OK) {
|
if ($status != NET_SFTP_STATUS_OK) {
|
||||||
$this->logError($response, $status);
|
$this->logError($response, $status);
|
||||||
return false;
|
return false;
|
||||||
@ -2380,9 +2352,8 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $status */
|
||||||
* @var integer $status
|
|
||||||
*/
|
|
||||||
if ($status != NET_SFTP_STATUS_OK) {
|
if ($status != NET_SFTP_STATUS_OK) {
|
||||||
$this->logError($response, $status);
|
$this->logError($response, $status);
|
||||||
if (!$recursive) {
|
if (!$recursive) {
|
||||||
@ -2813,9 +2784,8 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
extract(unpack('Nstatus', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $status */
|
||||||
* @var integer $status
|
|
||||||
*/
|
|
||||||
if ($status != NET_SFTP_STATUS_OK) {
|
if ($status != NET_SFTP_STATUS_OK) {
|
||||||
$this->logError($response, $status);
|
$this->logError($response, $status);
|
||||||
return false;
|
return false;
|
||||||
@ -2847,9 +2817,8 @@ class SFTP extends SSH2
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
extract(unpack('Nflags', Strings::shift($response, 4)));
|
extract(unpack('Nflags', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $flags */
|
||||||
* @var integer $flags
|
|
||||||
*/
|
|
||||||
// SFTPv4+ have a type field (a byte) that follows the above flag field
|
// SFTPv4+ have a type field (a byte) that follows the above flag field
|
||||||
foreach ($this->attributes as $key => $value) {
|
foreach ($this->attributes as $key => $value) {
|
||||||
switch ($flags & $key) {
|
switch ($flags & $key) {
|
||||||
@ -2896,18 +2865,16 @@ class SFTP extends SSH2
|
|||||||
return $attr;
|
return $attr;
|
||||||
}
|
}
|
||||||
extract(unpack('Ncount', Strings::shift($response, 4)));
|
extract(unpack('Ncount', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $count */
|
||||||
* @var integer $count
|
|
||||||
*/
|
|
||||||
for ($i = 0; $i < $count; $i++) {
|
for ($i = 0; $i < $count; $i++) {
|
||||||
if (strlen($response) < 4) {
|
if (strlen($response) < 4) {
|
||||||
//user_error('Malformed file attributes');
|
//user_error('Malformed file attributes');
|
||||||
return $attr;
|
return $attr;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
$key = Strings::shift($response, $length);
|
$key = Strings::shift($response, $length);
|
||||||
|
|
||||||
if (strlen($response) < 4) {
|
if (strlen($response) < 4) {
|
||||||
@ -2915,9 +2882,8 @@ class SFTP extends SSH2
|
|||||||
return $attr;
|
return $attr;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
$attr[$key] = Strings::shift($response, $length);
|
$attr[$key] = Strings::shift($response, $length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3074,9 +3040,8 @@ class SFTP extends SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($this->packet_buffer, 4)));
|
extract(unpack('Nlength', Strings::shift($this->packet_buffer, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
$tempLength = $length;
|
$tempLength = $length;
|
||||||
$tempLength-= strlen($this->packet_buffer);
|
$tempLength-= strlen($this->packet_buffer);
|
||||||
|
|
||||||
|
@ -614,9 +614,7 @@ class SSH1
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nsupported_ciphers_mask', Strings::shift($response[self::RESPONSE_DATA], 4)));
|
extract(unpack('Nsupported_ciphers_mask', Strings::shift($response[self::RESPONSE_DATA], 4)));
|
||||||
/**
|
/** @var integer $supported_ciphers_mask */
|
||||||
* @var integer $supported_ciphers_mask
|
|
||||||
*/
|
|
||||||
|
|
||||||
foreach ($this->supported_ciphers as $mask => $name) {
|
foreach ($this->supported_ciphers as $mask => $name) {
|
||||||
if (($supported_ciphers_mask & (1 << $mask)) == 0) {
|
if (($supported_ciphers_mask & (1 << $mask)) == 0) {
|
||||||
@ -629,9 +627,8 @@ class SSH1
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nsupported_authentications_mask', Strings::shift($response[self::RESPONSE_DATA], 4)));
|
extract(unpack('Nsupported_authentications_mask', Strings::shift($response[self::RESPONSE_DATA], 4)));
|
||||||
/**
|
/** @var integer $supported_authentications_mask */
|
||||||
* @var integer $supported_authentications_mask
|
|
||||||
*/
|
|
||||||
foreach ($this->supported_authentications as $mask => $name) {
|
foreach ($this->supported_authentications as $mask => $name) {
|
||||||
if (($supported_authentications_mask & (1 << $mask)) == 0) {
|
if (($supported_authentications_mask & (1 << $mask)) == 0) {
|
||||||
unset($this->supported_authentications[$mask]);
|
unset($this->supported_authentications[$mask]);
|
||||||
|
@ -2304,9 +2304,8 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
$this->errors[] = 'SSH_MSG_USERAUTH_PASSWD_CHANGEREQ: ' . utf8_decode(Strings::shift($response, $length));
|
$this->errors[] = 'SSH_MSG_USERAUTH_PASSWD_CHANGEREQ: ' . utf8_decode(Strings::shift($response, $length));
|
||||||
|
|
||||||
return $this->disconnect_helper(NET_SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER);
|
return $this->disconnect_helper(NET_SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER);
|
||||||
@ -2317,18 +2316,15 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
$auth_methods = explode(',', Strings::shift($response, $length));
|
$auth_methods = explode(',', Strings::shift($response, $length));
|
||||||
if (!strlen($response)) {
|
if (!strlen($response)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Cpartial_success', Strings::shift($response, 1)));
|
extract(unpack('Cpartial_success', Strings::shift($response, 1)));
|
||||||
/**
|
/** @var integer $partial_success */
|
||||||
* @var integer $partial_success
|
|
||||||
*/
|
|
||||||
$partial_success = $partial_success != 0;
|
$partial_success = $partial_success != 0;
|
||||||
|
|
||||||
if (!$partial_success && in_array('keyboard-interactive', $auth_methods)) {
|
if (!$partial_success && in_array('keyboard-interactive', $auth_methods)) {
|
||||||
@ -2411,27 +2407,21 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
Strings::shift($response, $length); // name; may be empty
|
Strings::shift($response, $length); // name; may be empty
|
||||||
if (strlen($response) < 4) {
|
if (strlen($response) < 4) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
Strings::shift($response, $length); // instruction; may be empty
|
Strings::shift($response, $length); // instruction; may be empty
|
||||||
if (strlen($response) < 4) {
|
if (strlen($response) < 4) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
Strings::shift($response, $length); // language tag; may be empty
|
Strings::shift($response, $length); // language tag; may be empty
|
||||||
if (strlen($response) < 4) {
|
if (strlen($response) < 4) {
|
||||||
@ -2439,6 +2429,7 @@ class SSH2
|
|||||||
}
|
}
|
||||||
extract(unpack('Nnum_prompts', Strings::shift($response, 4)));
|
extract(unpack('Nnum_prompts', Strings::shift($response, 4)));
|
||||||
/** @var integer $num_prompts */
|
/** @var integer $num_prompts */
|
||||||
|
|
||||||
for ($i = 0; $i < count($responses); $i++) {
|
for ($i = 0; $i < count($responses); $i++) {
|
||||||
if (is_array($responses[$i])) {
|
if (is_array($responses[$i])) {
|
||||||
foreach ($responses[$i] as $key => $value) {
|
foreach ($responses[$i] as $key => $value) {
|
||||||
@ -2455,9 +2446,7 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
// prompt - ie. "Password: "; must not be empty
|
// prompt - ie. "Password: "; must not be empty
|
||||||
$prompt = Strings::shift($response, $length);
|
$prompt = Strings::shift($response, $length);
|
||||||
@ -2615,9 +2604,7 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
$this->errors[] = 'SSH_MSG_USERAUTH_FAILURE: ' . Strings::shift($response, $length);
|
$this->errors[] = 'SSH_MSG_USERAUTH_FAILURE: ' . Strings::shift($response, $length);
|
||||||
|
|
||||||
@ -3378,9 +3365,7 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($payload, 4)));
|
extract(unpack('Nlength', Strings::shift($payload, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
$this->errors[] = 'SSH_MSG_DEBUG: ' . utf8_decode(Strings::shift($payload, $length));
|
$this->errors[] = 'SSH_MSG_DEBUG: ' . utf8_decode(Strings::shift($payload, $length));
|
||||||
$payload = $this->get_binary_packet($skip_channel_filter);
|
$payload = $this->get_binary_packet($skip_channel_filter);
|
||||||
@ -3404,9 +3389,8 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($payload, 4)));
|
extract(unpack('Nlength', Strings::shift($payload, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
$this->banner_message = utf8_decode(Strings::shift($payload, $length));
|
$this->banner_message = utf8_decode(Strings::shift($payload, $length));
|
||||||
$payload = $this->get_binary_packet();
|
$payload = $this->get_binary_packet();
|
||||||
}
|
}
|
||||||
@ -3430,9 +3414,8 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($payload, 4)));
|
extract(unpack('Nlength', Strings::shift($payload, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
$this->errors[] = 'SSH_MSG_GLOBAL_REQUEST: ' . Strings::shift($payload, $length);
|
$this->errors[] = 'SSH_MSG_GLOBAL_REQUEST: ' . Strings::shift($payload, $length);
|
||||||
|
|
||||||
if (!$this->send_binary_packet(pack('C', NET_SSH2_MSG_REQUEST_FAILURE))) {
|
if (!$this->send_binary_packet(pack('C', NET_SSH2_MSG_REQUEST_FAILURE))) {
|
||||||
@ -3447,15 +3430,15 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($payload, 4)));
|
extract(unpack('Nlength', Strings::shift($payload, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
$data = Strings::shift($payload, $length);
|
$data = Strings::shift($payload, $length);
|
||||||
if (strlen($payload) < 4) {
|
if (strlen($payload) < 4) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nserver_channel', Strings::shift($payload, 4)));
|
extract(unpack('Nserver_channel', Strings::shift($payload, 4)));
|
||||||
/** @var integer $server_channel */
|
/** @var integer $server_channel */
|
||||||
|
|
||||||
switch ($data) {
|
switch ($data) {
|
||||||
case 'auth-agent':
|
case 'auth-agent':
|
||||||
case 'auth-agent@openssh.com':
|
case 'auth-agent@openssh.com':
|
||||||
@ -3671,9 +3654,7 @@ class SSH2
|
|||||||
}
|
}
|
||||||
if ($type == NET_SSH2_MSG_CHANNEL_OPEN) {
|
if ($type == NET_SSH2_MSG_CHANNEL_OPEN) {
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
} else {
|
} else {
|
||||||
extract(unpack('Nchannel', Strings::shift($response, 4)));
|
extract(unpack('Nchannel', Strings::shift($response, 4)));
|
||||||
/** @var integer $channel */
|
/** @var integer $channel */
|
||||||
@ -3791,9 +3772,7 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
|
|
||||||
$data = Strings::shift($response, $length);
|
$data = Strings::shift($response, $length);
|
||||||
|
|
||||||
@ -3818,9 +3797,8 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
$value = Strings::shift($response, $length);
|
$value = Strings::shift($response, $length);
|
||||||
switch ($value) {
|
switch ($value) {
|
||||||
case 'exit-signal':
|
case 'exit-signal':
|
||||||
@ -3829,18 +3807,16 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
$this->errors[] = 'SSH_MSG_CHANNEL_REQUEST (exit-signal): ' . Strings::shift($response, $length);
|
$this->errors[] = 'SSH_MSG_CHANNEL_REQUEST (exit-signal): ' . Strings::shift($response, $length);
|
||||||
if (strlen($response) < 4) {
|
if (strlen($response) < 4) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Strings::shift($response, 1);
|
Strings::shift($response, 1);
|
||||||
extract(unpack('Nlength', Strings::shift($response, 4)));
|
extract(unpack('Nlength', Strings::shift($response, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
if ($length) {
|
if ($length) {
|
||||||
$this->errors[count($this->errors)].= "\r\n" . Strings::shift($response, $length);
|
$this->errors[count($this->errors)].= "\r\n" . Strings::shift($response, $length);
|
||||||
}
|
}
|
||||||
@ -4475,9 +4451,8 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
extract(unpack('Nlength', Strings::shift($server_public_host_key, 4)));
|
extract(unpack('Nlength', Strings::shift($server_public_host_key, 4)));
|
||||||
/**
|
/** @var integer $length */
|
||||||
* @var integer $length
|
|
||||||
*/
|
|
||||||
Strings::shift($server_public_host_key, $length);
|
Strings::shift($server_public_host_key, $length);
|
||||||
|
|
||||||
if ($this->signature_validated) {
|
if ($this->signature_validated) {
|
||||||
|
Loading…
Reference in New Issue
Block a user