mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-16 02:07:09 +00:00
Merge branch 'master' into php5
* master: SSH2: rm redundant part of SSH2 unit test SSH2: add unit test for getServerPublicHostKey SSH2: make it so you can verify server public host key without logging on
This commit is contained in:
commit
563b8af6ce
@ -3622,6 +3622,13 @@ class Net_SSH2
|
|||||||
*/
|
*/
|
||||||
function getServerPublicHostKey()
|
function getServerPublicHostKey()
|
||||||
{
|
{
|
||||||
|
if (!($this->bitmap & NET_SSH2_MASK_CONSTRUCTOR)) {
|
||||||
|
$this->bitmap |= NET_SSH2_MASK_CONSTRUCTOR;
|
||||||
|
if (!$this->_connect()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$signature = $this->signature;
|
$signature = $this->signature;
|
||||||
$server_public_host_key = $this->server_public_host_key;
|
$server_public_host_key = $this->server_public_host_key;
|
||||||
|
|
||||||
|
@ -58,4 +58,11 @@ class Functional_Net_SSH2Test extends PhpseclibFunctionalTestCase
|
|||||||
->will($this->returnValue(true));
|
->will($this->returnValue(true));
|
||||||
$ssh->exec('pwd', array($callbackObject, 'callbackMethod'));
|
$ssh->exec('pwd', array($callbackObject, 'callbackMethod'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testGetServerPublicHostKey()
|
||||||
|
{
|
||||||
|
$ssh = new Net_SSH2($this->getEnv('SSH_HOSTNAME'));
|
||||||
|
|
||||||
|
$this->assertInternalType('string', $ssh->getServerPublicHostKey());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user