[PATCH 3/6] ctrl_iface: Add support to start PASN authentication with random address

Veerendranath Jakkam quic_vjakkam at quicinc.com
Sat Jan 7 23:51:50 PST 2023


Add support to specify own address for PASN_START control interface
command.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam at quicinc.com>
---
 wpa_supplicant/ctrl_iface.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 6588fd47b..fe79cbbce 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -11121,8 +11121,8 @@ static int wpas_ctrl_iface_configure_mscs(struct wpa_supplicant *wpa_s,
 static int wpas_ctrl_iface_pasn_start(struct wpa_supplicant *wpa_s, char *cmd)
 {
 	char *token, *context = NULL;
-	u8 bssid[ETH_ALEN];
-	int akmp = -1, cipher = -1, got_bssid = 0;
+	u8 bssid[ETH_ALEN], own_addr[ETH_ALEN];
+	int akmp = -1, cipher = -1, got_bssid = 0, got_own_addr = 0;
 	u16 group = 0xFFFF;
 	u8 *comeback = NULL;
 	size_t comeback_len = 0;
@@ -11137,6 +11137,10 @@ static int wpas_ctrl_iface_pasn_start(struct wpa_supplicant *wpa_s, char *cmd)
 			if (hwaddr_aton(token + 6, bssid))
 				goto out;
 			got_bssid = 1;
+		} else if (os_strncmp(token, "own_addr=", 9) == 0) {
+			if (hwaddr_aton(token + 9, own_addr))
+				goto out;
+			got_own_addr = 1;
 		} else if (os_strcmp(token, "akmp=PASN") == 0) {
 			akmp = WPA_KEY_MGMT_PASN;
 #ifdef CONFIG_IEEE80211R
@@ -11194,7 +11198,10 @@ static int wpas_ctrl_iface_pasn_start(struct wpa_supplicant *wpa_s, char *cmd)
 		goto out;
 	}
 
-	ret = wpas_pasn_auth_start(wpa_s, wpa_s->own_addr, bssid, akmp, cipher,
+	if (!got_own_addr)
+		os_memcpy(own_addr, wpa_s->own_addr, ETH_ALEN);
+
+	ret = wpas_pasn_auth_start(wpa_s, own_addr, bssid, akmp, cipher,
 				   group, id, comeback, comeback_len);
 out:
 	os_free(comeback);
-- 
2.25.1




More information about the Hostap mailing list