From patchwork Fri Sep 6 16:05:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3806 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6bd4:b0:5b9:581e:f939 with SMTP id c20csp236654max; Fri, 6 Sep 2024 09:05:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUF/MBN/63ej++QnObDps01BgUeYHgZsWQZUqoep2lx0l+IU+VT5FnoOhlRmxhnUlLVZCPH+1XmBzo=@openvpn.net X-Google-Smtp-Source: AGHT+IG1lENUNHus/g5iJlFffER0MQyYhYZ2v7lL1kmqfTIQp+vasGJcJedXfheBUInMKfGH8UIn X-Received: by 2002:a17:902:ce91:b0:205:60ef:189c with SMTP id d9443c01a7336-206b83380e1mr140770685ad.12.1725638758631; Fri, 06 Sep 2024 09:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725638758; cv=none; d=google.com; s=arc-20240605; b=AcEEvAtbno+t4fzW/T3/WjV44nW8dk4fWhuxMq15/owt9PTOmIqDy1XitQ1iuMQ6dO M9n9fKGGtZl4/q3EN2LebUDQ0RFk0jq/HVET59ymT7Oe84iBoIrTub30uQbqxEuHg7bT oYwi3IgTcgYN2IlSLvGBNaYbOolOCUl8NaqOHLFVdJzvEeb6JlIp+kYi7M/sPR5MzsU7 8/DuoKIBHoI3zXW6ZO5NtfVfzISM3OkHXZkjWPIg5Z+a4j01hlOPKrQ0a3XVcC+WZohm sIpVSJH5hIVFcvwFrA2UzNPlGpyH/WxZ5KopgRgrHHCMySYbMrhE1hGvJv4OETJ3qDw+ Il5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:cc:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=uHOZL7VZvBvFxDJ+AWo+QgUqY+qAz7gjQvm2WxdaauQ=; fh=SipEYX5S4C9flAQ9PajpSE6bO+d9zIqYY9I42vPrNlU=; b=HgRVnTozlOCafvy5oYtDuXfBgqx80MAyOLTN69PYI+BecYOLJNK/DR8Xw1taSNFbuU iJlC4Cekfv/8XUsoiNoI5mpG8haO4OmObUomprQF0y8uUvgQqp7ySOJQapOpaOtnTkBF 1d4VB+yb+/hOJpZkk8gslb8RQDVN5UX6MIF7zeocLr06LJGpyJo3o6EkDJpPoTmXg1kU RfYZ6+baCr35nVZqu2Cn7Up3V7l2bY8kZNOuz6E5UrJoBR/tqgAm+UUUOMgQD80h5q2x mBioI6R+M3dVMIhLHbmAHCEIZ4wrNDhwWCOjzfs5513MPQo0JEjC/mutWWshJEjQxztQ u6vg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=WEU9f8I5; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=nJMagtRx; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=KRmB0458; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id d9443c01a7336-206f668fea2si16283375ad.497.2024.09.06.09.05.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Sep 2024 09:05:58 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=WEU9f8I5; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=nJMagtRx; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=KRmB0458; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1smbSi-0004RD-0O; Fri, 06 Sep 2024 16:05:28 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1smbSf-0004R2-Qh for openvpn-devel@lists.sourceforge.net; Fri, 06 Sep 2024 16:05:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=qJqohAdLNpQXa7WJlG5oeLefLf/YPkikpTcWXuWHEXc=; b=WEU9f8I5WTq4lvKHjnp3YXDLrx Q155ksdi5Nz43jvZ9jnfyuB+81TffQ4xvXaGFV+5WO9LCNiSQ5cReip1VsuJZHNab8v4vekPGUSrV uTEV2q/c/SNYZPC7Psc2OpJXAx8eKkX2ZjMmllCVwo9wcs5ico8d8M6w8PaqZGHqQE4U=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=qJqohAdLNpQXa7WJlG5oeLefLf/YPkikpTcWXuWHEXc=; b=nJMagtRxe1yaXQoRkZ2INhMAbe SKqzWa0x3D6zMqLv8mNb/CLO3Udgi0r8YSRMUzaYbGq5cQniHfVLKqeU1IPjOszgkjOxLyLLOsMj4 JvnksU445SHSjGwegFlmbOYWB/DCUVQiGArCCxnqobv3n5imuevrMObkHH86dMR77OzA=; Received: from mout-p-201.mailbox.org ([80.241.56.171]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1smbSe-0006mx-T8 for openvpn-devel@lists.sourceforge.net; Fri, 06 Sep 2024 16:05:26 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4X0gzq2VPlz9sj8; Fri, 6 Sep 2024 18:05:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1725638711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qJqohAdLNpQXa7WJlG5oeLefLf/YPkikpTcWXuWHEXc=; b=KRmB0458v1XJyYxmbX2S1NRIcYA5lyJgJm3SbZhDodIJ1sQeAvHpJTMUO6K+ydHTM/FsDu Shvl61Bx5iuB8sAGAxNSK5HfRJbxOX4qvnhKYSJ1pBoiSRLpQid3E7MAn4nZA+TkXAts8Y ys0JRtrvcpiqCojonPj4FAVcwaQzIFhjdm8bNMr7YPCwrXKH6oHrMY8q9UTDMu69fhtwPW o5NraVvpCgE/SGvolWbG+g4lcXLxwPM01AjrzqyNzACaBT3h5L0Ama2GcIprrWGkScg5HJ RyMNgxbKTO3IxRPt8Pud1/8b7q0C23oZKHibazOAD4cB9IBBQzW2Rvx4PgVDnA== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Fri, 6 Sep 2024 18:05:10 +0200 Message-Id: <20240906160510.76387-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: mbedTLS does not seem to have pkg-config support on e.g. Debian/Ubuntu, so we definitely need to keep the fallback check as well. Change-Id: I5d0da76018e874cda5dbab9202a2b817ad5e4692 Signed-off-by: Frank Lichtenheld Acked-by: Yuriy Darnobyt --- Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.171 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1smbSe-0006mx-T8 Subject: [Openvpn-devel] [PATCH v3] configure: Try to use pkg-config to detect mbedTLS X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yuriy Darnobyt Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1809463387235579196?= X-GMAIL-MSGID: =?utf-8?q?1809463387235579196?= mbedTLS does not seem to have pkg-config support on e.g. Debian/Ubuntu, so we definitely need to keep the fallback check as well. Change-Id: I5d0da76018e874cda5dbab9202a2b817ad5e4692 Signed-off-by: Frank Lichtenheld Acked-by: Yuriy Darnobyt --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/671 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Yuriy Darnobyt diff --git a/configure.ac b/configure.ac index 9ce826c..2d74021 100644 --- a/configure.ac +++ b/configure.ac @@ -1000,14 +1000,21 @@ if test -z "${MBEDTLS_CFLAGS}" -a -z "${MBEDTLS_LIBS}"; then # if the user did not explicitly specify flags, try to autodetect - LIBS="${LIBS} -lmbedtls -lmbedx509 -lmbedcrypto" - AC_CHECK_LIB( - [mbedtls], - [mbedtls_ssl_init], - [MBEDTLS_LIBS="-lmbedtls -lmbedx509 -lmbedcrypto"], - [AC_MSG_ERROR([Could not find mbed TLS.])], - [${PKCS11_HELPER_LIBS}] + PKG_CHECK_MODULES([MBEDTLS], + [mbedtls >= 2.0.0 mbedx509 >= 2.0.0 mbedcrypto >= 2.0.0], + [have_mbedtls="yes"], + [LIBS="${LIBS} -lmbedtls -lmbedx509 -lmbedcrypto"] ) + # mbedtls might not have pkgconfig integration, so try manually + if test "${have_mbedtls}" != "yes"; then + AC_CHECK_LIB( + [mbedtls], + [mbedtls_ssl_init], + [MBEDTLS_LIBS="-lmbedtls -lmbedx509 -lmbedcrypto"], + [AC_MSG_ERROR([Could not find mbed TLS.])], + [${PKCS11_HELPER_LIBS}] + ) + fi fi CFLAGS="${MBEDTLS_CFLAGS} ${PKCS11_HELPER_CFLAGS} ${CFLAGS}"