mirror of
				https://github.com/jtesta/ssh-audit.git
				synced 2025-11-03 18:52:15 +01:00 
			
		
		
		
	Fixed a crash while doing host key tests.
This commit is contained in:
		@@ -21,7 +21,7 @@
 | 
			
		||||
   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
			
		||||
   THE SOFTWARE.
 | 
			
		||||
"""
 | 
			
		||||
VERSION = 'v2.4.0'
 | 
			
		||||
VERSION = 'v2.5.0-dev'
 | 
			
		||||
SSH_HEADER = 'SSH-{0}-OpenSSH_8.2'  # SSH software to impersonate
 | 
			
		||||
GITHUB_ISSUES_URL = 'https://github.com/jtesta/ssh-audit/issues'  # The URL to the Github issues tracker.
 | 
			
		||||
WINDOWS_MAN_PAGE = ''
 | 
			
		||||
 
 | 
			
		||||
@@ -125,8 +125,8 @@ class HostKeyTest:
 | 
			
		||||
 | 
			
		||||
                # Do the initial DH exchange.  The server responds back
 | 
			
		||||
                # with the host key and its length.  Bingo.  We also get back the host key fingerprint.
 | 
			
		||||
                kex_group.send_init(s)
 | 
			
		||||
                try:
 | 
			
		||||
                    kex_group.send_init(s)
 | 
			
		||||
                    host_key = kex_group.recv_reply(s, variable_key_len)
 | 
			
		||||
                    if host_key is not None:
 | 
			
		||||
                        server_kex.set_host_key(host_key_type, host_key)
 | 
			
		||||
 
 | 
			
		||||
@@ -327,7 +327,7 @@ class KexGroupExchange(KexDH):
 | 
			
		||||
        s.send_packet()
 | 
			
		||||
 | 
			
		||||
        packet_type, payload = s.read_packet(2)
 | 
			
		||||
        if (packet_type != Protocol.MSG_KEXDH_GEX_GROUP) and (packet_type != Protocol.MSG_DEBUG):  # pylint: disable=consider-using-in
 | 
			
		||||
        if packet_type not in [Protocol.MSG_KEXDH_GEX_GROUP, Protocol.MSG_DEBUG]:
 | 
			
		||||
            # TODO: replace with a better exception type.
 | 
			
		||||
            raise Exception('Expected MSG_KEXDH_GEX_REPLY (%d), but got %d instead.' % (Protocol.MSG_KEXDH_GEX_REPLY, packet_type))
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user