From 1896f8c7583f40652c212d2c5ded8c91b98873c4 Mon Sep 17 00:00:00 2001 From: Lars Wikman Date: Tue, 22 Apr 2025 09:27:17 +0200 Subject: [PATCH] package/wpa_supplicant: add Smart card option CONFIG_SMARTCARD was unconditionally disabled which has meant that even if OpenSSL is compiled with engine support and the supplicant is configured to use an engine it would warn that it was compiled without engine support. This mechanism is used to enable the more secure forms of 802.1x networking authentication such as EAP-TLS with hardware-delegated cryptography and private keys protected in hardware. Enabling the option will allow delegating private key access to TPM2, ARM TrustZone and other specialized secure hardware for establishing a network connection. Signed-off-by: Lars Wikman Signed-off-by: Thomas Petazzoni --- package/wpa_supplicant/Config.in | 8 ++++++++ package/wpa_supplicant/wpa_supplicant.mk | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/package/wpa_supplicant/Config.in b/package/wpa_supplicant/Config.in index 92953f69f0..e385d762e6 100644 --- a/package/wpa_supplicant/Config.in +++ b/package/wpa_supplicant/Config.in @@ -175,4 +175,12 @@ config BR2_PACKAGE_WPA_SUPPLICANT_DBUS_INTROSPECTION help Add introspection support for the DBus control interface. +config BR2_PACKAGE_WPA_SUPPLICANT_SMARTCARD + bool "Smartcard support" + select BR2_PACKAGE_OPENSSL + select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL + help + Enable the smart card support. Required for OpenSSL engines + to work using PKCS11 and 802.1x + endif diff --git a/package/wpa_supplicant/wpa_supplicant.mk b/package/wpa_supplicant/wpa_supplicant.mk index 44cfed495b..9de536b943 100644 --- a/package/wpa_supplicant/wpa_supplicant.mk +++ b/package/wpa_supplicant/wpa_supplicant.mk @@ -24,9 +24,6 @@ WPA_SUPPLICANT_CONFIG_ENABLE = \ CONFIG_INTERNAL_LIBTOMMATH \ CONFIG_MATCH_IFACE -WPA_SUPPLICANT_CONFIG_DISABLE = \ - CONFIG_SMARTCARD - # libnl-3 needs -lm (for rint) and -lpthread if linking statically # And library order matters hence stick -lnl-3 first since it's appended # in the wpa_supplicant Makefiles as in LIBS+=-lnl-3 ... thus failing @@ -191,6 +188,12 @@ WPA_SUPPLICANT_DEPENDENCIES += readline WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_READLINE endif +ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_SMARTCARD),y) +WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_SMARTCARD +else +WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_SMARTCARD +endif + ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE),y) define WPA_SUPPLICANT_ENABLE_CTRL_IFACE sed -i '/ctrl_interface/s/^#//g' $(TARGET_DIR)/etc/wpa_supplicant.conf