From 8e71c2d66b50df6d3d92682e34230607e1816654 Mon Sep 17 00:00:00 2001 From: Joe Testa Date: Sat, 27 Jun 2020 23:59:15 -0400 Subject: [PATCH] Handle case of KexDH.recv_reply() returning None. --- ssh-audit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ssh-audit.py b/ssh-audit.py index 79672cc..b512dea 100755 --- a/ssh-audit.py +++ b/ssh-audit.py @@ -724,7 +724,8 @@ class SSH2: # pylint: disable=too-few-public-methods # with the host key and its length. Bingo. We also get back the host key fingerprint. kex_group.send_init(s) host_key = kex_group.recv_reply(s, variable_key_len) - server_kex.set_host_key(host_key_type, host_key) + if host_key is not None: + server_kex.set_host_key(host_key_type, host_key) hostkey_modulus_size = kex_group.get_hostkey_size() ca_modulus_size = kex_group.get_ca_size()