mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-16 02:07:09 +00:00
Merge branch '2.0'
* 2.0: Fixed another case Minor tweaks Fixed error More fixes PHPDoc fixes
This commit is contained in:
commit
3342eb6d09
@ -1748,7 +1748,6 @@ abstract class Base
|
||||
if ($this->mode == self::MODE_CFB) {
|
||||
$this->ecb = mcrypt_module_open($this->cipher_name_mcrypt, '', MCRYPT_MODE_ECB, '');
|
||||
}
|
||||
|
||||
} // else should mcrypt_generic_deinit be called?
|
||||
|
||||
if ($this->mode == self::MODE_CFB) {
|
||||
|
@ -1573,7 +1573,6 @@ class RSA
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$components = $this->_parseKey($key, $type);
|
||||
}
|
||||
@ -1788,7 +1787,6 @@ class RSA
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3723,7 +3723,7 @@ class X509
|
||||
* @param string $path absolute path with / as component separator
|
||||
* @param bool $create optional
|
||||
* @access private
|
||||
* @return array item ref or false
|
||||
* @return array|false
|
||||
*/
|
||||
function &_subArray(&$root, $path, $create = false)
|
||||
{
|
||||
@ -3759,7 +3759,7 @@ class X509
|
||||
* @param string $path optional absolute path with / as component separator
|
||||
* @param bool $create optional
|
||||
* @access private
|
||||
* @return array ref or false
|
||||
* @return array|false
|
||||
*/
|
||||
function &_extensions(&$root, $path = null, $create = false)
|
||||
{
|
||||
@ -4335,7 +4335,7 @@ class X509
|
||||
* @param string $serial
|
||||
* @param bool $create optional
|
||||
* @access private
|
||||
* @return int or false
|
||||
* @return int|false
|
||||
*/
|
||||
function _revokedCertificate(&$rclist, $serial, $create = false)
|
||||
{
|
||||
@ -4585,7 +4585,7 @@ class X509
|
||||
* getOID('zzz') == 'zzz'
|
||||
*
|
||||
* @access public
|
||||
* @return String
|
||||
* @return string
|
||||
*/
|
||||
function getOID($name)
|
||||
{
|
||||
|
@ -794,7 +794,6 @@ class BigInteger
|
||||
$vars[] = 'precision';
|
||||
}
|
||||
return $vars;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1836,7 +1835,8 @@ class BigInteger
|
||||
}
|
||||
}
|
||||
|
||||
for ($k = 0; $k <= $j; ++$k) {// eg. the length of substr($e_bits, $i, $j+1)
|
||||
// eg. the length of substr($e_bits, $i, $j + 1)
|
||||
for ($k = 0; $k <= $j; ++$k) {
|
||||
$result = $this->_squareReduce($result, $n_value, $mode);
|
||||
}
|
||||
|
||||
@ -2409,7 +2409,7 @@ class BigInteger
|
||||
* </code>
|
||||
*
|
||||
* @param \phpseclib\Math\BigInteger $n
|
||||
* @return mixed false, if no modular inverse exists, \phpseclib\Math\BigInteger, otherwise.
|
||||
* @return \phpseclib\Math\BigInteger|false
|
||||
* @access public
|
||||
* @internal See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=21 HAC 14.64} for more information.
|
||||
*/
|
||||
@ -3153,13 +3153,13 @@ class BigInteger
|
||||
/**
|
||||
* Generate a random prime number.
|
||||
*
|
||||
* If there's not a prime within the given range, false will be returned. If more than $timeout seconds have elapsed,
|
||||
* give up and return false.
|
||||
* If there's not a prime within the given range, false will be returned.
|
||||
* If more than $timeout seconds have elapsed, give up and return false.
|
||||
*
|
||||
* @param \phpseclib\Math\BigInteger $arg1
|
||||
* @param \phpseclib\Math\BigInteger $arg2
|
||||
* @param int $timeout
|
||||
* @return mixed
|
||||
* @return Math_BigInteger|false
|
||||
* @access public
|
||||
* @internal See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap4.pdf#page=15 HAC 4.44}.
|
||||
*/
|
||||
|
@ -1365,7 +1365,7 @@ class SSH1
|
||||
* Returns a string if NET_SSH1_LOGGING == self::LOG_COMPLEX, an array if NET_SSH1_LOGGING == self::LOG_SIMPLE and false if !defined('NET_SSH1_LOGGING')
|
||||
*
|
||||
* @access public
|
||||
* @return string or Array
|
||||
* @return array|false|string
|
||||
*/
|
||||
function getLog()
|
||||
{
|
||||
|
@ -188,7 +188,7 @@ class SSH2
|
||||
* Server Identifier
|
||||
*
|
||||
* @see \phpseclib\Net\SSH2::getServerIdentification()
|
||||
* @var mixed false or Array
|
||||
* @var array|false
|
||||
* @access private
|
||||
*/
|
||||
var $server_identifier = false;
|
||||
@ -197,7 +197,7 @@ class SSH2
|
||||
* Key Exchange Algorithms
|
||||
*
|
||||
* @see \phpseclib\Net\SSH2::getKexAlgorithims()
|
||||
* @var mixed false or Array
|
||||
* @var array|false
|
||||
* @access private
|
||||
*/
|
||||
var $kex_algorithms = false;
|
||||
@ -233,7 +233,7 @@ class SSH2
|
||||
* Server Host Key Algorithms
|
||||
*
|
||||
* @see \phpseclib\Net\SSH2::getServerHostKeyAlgorithms()
|
||||
* @var mixed false or Array
|
||||
* @var array|false
|
||||
* @access private
|
||||
*/
|
||||
var $server_host_key_algorithms = false;
|
||||
@ -242,7 +242,7 @@ class SSH2
|
||||
* Encryption Algorithms: Client to Server
|
||||
*
|
||||
* @see \phpseclib\Net\SSH2::getEncryptionAlgorithmsClient2Server()
|
||||
* @var mixed false or Array
|
||||
* @var array|false
|
||||
* @access private
|
||||
*/
|
||||
var $encryption_algorithms_client_to_server = false;
|
||||
@ -251,7 +251,7 @@ class SSH2
|
||||
* Encryption Algorithms: Server to Client
|
||||
*
|
||||
* @see \phpseclib\Net\SSH2::getEncryptionAlgorithmsServer2Client()
|
||||
* @var mixed false or Array
|
||||
* @var array|false
|
||||
* @access private
|
||||
*/
|
||||
var $encryption_algorithms_server_to_client = false;
|
||||
@ -260,7 +260,7 @@ class SSH2
|
||||
* MAC Algorithms: Client to Server
|
||||
*
|
||||
* @see \phpseclib\Net\SSH2::getMACAlgorithmsClient2Server()
|
||||
* @var mixed false or Array
|
||||
* @var array|false
|
||||
* @access private
|
||||
*/
|
||||
var $mac_algorithms_client_to_server = false;
|
||||
@ -269,7 +269,7 @@ class SSH2
|
||||
* MAC Algorithms: Server to Client
|
||||
*
|
||||
* @see \phpseclib\Net\SSH2::getMACAlgorithmsServer2Client()
|
||||
* @var mixed false or Array
|
||||
* @var array|false
|
||||
* @access private
|
||||
*/
|
||||
var $mac_algorithms_server_to_client = false;
|
||||
@ -278,7 +278,7 @@ class SSH2
|
||||
* Compression Algorithms: Client to Server
|
||||
*
|
||||
* @see \phpseclib\Net\SSH2::getCompressionAlgorithmsClient2Server()
|
||||
* @var mixed false or Array
|
||||
* @var array|false
|
||||
* @access private
|
||||
*/
|
||||
var $compression_algorithms_client_to_server = false;
|
||||
@ -287,7 +287,7 @@ class SSH2
|
||||
* Compression Algorithms: Server to Client
|
||||
*
|
||||
* @see \phpseclib\Net\SSH2::getCompressionAlgorithmsServer2Client()
|
||||
* @var mixed false or Array
|
||||
* @var array|false
|
||||
* @access private
|
||||
*/
|
||||
var $compression_algorithms_server_to_client = false;
|
||||
@ -296,7 +296,7 @@ class SSH2
|
||||
* Languages: Server to Client
|
||||
*
|
||||
* @see \phpseclib\Net\SSH2::getLanguagesServer2Client()
|
||||
* @var mixed false or Array
|
||||
* @var array|false
|
||||
* @access private
|
||||
*/
|
||||
var $languages_server_to_client = false;
|
||||
@ -305,7 +305,7 @@ class SSH2
|
||||
* Languages: Client to Server
|
||||
*
|
||||
* @see \phpseclib\Net\SSH2::getLanguagesClient2Server()
|
||||
* @var mixed false or Array
|
||||
* @var array|false
|
||||
* @access private
|
||||
*/
|
||||
var $languages_client_to_server = false;
|
||||
@ -1764,7 +1764,7 @@ class SSH2
|
||||
* Maps an encryption algorithm name to the number of key bytes.
|
||||
*
|
||||
* @param string $algorithm Name of the encryption algorithm
|
||||
* @return mixed Number of bytes as an integer or null for unknown
|
||||
* @return int|null Number of bytes as an integer or null for unknown
|
||||
* @access private
|
||||
*/
|
||||
function _encryption_algorithm_to_key_size($algorithm)
|
||||
@ -3654,7 +3654,7 @@ class SSH2
|
||||
* Returns a string if NET_SSH2_LOGGING == self::LOG_COMPLEX, an array if NET_SSH2_LOGGING == self::LOG_SIMPLE and false if !defined('NET_SSH2_LOGGING')
|
||||
*
|
||||
* @access public
|
||||
* @return string or Array
|
||||
* @return array|false|string
|
||||
*/
|
||||
function getLog()
|
||||
{
|
||||
@ -4085,7 +4085,7 @@ class SSH2
|
||||
/**
|
||||
* Returns the exit status of an SSH command or false.
|
||||
*
|
||||
* @return int or false
|
||||
* @return false|int
|
||||
* @access public
|
||||
*/
|
||||
function getExitStatus()
|
||||
|
@ -58,13 +58,15 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
|
||||
|
||||
$result = array();
|
||||
|
||||
// @codingStandardsIgnoreStart
|
||||
foreach ($modes as $mode)
|
||||
foreach ($plaintexts as $plaintext)
|
||||
foreach ($ivs as $iv)
|
||||
foreach ($keys as $key)
|
||||
foreach ($modes as $mode) {
|
||||
foreach ($plaintexts as $plaintext) {
|
||||
foreach ($ivs as $iv) {
|
||||
foreach ($keys as $key) {
|
||||
$result[] = array($mode, $plaintext, $iv, $key);
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
@ -155,12 +157,13 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
|
||||
|
||||
$result = array();
|
||||
|
||||
// @codingStandardsIgnoreStart
|
||||
foreach ($modes as $mode)
|
||||
foreach ($combos as $combo)
|
||||
foreach (array('encrypt', 'decrypt') as $op)
|
||||
foreach ($modes as $mode) {
|
||||
foreach ($combos as $combo) {
|
||||
foreach (array('encrypt', 'decrypt') as $op) {
|
||||
$result[] = array($op, $mode, $combo);
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
@ -211,9 +214,10 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Pretty much the same as testContinuousBufferBattery with the caveat that continuous mode is not enabled.
|
||||
*
|
||||
* @dataProvider continuousBufferBatteryCombos
|
||||
*/
|
||||
// pretty much the same as testContinuousBufferBattery with the caveat that continuous mode is not enabled
|
||||
public function testNonContinuousBufferBattery($op, $mode, $test)
|
||||
{
|
||||
if (count($test) == 1) {
|
||||
|
@ -56,12 +56,15 @@ class Unit_Crypt_BlowfishTest extends PhpseclibTestCase
|
||||
array(pack('H*', '0123456789ABCDEF'), pack('H*', '0000000000000000'), pack('H*', '245946885754369A')),
|
||||
array(pack('H*', 'FEDCBA9876543210'), pack('H*', 'FFFFFFFFFFFFFFFF'), pack('H*', '6B5C5A9C5D9E0A5A'))
|
||||
);
|
||||
|
||||
$result = array();
|
||||
// @codingStandardsIgnoreStart
|
||||
foreach ($engines as $engine => $engineName)
|
||||
foreach ($tests as $test)
|
||||
|
||||
foreach ($engines as $engine => $engineName) {
|
||||
foreach ($tests as $test) {
|
||||
$result[] = array($engine, $engineName, $test[0], $test[1], $test[2]);
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -30,12 +30,15 @@ class Unit_Crypt_RC2Test extends PhpseclibTestCase
|
||||
array('88bca90e90875a7f0f79c384627bafb2', 128, '0000000000000000', '2269552ab0f85ca6'),
|
||||
array('88bca90e90875a7f0f79c384627bafb216f80a6f85920584c42fceb0be255daf1e', 129, '0000000000000000', '5b78d3a43dfff1f1')
|
||||
);
|
||||
|
||||
$result = array();
|
||||
// @codingStandardsIgnoreStart
|
||||
foreach ($this->engines as $engine => $engineName)
|
||||
foreach ($tests as $test)
|
||||
|
||||
foreach ($this->engines as $engine => $engineName) {
|
||||
foreach ($tests as $test) {
|
||||
$result[] = array($engine, $engineName, $test[0], $test[1], $test[2], $test[3]);
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -181,13 +181,17 @@ class Unit_Crypt_RC4Test extends PhpseclibTestCase
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$result = array();
|
||||
// @codingStandardsIgnoreStart
|
||||
foreach ($engines as $engine => $engineName)
|
||||
foreach ($tests as $test)
|
||||
foreach ($test['output'] as $output)
|
||||
|
||||
foreach ($engines as $engine => $engineName) {
|
||||
foreach ($tests as $test) {
|
||||
foreach ($test['output'] as $output) {
|
||||
$result[] = array($engine, $engineName, $test['key'], $output['offset'], $output['result']);
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -87,12 +87,15 @@ class Unit_Crypt_TripleDESTest extends PhpseclibTestCase
|
||||
array(str_repeat("\x01", 24), pack('H*', '0000000000000002'), pack('H*', '06E7EA22CE92708F')),
|
||||
array(str_repeat("\x01", 24), pack('H*', '0000000000000001'), pack('H*', '166B40B44ABA4BD6'))
|
||||
);
|
||||
|
||||
$result = array();
|
||||
// @codingStandardsIgnoreStart
|
||||
foreach ($this->engines as $engine => $engineName)
|
||||
foreach ($tests as $test)
|
||||
|
||||
foreach ($this->engines as $engine => $engineName) {
|
||||
foreach ($tests as $test) {
|
||||
$result[] = array($engine, $engineName, $test[0], $test[1], $test[2]);
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -135,12 +138,15 @@ class Unit_Crypt_TripleDESTest extends PhpseclibTestCase
|
||||
pack('H*', '84401f78fe6c10876d8ea23094ea5309'),
|
||||
pack('H*', '7b1f7c7e3b1c948ebd04a75ffba7d2f5'))
|
||||
);
|
||||
|
||||
$result = array();
|
||||
// @codingStandardsIgnoreStart
|
||||
foreach ($engines as $engine => $engineName)
|
||||
foreach ($tests as $test)
|
||||
|
||||
foreach ($engines as $engine => $engineName) {
|
||||
foreach ($tests as $test) {
|
||||
$result[] = array($engine, $engineName, $test[0], $test[1], $test[2], $test[3]);
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -94,6 +94,5 @@ class Unit_File_X509_SPKACTest extends PhpseclibTestCase
|
||||
$x509->validateSignature(),
|
||||
'Failed asserting that the signature is invalid'
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user