[PATCH 02/14] OpenSSL: make CONFIG_TLS_ENGINE_TRUSTED_PATH work
Angelo Compagnucci
angelo.compagnucci at gmail.com
Mon Nov 23 06:24:36 PST 2026
defconfig documents this build option, but Makefile and Android.mk do
not pass it to the compiler. So setting it in .config did nothing, and
the paths of the PKCS#11 and OpenSC engines and modules were never
checked.
This also hid a missing parenthesis in tls_engine_path_trusted(), so
the code did not compile with the option. Pass the option to the
compiler and add the parenthesis.
Tested by building with and without CONFIG_TLS_ENGINE_TRUSTED_PATH=y.
With it, the check is now in the binary.
Signed-off-by: Angelo Compagnucci <angelo.compagnucci at gmail.com>
---
src/crypto/tls_openssl.c | 2 +-
wpa_supplicant/Android.mk | 4 ++++
wpa_supplicant/Makefile | 4 ++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c
index 032bf05f2..cafeb1aa2 100644
--- a/src/crypto/tls_openssl.c
+++ b/src/crypto/tls_openssl.c
@@ -1086,7 +1086,7 @@ static int tls_engine_path_trusted(const char *path, char *real_path)
os_strlcpy(dir, real_path, sizeof(dir));
slash = dir;
- while ((next = os_strchr(slash + 1, '/')) {
+ while ((next = os_strchr(slash + 1, '/'))) {
*next = '\0';
if (stat(dir, &st) != 0 || !S_ISDIR(st.st_mode) ||
st.st_uid != 0 || (st.st_mode & (S_IWGRP | S_IWOTH))) {
diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk
index c7090493d..6648e93be 100644
--- a/wpa_supplicant/Android.mk
+++ b/wpa_supplicant/Android.mk
@@ -1139,6 +1139,10 @@ ifdef CONFIG_SMARTCARD
L_CFLAGS += -DCONFIG_SMARTCARD
endif
+ifdef CONFIG_TLS_ENGINE_TRUSTED_PATH
+L_CFLAGS += -DCONFIG_TLS_ENGINE_TRUSTED_PATH
+endif
+
ifdef NEED_DRAGONFLY
OBJS += src/common/dragonfly.c
endif
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 7fe5ffebc..548a4872d 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -1225,6 +1225,10 @@ ifdef CONFIG_SMARTCARD
CFLAGS += -DCONFIG_SMARTCARD
endif
+ifdef CONFIG_TLS_ENGINE_TRUSTED_PATH
+CFLAGS += -DCONFIG_TLS_ENGINE_TRUSTED_PATH
+endif
+
ifdef NEED_DRAGONFLY
OBJS += ../src/common/dragonfly.o
endif
--
2.53.0
More information about the Hostap
mailing list