Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj at gmail.com>
To: iwd at lists.01.org
Subject: [PATCH 7/9] station: set OCVC for handshakes
Date: Mon, 27 Sep 2021 10:04:02 -0700	[thread overview]
Message-ID: <20210927170404.1292107-7-prestwoj@gmail.com> (raw)
In-Reply-To: 20210927170404.1292107-1-prestwoj@gmail.com

[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]

Setting OCVC true for all connections except FT-over-DS. Since
Authentication is skipped there is no way to obtain OCI information
from the kernel prior to (Re)association.
---
 src/station.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/station.c b/src/station.c
index 672c4860..96794998 100644
--- a/src/station.c
+++ b/src/station.c
@@ -998,11 +998,11 @@ static int station_build_handshake_rsn(struct handshake_state *hs,
 	enum security security = network_get_security(network);
 	bool add_mde = false;
 	struct erp_cache_entry *erp_cache = NULL;
-
 	struct ie_rsn_info bss_info;
 	uint8_t rsne_buf[256];
 	struct ie_rsn_info info;
 	uint8_t *ap_ie;
+	bool ocvc = true;
 
 	memset(&info, 0, sizeof(info));
 
@@ -1080,6 +1080,16 @@ static int station_build_handshake_rsn(struct handshake_state *hs,
 		goto not_supported;
 
 build_ie:
+	if (IE_AKM_IS_FT(info.akm_suites)) {
+		/* Don't set OCVC if FT-over-DS is enabled */
+		if (bss->mde[2] & 1)
+			ocvc = false;
+
+		add_mde = true;
+	}
+
+	info.ocvc = ocvc;
+
 	/* RSN takes priority */
 	if (bss->rsne) {
 		ap_ie = bss->rsne;
@@ -1099,9 +1109,6 @@ build_ie:
 	if (!handshake_state_set_supplicant_ie(hs, rsne_buf))
 		goto not_supported;
 
-	if (IE_AKM_IS_FT(info.akm_suites))
-		add_mde = true;
-
 	/*
 	 * If FILS was chosen, the ERP cache has been verified to exist. Take
 	 * a reference now so it remains valid (in case of expiration) until
-- 
2.31.1

             reply	other threads:[~2021-09-27 17:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27 17:04 James Prestwood [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-09-27 17:47 [PATCH 7/9] station: set OCVC for handshakes Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210927170404.1292107-7-prestwoj@gmail.com \
    --to=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox