Skip to content

Commit bf156f5

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 bf156f5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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), '-b', '256'
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)