Skip to content

Commit

Permalink
Fixed DH rate testing on Windows. (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtesta committed Sep 28, 2024
1 parent cb6142c commit 221b08c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/ssh_audit/dheat.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,6 @@ def _close_socket(socket_dict: Dict[socket.socket, float], s: socket.socket) ->

del socket_dict[s]

if sys.platform == "win32":
DHEat.YELLOWB = "\033[1;93m"
DHEat.CLEAR = "\033[0m"
print("\n%sUnfortunately, this feature is not currently functional under Windows.%s This should get fixed in a future release. See: <https://github.com/jtesta/ssh-audit/issues/261>" % (DHEat.YELLOWB, DHEat.CLEAR))
return ""

# Resolve the target into an IP address
out.d("Resolving target %s..." % aconf.host)
target_address_family, target_ip_address = DHEat._resolve_hostname(aconf.host, aconf.ip_version_preference)
Expand Down Expand Up @@ -443,7 +437,7 @@ def _close_socket(socket_dict: Dict[socket.socket, float], s: socket.socket) ->
# out.d("Creating socket (%u of %u already exist)..." % (len(socket_dict), concurrent_sockets), write_now=True)
ret = s.connect_ex((target_ip_address, aconf.port))
num_attempted_connections += 1
if ret in [0, errno.EINPROGRESS]:
if ret in [0, errno.EINPROGRESS, errno.EWOULDBLOCK]:
socket_dict[s] = now
else:
out.d("connect_ex() returned: %s (%d)" % (os.strerror(ret), ret), write_now=True)
Expand Down

0 comments on commit 221b08c

Please sign in to comment.