mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-06-03 09:00:52 +00:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
05f6467b1d
|
@ -2627,7 +2627,7 @@ abstract class Base
|
|||
*
|
||||
* @see self::_setupInlineCrypt()
|
||||
* @access private
|
||||
* @param $bytes
|
||||
* @param string $bytes
|
||||
* @return string
|
||||
*/
|
||||
function _hashInlineCryptFunction($bytes)
|
||||
|
|
|
@ -849,7 +849,6 @@ class Hash
|
|||
* _sha256() adds multiple unsigned 32-bit integers. Since PHP doesn't support unsigned integers and since the
|
||||
* possibility of overflow exists, care has to be taken. BigInteger could be used but this should be faster.
|
||||
*
|
||||
* @param int $...
|
||||
* @return int
|
||||
* @see self::_sha256()
|
||||
* @access private
|
||||
|
|
|
@ -537,7 +537,7 @@ class RSA
|
|||
* @access public
|
||||
* @param int $bits
|
||||
* @param int $timeout
|
||||
* @param array $p
|
||||
* @param array $partial
|
||||
*/
|
||||
function createKey($bits = 1024, $timeout = false, $partial = array())
|
||||
{
|
||||
|
@ -716,7 +716,12 @@ class RSA
|
|||
*
|
||||
* @access private
|
||||
* @see self::setPrivateKeyFormat()
|
||||
* @param string $RSAPrivateKey
|
||||
* @param Math_BigInteger $n
|
||||
* @param Math_BigInteger $e
|
||||
* @param Math_BigInteger $d
|
||||
* @param array<int,Math_BigInteger> $primes
|
||||
* @param array<int,Math_BigInteger> $exponents
|
||||
* @param array<int,Math_BigInteger> $coefficients
|
||||
* @return string
|
||||
*/
|
||||
function _convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients)
|
||||
|
@ -997,8 +1002,9 @@ class RSA
|
|||
*
|
||||
* @access private
|
||||
* @see self::setPublicKeyFormat()
|
||||
* @param string $RSAPrivateKey
|
||||
* @return string
|
||||
* @param Math_BigInteger $n
|
||||
* @param Math_BigInteger $e
|
||||
* @return string|array<string,Math_BigInteger>
|
||||
*/
|
||||
function _convertPublicKey($n, $e)
|
||||
{
|
||||
|
@ -1880,7 +1886,6 @@ class RSA
|
|||
*
|
||||
* @see self::getPublicKey()
|
||||
* @access public
|
||||
* @param string $key
|
||||
* @param int $type optional
|
||||
*/
|
||||
function getPublicKey($type = self::PUBLIC_FORMAT_PKCS8)
|
||||
|
@ -1938,7 +1943,6 @@ class RSA
|
|||
*
|
||||
* @see self::getPublicKey()
|
||||
* @access public
|
||||
* @param string $key
|
||||
* @param int $type optional
|
||||
* @return mixed
|
||||
*/
|
||||
|
@ -1963,8 +1967,7 @@ class RSA
|
|||
*
|
||||
* @see self::getPrivateKey()
|
||||
* @access private
|
||||
* @param string $key
|
||||
* @param int $type optional
|
||||
* @param int $mode optional
|
||||
*/
|
||||
function _getPrivatePublicKey($mode = self::PUBLIC_FORMAT_PKCS8)
|
||||
{
|
||||
|
@ -2181,7 +2184,7 @@ class RSA
|
|||
* of the hash function Hash) and 0.
|
||||
*
|
||||
* @access public
|
||||
* @param int $format
|
||||
* @param int $sLen
|
||||
*/
|
||||
function setSaltLength($sLen)
|
||||
{
|
||||
|
@ -2214,7 +2217,7 @@ class RSA
|
|||
* See {@link http://tools.ietf.org/html/rfc3447#section-4.2 RFC3447#section-4.2}.
|
||||
*
|
||||
* @access private
|
||||
* @param string $x
|
||||
* @param int|string|resource $x
|
||||
* @return \phpseclib\Math\BigInteger
|
||||
*/
|
||||
function _os2ip($x)
|
||||
|
@ -2441,7 +2444,7 @@ class RSA
|
|||
*
|
||||
* @access private
|
||||
* @param string $mgfSeed
|
||||
* @param int $mgfLen
|
||||
* @param int $maskLen
|
||||
* @return string
|
||||
*/
|
||||
function _mgf1($mgfSeed, $maskLen)
|
||||
|
@ -2950,6 +2953,7 @@ class RSA
|
|||
*
|
||||
* @access private
|
||||
* @param string $m
|
||||
* @param string $s
|
||||
* @return string
|
||||
*/
|
||||
function _rsassa_pkcs1_v1_5_verify($m, $s)
|
||||
|
@ -3090,7 +3094,7 @@ class RSA
|
|||
*
|
||||
* @see self::encrypt()
|
||||
* @access public
|
||||
* @param string $plaintext
|
||||
* @param string $ciphertext
|
||||
* @return string
|
||||
*/
|
||||
function decrypt($ciphertext)
|
||||
|
|
|
@ -203,8 +203,7 @@ class ANSI
|
|||
/**
|
||||
* Set the number of lines that should be logged past the terminal height
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $y
|
||||
* @param int $history
|
||||
* @access public
|
||||
*/
|
||||
function setHistory($history)
|
||||
|
|
|
@ -790,7 +790,7 @@ class ASN1
|
|||
*
|
||||
* @param string $source
|
||||
* @param string $mapping
|
||||
* @param int $idx
|
||||
* @param array $special
|
||||
* @return string
|
||||
* @access public
|
||||
*/
|
||||
|
@ -806,6 +806,7 @@ class ASN1
|
|||
* @param string $source
|
||||
* @param string $mapping
|
||||
* @param int $idx
|
||||
* @param array $special
|
||||
* @return string
|
||||
* @access private
|
||||
*/
|
||||
|
@ -1161,7 +1162,7 @@ class ASN1
|
|||
* Called by _encode_der()
|
||||
*
|
||||
* @access private
|
||||
* @param string $content
|
||||
* @param string $source
|
||||
* @return string
|
||||
*/
|
||||
function _encodeOID($source)
|
||||
|
|
|
@ -1608,7 +1608,7 @@ class X509
|
|||
* Map extension values from octet string to extension-specific internal
|
||||
* format.
|
||||
*
|
||||
* @param array ref $root
|
||||
* @param array $root (by reference)
|
||||
* @param string $path
|
||||
* @param object $asn1
|
||||
* @access private
|
||||
|
@ -1661,7 +1661,7 @@ class X509
|
|||
* Map extension values from extension-specific internal format to
|
||||
* octet string.
|
||||
*
|
||||
* @param array ref $root
|
||||
* @param array $root (by reference)
|
||||
* @param string $path
|
||||
* @param object $asn1
|
||||
* @access private
|
||||
|
@ -1727,7 +1727,7 @@ class X509
|
|||
* Map attribute values from ANY type to attribute-specific internal
|
||||
* format.
|
||||
*
|
||||
* @param array ref $root
|
||||
* @param array $root (by reference)
|
||||
* @param string $path
|
||||
* @param object $asn1
|
||||
* @access private
|
||||
|
@ -1768,7 +1768,7 @@ class X509
|
|||
* Map attribute values from attribute-specific internal format to
|
||||
* ANY type.
|
||||
*
|
||||
* @param array ref $root
|
||||
* @param array $root (by reference)
|
||||
* @param string $path
|
||||
* @param object $asn1
|
||||
* @access private
|
||||
|
@ -1811,7 +1811,7 @@ class X509
|
|||
* Map DN values from ANY type to DN-specific internal
|
||||
* format.
|
||||
*
|
||||
* @param array ref $root
|
||||
* @param array $root (by reference)
|
||||
* @param string $path
|
||||
* @param object $asn1
|
||||
* @access private
|
||||
|
@ -1841,7 +1841,7 @@ class X509
|
|||
* Map DN values from DN-specific internal format to
|
||||
* ANY type.
|
||||
*
|
||||
* @param array ref $root
|
||||
* @param array $root (by reference)
|
||||
* @param string $path
|
||||
* @param object $asn1
|
||||
* @access private
|
||||
|
@ -3195,7 +3195,8 @@ class X509
|
|||
/**
|
||||
* Load a Certificate Signing Request
|
||||
*
|
||||
* @param string $csr
|
||||
* @param string|array $csr
|
||||
* @param int $mode
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
|
@ -3332,7 +3333,7 @@ class X509
|
|||
*
|
||||
* https://developer.mozilla.org/en-US/docs/HTML/Element/keygen
|
||||
*
|
||||
* @param string $csr
|
||||
* @param string|array $spkac
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
|
@ -3403,7 +3404,7 @@ class X509
|
|||
/**
|
||||
* Save a SPKAC CSR request
|
||||
*
|
||||
* @param array $csr
|
||||
* @param string|array $spkac
|
||||
* @param int $format optional
|
||||
* @access public
|
||||
* @return string
|
||||
|
@ -3447,6 +3448,7 @@ class X509
|
|||
* Load a Certificate Revocation List
|
||||
*
|
||||
* @param string $crl
|
||||
* @param int $mode
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
|
@ -4043,8 +4045,7 @@ class X509
|
|||
/**
|
||||
* X.509 certificate signing helper function.
|
||||
*
|
||||
* @param object $key
|
||||
* @param \phpseclib\File\X509 $subject
|
||||
* @param \phpseclib\File\X509 $key
|
||||
* @param string $signatureAlgorithm
|
||||
* @access public
|
||||
* @return mixed
|
||||
|
@ -4119,7 +4120,7 @@ class X509
|
|||
* Set Serial Number
|
||||
*
|
||||
* @param string $serial
|
||||
* @param $base optional
|
||||
* @param int $base optional
|
||||
* @access public
|
||||
*/
|
||||
function setSerialNumber($serial, $base = -256)
|
||||
|
@ -4782,7 +4783,6 @@ class X509
|
|||
* Set the IP Addresses's which the cert is to be valid for
|
||||
*
|
||||
* @access public
|
||||
* @param string $ipAddress optional
|
||||
*/
|
||||
function setIPAddress()
|
||||
{
|
||||
|
|
|
@ -243,7 +243,7 @@ class BigInteger
|
|||
* ?>
|
||||
* </code>
|
||||
*
|
||||
* @param $x base-10 number or base-$base number if $base set.
|
||||
* @param int|string|resource $x base-10 number or base-$base number if $base set.
|
||||
* @param int $base
|
||||
* @return \phpseclib\Math\BigInteger
|
||||
* @access public
|
||||
|
@ -1994,7 +1994,7 @@ class BigInteger
|
|||
*
|
||||
* @see self::_slidingWindow()
|
||||
* @access private
|
||||
* @param \phpseclib\Math\BigInteger
|
||||
* @param \phpseclib\Math\BigInteger $n
|
||||
* @return \phpseclib\Math\BigInteger
|
||||
*/
|
||||
function _mod2($n)
|
||||
|
@ -2688,7 +2688,7 @@ class BigInteger
|
|||
* Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y).
|
||||
*
|
||||
* @param \phpseclib\Math\BigInteger $y
|
||||
* @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
|
||||
* @return int that is < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
|
||||
* @access public
|
||||
* @see self::equals()
|
||||
* @internal Could return $this->subtract($x), but that's not as fast as what we do do.
|
||||
|
@ -3090,7 +3090,7 @@ class BigInteger
|
|||
*
|
||||
* Byte length is equal to $length. Uses \phpseclib\Crypt\Random if it's loaded and mt_rand if it's not.
|
||||
*
|
||||
* @param int $length
|
||||
* @param int $size
|
||||
* @return \phpseclib\Math\BigInteger
|
||||
* @access private
|
||||
*/
|
||||
|
@ -3557,7 +3557,7 @@ class BigInteger
|
|||
*
|
||||
* Removes leading zeros and truncates (if necessary) to maintain the appropriate precision
|
||||
*
|
||||
* @param \phpseclib\Math\BigInteger
|
||||
* @param \phpseclib\Math\BigInteger $result
|
||||
* @return \phpseclib\Math\BigInteger
|
||||
* @see self::_trim()
|
||||
* @access private
|
||||
|
@ -3634,8 +3634,8 @@ class BigInteger
|
|||
/**
|
||||
* Array Repeat
|
||||
*
|
||||
* @param $input Array
|
||||
* @param $multiplier mixed
|
||||
* @param array $input
|
||||
* @param mixed $multiplier
|
||||
* @return array
|
||||
* @access private
|
||||
*/
|
||||
|
@ -3649,8 +3649,8 @@ class BigInteger
|
|||
*
|
||||
* Shifts binary strings $shift bits, essentially multiplying by 2**$shift.
|
||||
*
|
||||
* @param $x String
|
||||
* @param $shift Integer
|
||||
* @param string $x (by reference)
|
||||
* @param int $shift
|
||||
* @return string
|
||||
* @access private
|
||||
*/
|
||||
|
@ -3678,8 +3678,8 @@ class BigInteger
|
|||
*
|
||||
* Shifts binary strings $shift bits, essentially dividing by 2**$shift and returning the remainder.
|
||||
*
|
||||
* @param $x String
|
||||
* @param $shift Integer
|
||||
* @param string $x (by referenc)
|
||||
* @param int $shift
|
||||
* @return string
|
||||
* @access private
|
||||
*/
|
||||
|
|
|
@ -416,7 +416,6 @@ class SFTP extends SSH2
|
|||
* Login
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @return bool
|
||||
* @access public
|
||||
*/
|
||||
|
@ -1227,7 +1226,7 @@ class SFTP extends SSH2
|
|||
*
|
||||
* Mainly used by file_exists
|
||||
*
|
||||
* @param string $dir
|
||||
* @param string $path
|
||||
* @return mixed
|
||||
* @access private
|
||||
*/
|
||||
|
@ -1782,6 +1781,8 @@ class SFTP extends SSH2
|
|||
* Creates a directory.
|
||||
*
|
||||
* @param string $dir
|
||||
* @param int $mode
|
||||
* @param bool $recursive
|
||||
* @return bool
|
||||
* @access public
|
||||
*/
|
||||
|
@ -1814,6 +1815,7 @@ class SFTP extends SSH2
|
|||
* Helper function for directory creation
|
||||
*
|
||||
* @param string $dir
|
||||
* @param int $mode
|
||||
* @return bool
|
||||
* @access private
|
||||
*/
|
||||
|
@ -2735,6 +2737,7 @@ class SFTP extends SSH2
|
|||
*
|
||||
* @param string $path
|
||||
* @param string $prop
|
||||
* @param mixed $type
|
||||
* @return mixed
|
||||
* @access private
|
||||
*/
|
||||
|
@ -2975,6 +2978,7 @@ class SFTP extends SSH2
|
|||
*
|
||||
* @param int $type
|
||||
* @param string $data
|
||||
* @param int $request_id
|
||||
* @see self::_get_sftp_packet()
|
||||
* @see self::_send_channel_packet()
|
||||
* @return bool
|
||||
|
|
|
@ -626,7 +626,6 @@ class Stream
|
|||
* $options. What does 8 correspond to?
|
||||
*
|
||||
* @param string $path
|
||||
* @param int $mode
|
||||
* @param int $options
|
||||
* @return bool
|
||||
* @access public
|
||||
|
@ -768,8 +767,8 @@ class Stream
|
|||
* If NET_SFTP_STREAM_LOGGING is defined all calls will be output on the screen and then (regardless of whether or not
|
||||
* NET_SFTP_STREAM_LOGGING is enabled) the parameters will be passed through to the appropriate method.
|
||||
*
|
||||
* @param string
|
||||
* @param array
|
||||
* @param string $name
|
||||
* @param array $arguments
|
||||
* @return mixed
|
||||
* @access public
|
||||
*/
|
||||
|
|
|
@ -812,6 +812,7 @@ class SSH1
|
|||
* @see self::interactiveRead()
|
||||
* @see self::interactiveWrite()
|
||||
* @param string $cmd
|
||||
* @param bool $block
|
||||
* @return mixed
|
||||
* @access public
|
||||
*/
|
||||
|
@ -1385,7 +1386,6 @@ class SSH1
|
|||
* named constants from it, using the value as the name of the constant and the index as the value of the constant.
|
||||
* If any of the constants that would be defined already exists, none of the constants will be defined.
|
||||
*
|
||||
* @param array $array
|
||||
* @access private
|
||||
*/
|
||||
function _define_array()
|
||||
|
@ -1584,7 +1584,8 @@ class SSH1
|
|||
*
|
||||
* Makes sure that only the last 1MB worth of packets will be logged
|
||||
*
|
||||
* @param string $data
|
||||
* @param int $protocol_flags
|
||||
* @param string $message
|
||||
* @access private
|
||||
*/
|
||||
function _append_log($protocol_flags, $message)
|
||||
|
|
|
@ -2112,8 +2112,6 @@ class SSH2
|
|||
* The $password parameter can be a plaintext password, a \phpseclib\Crypt\RSA object or an array
|
||||
*
|
||||
* @param string $username
|
||||
* @param mixed $password
|
||||
* @param mixed $...
|
||||
* @return bool
|
||||
* @see self::_login()
|
||||
* @access public
|
||||
|
@ -2140,8 +2138,6 @@ class SSH2
|
|||
* Login Helper
|
||||
*
|
||||
* @param string $username
|
||||
* @param mixed $password
|
||||
* @param mixed $...
|
||||
* @return bool
|
||||
* @see self::_login_helper()
|
||||
* @access private
|
||||
|
@ -2402,7 +2398,6 @@ class SSH2
|
|||
/**
|
||||
* Handle the keyboard-interactive requests / responses.
|
||||
*
|
||||
* @param string $responses...
|
||||
* @return bool
|
||||
* @access private
|
||||
*/
|
||||
|
@ -2547,7 +2542,7 @@ class SSH2
|
|||
* Login with an RSA private key
|
||||
*
|
||||
* @param string $username
|
||||
* @param \phpseclib\Crypt\RSA $password
|
||||
* @param \phpseclib\Crypt\RSA $privatekey
|
||||
* @return bool
|
||||
* @access private
|
||||
* @internal It might be worthwhile, at some point, to protect against {@link http://tools.ietf.org/html/rfc4251#section-9.3.9 traffic analysis}
|
||||
|
@ -3653,8 +3648,9 @@ class SSH2
|
|||
*
|
||||
* Returns the data as a string if it's available and false if not.
|
||||
*
|
||||
* @param $client_channel
|
||||
* @return mixed
|
||||
* @param int $client_channel
|
||||
* @param bool $skip_extended
|
||||
* @return mixed|bool
|
||||
* @access private
|
||||
*/
|
||||
function _get_channel_packet($client_channel, $skip_extended = false)
|
||||
|
@ -3984,7 +3980,8 @@ class SSH2
|
|||
*
|
||||
* Makes sure that only the last 1MB worth of packets will be logged
|
||||
*
|
||||
* @param string $data
|
||||
* @param string $message_number
|
||||
* @param string $message
|
||||
* @access private
|
||||
*/
|
||||
function _append_log($message_number, $message)
|
||||
|
@ -4189,7 +4186,6 @@ class SSH2
|
|||
* named constants from it, using the value as the name of the constant and the index as the value of the constant.
|
||||
* If any of the constants that would be defined already exists, none of the constants will be defined.
|
||||
*
|
||||
* @param array $array
|
||||
* @access private
|
||||
*/
|
||||
function _define_array()
|
||||
|
|
Loading…
Reference in New Issue
Block a user