From 8e8f4bd7450cd93e7b5f1f76aa4b837ccf7a6d3b Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Thu, 22 Oct 2026 06:03:26 -0300
Subject: Clarify libidn2 requirement and name DNS matcher
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 ConfigureChecks.cmake | 2 +-
 src/tls/tqca-tls.cpp  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index b12a7b4..dcf565a 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -38,7 +38,7 @@ if( BUILD_TQCA_TLS )
 ##### check for libidn2
 pkg_search_module( IDN2 QUIET libidn2>=2.2.0 )
 if( NOT IDN2_FOUND )
-    tde_message_fatal( "libidn2 2.2.0 or newer is required when the TLS plugin is enabled (install the development package providing libidn2.pc)" )
+    tde_message_fatal( "libidn2 2.2.0 or newer is required but was not found on your system" )
 endif()
 
 ##### check for openssl
diff --git a/src/tls/tqca-tls.cpp b/src/tls/tqca-tls.cpp
index 38174f7..b1fa274 100644
--- a/src/tls/tqca-tls.cpp
+++ b/src/tls/tqca-tls.cpp
@@ -678,9 +678,9 @@ auq_err:
 }
 
 // (adapted from tdelibs) -- Justin
-static bool cnMatchesAddress(const TQString &_cn, const TQString &peerHost)
+static bool dnsIdMatchesHost(const TQString &_dnsId, const TQString &peerHost)
 {
-	TQString pattern = _cn.lower();
+	TQString pattern = _dnsId.lower();
 	TQString host = peerHost.lower();
 	TQRegExp invalidDns("[^a-z0-9.\\-]");
 	if(pattern.isEmpty() || host.isEmpty() ||
@@ -971,7 +971,7 @@ public:
 				const unsigned char *data = ASN1_STRING_get0_data(dnsName);
 				int length = ASN1_STRING_length(dnsName);
 				if(length > 0 && !memchr(data, '\0', length) &&
-				   cnMatchesAddress(TQString::fromLatin1(reinterpret_cast<const char *>(data), length), peerHost)) {
+				   dnsIdMatchesHost(TQString::fromLatin1(reinterpret_cast<const char *>(data), length), peerHost)) {
 					matched = true;
 					break;
 				}
-- 
cgit v1.2.3

