mirror of
https://github.com/danog/phpseclib.git
synced 2025-01-22 04:51:19 +01:00
Merge branch '3.0'
This commit is contained in:
commit
a9a8f69bc5
@ -518,6 +518,10 @@ abstract class ASN1
|
||||
*/
|
||||
public static function asn1map($decoded, $mapping, $special = [])
|
||||
{
|
||||
if (!is_array($decoded)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($mapping['explicit']) && is_array($decoded['content'])) {
|
||||
$decoded = $decoded['content'][0];
|
||||
}
|
||||
|
@ -1339,7 +1339,7 @@ class SSH2
|
||||
*/
|
||||
private function generate_identifier()
|
||||
{
|
||||
$identifier = 'SSH-2.0-phpseclib_2.0';
|
||||
$identifier = 'SSH-2.0-phpseclib_3.0';
|
||||
|
||||
$ext = [];
|
||||
if (extension_loaded('sodium')) {
|
||||
|
@ -1047,4 +1047,18 @@ ut3+b2Xvzq8yzmHMFtLIJ6Afu1jJpqD82BUAFcvi5vhnP8M7b974R18WCOpgNQvXDI+2/8ZINeU=
|
||||
$r = $x509->loadX509($r);
|
||||
$this->assertSame($r['tbsCertificate']['extensions'][5]['extnValue']['excludedSubtrees'][1]['base']['iPAddress'], array('0.0.0.0', '0.0.0.0'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group github1456
|
||||
*/
|
||||
public function testRandomString()
|
||||
{
|
||||
$a = 'da7e705569d4196cd49cf3b3d92cd435ca34ccbe';
|
||||
$a = pack('H*', $a);
|
||||
|
||||
$x509 = new X509();
|
||||
$r = $x509->loadX509($a);
|
||||
|
||||
$this->assertFalse($r);
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ class Unit_Net_SSH2Test extends PhpseclibTestCase
|
||||
public function testGenerateIdentifier()
|
||||
{
|
||||
$identifier = self::callFunc($this->createSSHMock(), 'generate_identifier');
|
||||
$this->assertStringStartsWith('SSH-2.0-phpseclib_2.0', $identifier);
|
||||
$this->assertStringStartsWith('SSH-2.0-phpseclib_3.0', $identifier);
|
||||
|
||||
if (function_exists('\\Sodium\\library_version_major')) {
|
||||
$this->assertContains('libsodium', $identifier);
|
||||
|
Loading…
x
Reference in New Issue
Block a user