runtests: allow configuring SSH host/client key algorithm

via env `CURL_TEST_SSH_KEYALGO`, `rsa` (default), `ecdsa`, `ed25519`.

To ease debugging and testing and to make these code paths more
universal.

Closes #21223
This commit is contained in:
Viktor Szakats 2026-04-02 01:05:54 +02:00
parent 2e5d219205
commit acda4eae5e
No known key found for this signature in database
7 changed files with 44 additions and 13 deletions

View file

@ -627,9 +627,13 @@ sub checksystemfeatures {
}
if($libcurl =~ /libssh2/i) {
$feature{"libssh2"} = 1;
$feature{"sshkeyalgo"} = ($ENV{'CURL_TEST_SSH_KEYALGO'} and
$ENV{'CURL_TEST_SSH_KEYALGO'} =~ /^(?:rsa|ecdsa|ed25519)$/) ? $ENV{'CURL_TEST_SSH_KEYALGO'} : 'rsa';
}
if($libcurl =~ /libssh\/([0-9.]*)\//i) {
$feature{"libssh"} = 1;
$feature{"sshkeyalgo"} = ($ENV{'CURL_TEST_SSH_KEYALGO'} and
$ENV{'CURL_TEST_SSH_KEYALGO'} =~ /^(?:rsa|ecdsa|ed25519)$/) ? $ENV{'CURL_TEST_SSH_KEYALGO'} : 'rsa';
# Detect simple cases of default libssh configuration files ending up
# setting `StrictHostKeyChecking no`. include files, quoted values,
# '=value' format not implemented.