diff mbox series

[RFC] netdev: destroy auth-proto in connect event, for ext auth

Message ID 20241219124442.146136-1-prestwoj@gmail.com (mailing list archive)
State New
Headers show
Series [RFC] netdev: destroy auth-proto in connect event, for ext auth | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-alpine-ci-fetch success Fetch PR
prestwoj/iwd-ci-gitlint success GitLint
prestwoj/iwd-ci-fetch success Fetch PR
prestwoj/iwd-alpine-ci-setupell success Prep - Setup ELL
prestwoj/iwd-ci-setupell success Prep - Setup ELL
prestwoj/iwd-ci-incremental_build success Incremental build not run PASS
prestwoj/iwd-alpine-ci-makedistcheck success Make Distcheck
prestwoj/iwd-alpine-ci-incremental_build success Incremental build not run PASS
prestwoj/iwd-ci-build success Build - Configure
prestwoj/iwd-alpine-ci-build success Build - Configure
prestwoj/iwd-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-ci-clang success clang PASS
prestwoj/iwd-alpine-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-ci-makecheck success Make Check
prestwoj/iwd-alpine-ci-makecheck success Make Check
prestwoj/iwd-ci-makedistcheck success Make Distcheck
prestwoj/iwd-ci-testrunner success test-runner PASS

Commit Message

James Prestwood Dec. 19, 2024, 12:44 p.m. UTC
With external auth there is no associate event meaning the auth proto
never gets freed, which prevents eapol from starting inside the
OCI callback. Check for this specific case and free the auth proto
in the connect event.
---
 src/netdev.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Denis Kenzior Dec. 19, 2024, 5:03 p.m. UTC | #1
Hi James,

On 12/19/24 6:44 AM, James Prestwood wrote:
> With external auth there is no associate event meaning the auth proto
> never gets freed, which prevents eapol from starting inside the
> OCI callback. Check for this specific case and free the auth proto
> in the connect event.
> ---
>   src/netdev.c | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
> 

<snip>

> @@ -2821,6 +2823,16 @@ process_resp_ies:
>   
>   	l_debug("Request / Response IEs parsed");
>   
> +	/*
> +	 * This should only be the case for Fullmac/External auth. Here we don't
> +	 * get an associate event, so we need to destroy the auth-proto now
> +	 * so eapol gets started within the OCI callback
> +	 */
> +	if (netdev->ap && nhs->type == CONNECTION_TYPE_FULLMAC) {
> +		auth_proto_free(netdev->ap);
> +		netdev->ap = NULL;
> +	}
> +

Would this be better done in netdev_external_auth_sae_tx_associate() instead?

>   	if (netdev->sm) {
>   		if (!hs->chandef) {
>   			if (netdev_get_oci(netdev) < 0)

Regards,
-Denis
diff mbox series

Patch

diff --git a/src/netdev.c b/src/netdev.c
index 02496c92..9deff699 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -2615,6 +2615,8 @@  static void netdev_connect_event(struct l_genl_msg *msg, struct netdev *netdev)
 	struct handshake_state *hs = netdev->handshake;
 	bool timeout = false;
 	uint32_t timeout_reason = 0;
+	struct netdev_handshake_state *nhs = l_container_of(netdev->handshake,
+				struct netdev_handshake_state, super);
 
 	l_debug("");
 
@@ -2821,6 +2823,16 @@  process_resp_ies:
 
 	l_debug("Request / Response IEs parsed");
 
+	/*
+	 * This should only be the case for Fullmac/External auth. Here we don't
+	 * get an associate event, so we need to destroy the auth-proto now
+	 * so eapol gets started within the OCI callback
+	 */
+	if (netdev->ap && nhs->type == CONNECTION_TYPE_FULLMAC) {
+		auth_proto_free(netdev->ap);
+		netdev->ap = NULL;
+	}
+
 	if (netdev->sm) {
 		if (!hs->chandef) {
 			if (netdev_get_oci(netdev) < 0)