From 979ff62887f1eae60a5480e90b8ce681cc46c569 Mon Sep 17 00:00:00 2001 From: benlau Date: Fri, 18 Jul 2025 19:18:53 +0800 Subject: [PATCH] modify third_party_wpa_supplicant Signed-off-by: benlau --- bundle.json | 1 + wpa_supplicant-2.9_standard/BUILD.gn | 11 ++++++++++- wpa_supplicant-2.9_standard/src/eap_peer/eap.c | 8 ++++++-- .../src/eapol_supp/eapol_supp_sm.c | 7 ++++++- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/bundle.json b/bundle.json index 25e283d..1ab0cc4 100644 --- a/bundle.json +++ b/bundle.json @@ -39,6 +39,7 @@ "deps": { "components": [ "drivers_peripheral_wlan", + "drivers_peripheral_ethernet", "certificate_manager", "c_utils", "hdf_core", diff --git a/wpa_supplicant-2.9_standard/BUILD.gn b/wpa_supplicant-2.9_standard/BUILD.gn index 9d075a2..b606667 100644 --- a/wpa_supplicant-2.9_standard/BUILD.gn +++ b/wpa_supplicant-2.9_standard/BUILD.gn @@ -551,7 +551,10 @@ ohos_shared_library("wpa_sys") { } if (wpa_supplicant_config_ext_auth) { - external_deps += [ "drivers_peripheral_wlan:wpa_hdi_client" ] + external_deps += [ + "drivers_peripheral_wlan:wpa_hdi_client", + "drivers_peripheral_ethernet:ethernet_hdi_client", + ] } if ("${CONFIG_DRIVER}" == "nl80211") { @@ -702,6 +705,11 @@ ohos_shared_library("wpa") { ] if (wpa_supplicant_config_ext_auth) { cflags += [ "-DEXT_AUTHENTICATION_SUPPORT" ] + cflags += [ "-DCONFIG_DRIVER_WIRED" ] + sources += [ + "$WPA_ROOT_DIR/src/drivers/driver_wired.c", + "$WPA_ROOT_DIR/src/drivers/driver_wired_common.c", + ] } if ("${CONFIG_CTRL_IFACE}" == "udp") { cflags += [ "-DCONFIG_CTRL_IFACE_UDP" ] @@ -737,6 +745,7 @@ ohos_shared_library("wpa") { "drivers_peripheral_wlan:hostapd_hdi_client", "drivers_peripheral_wlan:wifi_driver_client", "drivers_peripheral_wlan:wpa_hdi_client", + "drivers_peripheral_ethernet:ethernet_hdi_client", "huks:libhukssdk", "init:libbegetutil", ] diff --git a/wpa_supplicant-2.9_standard/src/eap_peer/eap.c b/wpa_supplicant-2.9_standard/src/eap_peer/eap.c index f1b5b24..bed4362 100644 --- a/wpa_supplicant-2.9_standard/src/eap_peer/eap.c +++ b/wpa_supplicant-2.9_standard/src/eap_peer/eap.c @@ -37,6 +37,7 @@ #include "securec.h" #ifdef CONFIG_LIBWPA_VENDOR #include "wpa_client.h" +#include "ethernet_eap_client.h" #endif #endif /* EXT_AUTHENTICATION_SUPPORT */ @@ -936,8 +937,11 @@ static void tx_ext_certification(STATE_MACHINE_DATA *sm) wpa_printf(MSG_ERROR, "snprintf_s error: %d", res); return; } - - WpaEventReport(g_ifnameToString[ifname], WPA_EVENT_STA_NOTIFY, (void *) param); + if (ifname == IFNAME_ETH0) { + EthEapClientEventReport(g_ifnameToString[ifname], (char *)param); + } else { + WpaEventReport(g_ifnameToString[ifname], WPA_EVENT_STA_NOTIFY, (void *) param); + } clear_eap_data(); eapol_set_bool(sm, EAPOL_eapResp, false); #endif diff --git a/wpa_supplicant-2.9_standard/src/eapol_supp/eapol_supp_sm.c b/wpa_supplicant-2.9_standard/src/eapol_supp/eapol_supp_sm.c index 94f27bd..4dced64 100644 --- a/wpa_supplicant-2.9_standard/src/eapol_supp/eapol_supp_sm.c +++ b/wpa_supplicant-2.9_standard/src/eapol_supp/eapol_supp_sm.c @@ -27,6 +27,7 @@ #include "securec.h" #ifdef CONFIG_LIBWPA_VENDOR #include "wpa_client.h" +#include "ethernet_eap_client.h" #endif #endif /* EXT_AUTHENTICATION_SUPPORT */ @@ -1206,7 +1207,11 @@ static void rx_ext_certification(struct eapol_sm *sm) return; } free(base64Parm); - WpaEventReport(g_ifnameToString[ifname], WPA_EVENT_STA_NOTIFY, (void *)param); + if (ifname == IFNAME_ETH0) { + EthEapClientEventReport(g_ifnameToString[ifname], (char *)param); + } else { + WpaEventReport(g_ifnameToString[ifname], WPA_EVENT_STA_NOTIFY, (void *)param); + } #endif } #endif /* EXT_AUTHENTICATION_SUPPORT */ -- Gitee