From f22cd67b7d3ad6646e3e6ae3aea7c3b9cbe8261c Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Thu, 5 Jan 2023 17:26:50 +0100 Subject: [PATCH] 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 --- tests/runtests.pl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/runtests.pl b/tests/runtests.pl index 67e42b77e4..71644ad18e 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -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; } -- 2.47.3