From 5f5678126146b151f2e37b2dd459514c3472606c Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 16 Jun 2014 10:19:34 -0500 Subject: [PATCH] SSH2: make it so you can verify server public host key without logging on --- phpseclib/Net/SSH2.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 49382177..a0312416 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -3625,6 +3625,13 @@ class Net_SSH2 */ function getServerPublicHostKey() { + if (!($this->bitmap & NET_SSH2_MASK_CONSTRUCTOR)) { + $this->bitmap |= NET_SSH2_MASK_CONSTRUCTOR; + if (!$this->_connect()) { + return false; + } + } + $signature = $this->signature; $server_public_host_key = $this->server_public_host_key;