Skip to content

Commit

Permalink
Misc fixes (#181)
Browse files Browse the repository at this point in the history
* fix: handle process shutdown with limited permissions

Certain platforms like Android do not have permission to list all child
processes. In this instance, just continue

* remove dsa keys from test setup

DSA has been removed from openssh for some time now, and this causes
running tests on newer machines to fail

---------

Co-authored-by: David Murphy <[email protected]>
  • Loading branch information
dead10ck and dmurphy18 authored Oct 21, 2024
1 parent 1e6169d commit dc840e3
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/saltfactories/daemons/sshd.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ def _write_config(self):
config_lines.append(f"{key} {value}\n")

# Let's generate the host keys
if platform.is_fips_enabled() is False:
self._generate_server_dsa_key()
self._generate_server_ecdsa_key()
self._generate_server_ed25519_key()
for host_key in pathlib.Path(self.config_dir).glob("ssh_host_*_key"):
Expand All @@ -184,17 +182,6 @@ def _generate_client_ecdsa_key(self):
key_path.chmod(0o0400)
return key_path_prv

def _generate_server_dsa_key(self):
key_filename = "ssh_host_dsa_key"
key_path_prv = self.config_dir / key_filename
key_path_pub = self.config_dir / f"{key_filename}.pub"
if key_path_prv.exists() and key_path_pub.exists():
return key_path_prv
self._ssh_keygen(key_filename, "dsa", "1024")
for key_path in (key_path_prv, key_path_pub):
key_path.chmod(0o0400)
return key_path_prv

def _generate_server_ecdsa_key(self):
key_filename = "ssh_host_ecdsa_key"
key_path_prv = self.config_dir / key_filename
Expand Down

0 comments on commit dc840e3

Please sign in to comment.