From: "flichtenheld (Code Review)" Date: Wed, 16 Jul 2025 14:08:30 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="SBOlxa/0iwA="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: configure.ac: Remove use of PKCS11_HELPER_LIBS in mbedTLS checks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --SBOlxa/0iwA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1088?usp=3Demail to review the following change. Change subject: configure.ac: Remove use of PKCS11_HELPER_LIBS in mbedTLS c= hecks ...................................................................... configure.ac: Remove use of PKCS11_HELPER_LIBS in mbedTLS checks This code was copied over and over since many years, since commit 9a3f670248d6f519a399e65a7232e2196b5115db ("Fixed autoconf script to properly detect missing pkcs11 with polarssl"). It is unclear what exact purpose it served back then but probably it is obsolete. It is definitely wrong since it means that you get PKCS11_HELPER_LIBS even if you do not specify --enable-pkcs11. Change-Id: I317be5253d6563906dd3826421dc81f737beba76 Signed-off-by: Frank Lichtenheld --- M configure.ac 1 file changed, 8 insertions(+), 12 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/88/1088/1 diff --git a/configure.ac b/configure.ac index 8fc48ba..66cb79b 100644 --- a/configure.ac +++ b/configure.ac @@ -798,14 +798,6 @@ ;; esac -PKG_CHECK_MODULES( - [PKCS11_HELPER], - [libpkcs11-helper-1 >=3D 1.11], - [have_pkcs11_helper=3D"yes"], - [] -) - - if test "$enable_dco" !=3D "no"; then enable_dco_arg=3D"$enable_dco" if test "${enable_iproute2}" =3D "yes"; then @@ -1014,13 +1006,12 @@ [mbedtls_ssl_init], [MBEDTLS_LIBS=3D"-lmbedtls -lmbedx509 -lmbedcrypto"], [AC_MSG_ERROR([Could not find mbed TLS.])], - [${PKCS11_HELPER_LIBS}] ) fi fi - CFLAGS=3D"${MBEDTLS_CFLAGS} ${PKCS11_HELPER_CFLAGS} ${CFLAGS}" - LIBS=3D"${MBEDTLS_LIBS} ${PKCS11_HELPER_LIBS} ${LIBS}" + CFLAGS=3D"${MBEDTLS_CFLAGS} ${CFLAGS}" + LIBS=3D"${MBEDTLS_LIBS} ${LIBS}" AC_MSG_CHECKING([mbedtls version]) AC_COMPILE_IFELSE( @@ -1359,7 +1350,12 @@ AM_CONDITIONAL([HAVE_SOFTHSM2], [false]) if test "${enable_pkcs11}" =3D "yes"; then - test "${have_pkcs11_helper}" !=3D "yes" && AC_MSG_ERROR([PKCS11 enabled b= ut libpkcs11-helper is missing]) + PKG_CHECK_MODULES( + [PKCS11_HELPER], + [libpkcs11-helper-1 >=3D 1.11], + [have_pkcs11_helper=3D"yes"], + [AC_MSG_ERROR([PKCS11 enabled but libpkcs11-helper is missing])] + ) OPTIONAL_PKCS11_HELPER_CFLAGS=3D"${PKCS11_HELPER_CFLAGS}" OPTIONAL_PKCS11_HELPER_LIBS=3D"${PKCS11_HELPER_LIBS}" AC_DEFINE([ENABLE_PKCS11], [1], [Enable PKCS11]) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1088?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I317be5253d6563906dd3826421dc81f737beba76 Gerrit-Change-Number: 1088 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --SBOlxa/0iwA= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

configure.ac: Remove use of PKCS11_HELPER_LIBS in mbedTLS ch=
ecks

This code was copied over and over since many years,
since c= ommit 9a3f670248d6f519a399e65a7232e2196b5115db
("Fixed autoconf scr= ipt to properly detect missing pkcs11
with polarssl"). It is unclea= r what exact purpose it
served back then but probably it is obsolete. It= is
definitely wrong since it means that you get
PKCS11_HELPER_LIBS e= ven if you do not specify
--enable-pkcs11.

Change-Id: I317be5253d= 6563906dd3826421dc81f737beba76
Signed-off-by: Frank Lichtenheld <fran= k@...2641...>
---
M configure.ac
1 file changed, 8 insertions(+= ), 12 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvp=
n refs/changes/88/1088/1
diff --git a/configure.ac b/configure.ac
index 8fc48ba..66cb79b 100644
--- a/configur= e.ac
+++ b/configure.ac
@@ -798,14 +798,6 @= @
;;
esac

<= span style=3D"color: hsl(0, 100%, 40%);">-PKG_CHECK_MODULES(

- [PKCS11_HELPER],
- [libpkcs11-helper-1 >=3D 1.11],

- [have_pkcs11_helper=3D&qu= ot;yes"],
- []
-)
-
-
if test "$enable_dco" !=3D "no&= quot;; then
enable_dco_arg=3D"$enable_dco"
if test "${enable_iproute2}" =3D "yes"; t= hen
@@ -1014,13 +1006,12 @@
[mbedtls_s= sl_init],
[MBEDTLS_LIBS=3D"-lmbedtls -lmbedx509 -= lmbedcrypto"],
[AC_MSG_ERROR([Could not find mbed= TLS.])],
- [${PKCS1= 1_HELPER_LIBS}]
)
fi
fi


- CFLAGS=3D"${MBEDTLS_CFLAGS} ${PKCS11_HELPER_CFLAGS} ${CFLAGS}"=
- LIBS=3D"${MBEDT= LS_LIBS} ${PKCS11_HELPER_LIBS} ${LIBS}"
+ CFLAGS=3D"${MBEDTLS_CFLAGS} ${CFLAGS}"<= /span>
+ LIBS=3D"${MBED= TLS_LIBS} ${LIBS}"

AC_MSG_CHECKING= ([mbedtls version])
AC_COMPILE_IFELSE(
@@= -1359,7 +1350,12 @@

AM_CONDITIONAL([HAV= E_SOFTHSM2], [false])
if test "${enable_pkcs11}"= =3D "yes"; then
- test "${have_pkcs11_helper}" !=3D "yes" &&= ; AC_MSG_ERROR([PKCS11 enabled but libpkcs11-helper is missing])
= + PKG_CHECK_MODULES(
= + [PKCS11_HELPER],
<= span style=3D"color: hsl(120, 100%, 40%);">+ [libpkcs11-helper-1 >=3D 1= .11],

+ [have_pkcs11= _helper=3D"yes"],
+ [AC_MSG_ERROR([PKCS11 enabled but libpkcs11-helper is missing])]<= /span>
+ )
= OPTIONAL_PKCS11_HELPER_CFLAGS=3D"${PKCS11_HELPER_CFLAGS}"=
OPTIONAL_PKCS11_HELPER_LIBS=3D"${PKCS11_HELPER_LIBS}"=
AC_DEFINE([ENABLE_PKCS11], [1], [Enable PKCS11])<= br>

To view, visit change 1088. To unsubscribe, or for= help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I317be5253d6563906dd3826421d= c81f737beba76
Gerrit-Change-Number: 1088
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-MessageType: newchange
--SBOlxa/0iwA=--