mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-29 18:18:39 +00:00
CS adjustment
This commit is contained in:
parent
cf1be6a3d3
commit
77b00c3169
9
phpseclib/Exception/OutOfBoundsException.php
Normal file
9
phpseclib/Exception/OutOfBoundsException.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpseclib3\Exception;
|
||||
|
||||
class OutOfBoundsException extends \OutOfBoundsException implements ExceptionInterface
|
||||
{
|
||||
}
|
@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace phpseclib3\Math;
|
||||
|
||||
use phpseclib3\Common\Functions\Strings;
|
||||
use phpseclib3\Exception\OutOfBoundsException;
|
||||
use phpseclib3\Math\BinaryField\Integer;
|
||||
use phpseclib3\Math\Common\FiniteField;
|
||||
|
||||
@ -57,7 +58,7 @@ class BinaryField extends FiniteField
|
||||
http://tools.ietf.org/html/rfc4253#section-6.1 (The Secure Shell (SSH) Transport Layer Protocol) says
|
||||
"implementations SHOULD check that the packet length is reasonable in order for the implementation to
|
||||
avoid denial of service and/or buffer overflow attacks" */
|
||||
throw new \OutOfBoundsException('Degrees larger than 571 are not supported');
|
||||
throw new OutOfBoundsException('Degrees larger than 571 are not supported');
|
||||
}
|
||||
$val = str_repeat('0', $m) . '1';
|
||||
foreach ($indices as $index) {
|
||||
|
@ -2066,7 +2066,7 @@ class SSH2
|
||||
[$type] = Strings::unpackSSH2('C', $response);
|
||||
|
||||
if ($type == MessageType::EXT_INFO) {
|
||||
list($nr_extensions) = Strings::unpackSSH2('N', $response);
|
||||
[$nr_extensions] = Strings::unpackSSH2('N', $response);
|
||||
for ($i = 0; $i < $nr_extensions; $i++) {
|
||||
[$extension_name, $extension_value] = Strings::unpackSSH2('ss', $response);
|
||||
if ($extension_name == 'server-sig-algs') {
|
||||
@ -2075,12 +2075,10 @@ class SSH2
|
||||
}
|
||||
|
||||
$response = $this->get_binary_packet();
|
||||
list($type) = Strings::unpackSSH2('C', $response);
|
||||
[$type] = Strings::unpackSSH2('C', $response);
|
||||
}
|
||||
|
||||
list($service) = Strings::unpackSSH2('s', $response);
|
||||
|
||||
[$type, $service] = Strings::unpackSSH2('Cs', $response);
|
||||
[$service] = Strings::unpackSSH2('s', $response);
|
||||
if ($type != MessageType::SERVICE_ACCEPT || $service != 'ssh-userauth') {
|
||||
$this->disconnect_helper(DisconnectReason::PROTOCOL_ERROR);
|
||||
throw new UnexpectedValueException('Expected SSH_MSG_SERVICE_ACCEPT');
|
||||
|
Loading…
x
Reference in New Issue
Block a user