runtests: fix detection of TLS backends

Built-in TLS backends are detected at test time by scanning for their
names in the version string line returned by the cli tool: as this line
may also list the libssh configuration that mentions its own backend,
the curl backend may be wrongly determined.

In example, if the version line contains "libssh/0.10.4/openssl/zlib",
OpenSSL is detected as a curl-configured backend even if not.

This fix requires the backend names to appear as full words preceded by
spacing in the version line to be recognized as curl TLS backends.

Closes #10236
This commit is contained in:
Patrick Monnerat 2023-01-05 17:26:50 +01:00 committed by Daniel Stenberg
parent f92aae86c6
commit f22cd67b7d
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -3128,45 +3128,45 @@ sub checksystem {
$has_win32 = 1;
$has_mingw = 1 if ($curl =~ /-pc-mingw32/);
}
if ($libcurl =~ /(winssl|schannel)/i) {
if ($libcurl =~ /\s(winssl|schannel)\b/i) {
$has_schannel=1;
$has_sslpinning=1;
}
elsif ($libcurl =~ /openssl/i) {
elsif ($libcurl =~ /\sopenssl\b/i) {
$has_openssl=1;
$has_sslpinning=1;
}
elsif ($libcurl =~ /gnutls/i) {
elsif ($libcurl =~ /\sgnutls\b/i) {
$has_gnutls=1;
$has_sslpinning=1;
}
elsif ($libcurl =~ /rustls-ffi/i) {
elsif ($libcurl =~ /\srustls-ffi\b/i) {
$has_rustls=1;
}
elsif ($libcurl =~ /nss/i) {
elsif ($libcurl =~ /\snss\b/i) {
$has_nss=1;
$has_sslpinning=1;
}
elsif ($libcurl =~ /wolfssl/i) {
elsif ($libcurl =~ /\swolfssl\b/i) {
$has_wolfssl=1;
$has_sslpinning=1;
}
elsif ($libcurl =~ /bearssl/i) {
elsif ($libcurl =~ /\sbearssl\b/i) {
$has_bearssl=1;
}
elsif ($libcurl =~ /securetransport/i) {
elsif ($libcurl =~ /\ssecuretransport\b/i) {
$has_sectransp=1;
$has_sslpinning=1;
}
elsif ($libcurl =~ /BoringSSL/i) {
elsif ($libcurl =~ /\sBoringSSL\b/i) {
$has_boringssl=1;
$has_sslpinning=1;
}
elsif ($libcurl =~ /libressl/i) {
elsif ($libcurl =~ /\slibressl\b/i) {
$has_libressl=1;
$has_sslpinning=1;
}
elsif ($libcurl =~ /mbedTLS/i) {
elsif ($libcurl =~ /\smbedTLS\b/i) {
$has_mbedtls=1;
$has_sslpinning=1;
}