Skip to content

Commit 5baf801

Browse files
committed
tests: Use ECDSA keys in tests
The ECDSA keys are much more lightweight, faster to generate and use, while very compatible with various environments including FIPS. This brings the time to complete the whole testsuite on my machine from 22s to 4s. Signed-off-by: Jakub Jelen <jjelen@redhat.com>
1 parent be3f39c commit 5baf801

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Changed tests to use more lightweight ECDSA keys to avoid
2+
timeouts -- by :user:`Jakuje`.

tests/conftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ def sshd_hostkey_path(sshd_path):
7676
7777
# noqa: DAR101
7878
"""
79-
path = sshd_path / 'ssh_host_rsa_key'
80-
keygen_cmd = 'ssh-keygen', '-N', '', '-f', str(path)
79+
path = sshd_path / 'ssh_host_ecdsa_key'
80+
keygen_cmd = 'ssh-keygen', '-N', '', '-f', str(path), '-t', 'ecdsa'
8181
subprocess.check_call(keygen_cmd)
8282
path.chmod(_FILE_PRIV_RW_OWNER)
8383
return path
@@ -92,11 +92,11 @@ def ssh_clientkey_path(sshd_path):
9292
9393
# noqa: DAR101
9494
"""
95-
path = sshd_path / 'ssh_client_rsa_key'
95+
path = sshd_path / 'ssh_client_ecdsa_key'
9696
keygen_cmd = ( # noqa: WPS317
9797
'ssh-keygen',
98-
'-t', 'rsa',
99-
'-b', '8192',
98+
'-t', 'ecdsa',
99+
'-b', '256',
100100
'-C', 'ansible-pylibssh integration tests key',
101101
'-N', '',
102102
'-f', str(path),

0 commit comments

Comments
 (0)