diff mbox series

[01/10] scan: parse password identifier/exclusive bits

Message ID 20231205154647.1778389-1-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [01/10] scan: parse password identifier/exclusive bits | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-alpine-ci-fetch success Fetch PR
prestwoj/iwd-ci-fetch success Fetch PR
prestwoj/iwd-ci-gitlint success GitLint
prestwoj/iwd-ci-makedistcheck success Make Distcheck
prestwoj/iwd-alpine-ci-makedistcheck success Make Distcheck
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-makecheck success Make Check
prestwoj/iwd-ci-clang success clang PASS
prestwoj/iwd-alpine-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-alpine-ci-makecheck success Make Check
prestwoj/iwd-ci-incremental_build success Incremental Build with patches
prestwoj/iwd-alpine-ci-incremental_build success Incremental Build with patches
prestwoj/iwd-ci-testrunner success test-runner PASS

Commit Message

James Prestwood Dec. 5, 2023, 3:46 p.m. UTC
These bits are used to communicate to the station that SAE password
identifiers are used or required.
---
 src/scan.c | 20 +++++++++++++++++---
 src/scan.h |  2 ++
 2 files changed, 19 insertions(+), 3 deletions(-)

Comments

Denis Kenzior Dec. 6, 2023, 5 p.m. UTC | #1
Hi James,

On 12/5/23 09:46, James Prestwood wrote:
> These bits are used to communicate to the station that SAE password
> identifiers are used or required.
> ---
>   src/scan.c | 20 +++++++++++++++++---
>   src/scan.h |  2 ++
>   2 files changed, 19 insertions(+), 3 deletions(-)
> 

I applied patches 1, 2, 3, 5, 8 and 9.

Regards,
-Denis
diff mbox series

Patch

diff --git a/src/scan.c b/src/scan.c
index 5aa92a90..f48ffdef 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -1404,10 +1404,24 @@  static bool scan_parse_bss_information_elements(struct scan_bss *bss,
 			 * Currently only Proxy ARP bit (12) is checked, and if
 			 * not found, this is not a fatal error.
 			 */
-			if (iter.len < 2)
-				break;
+			if (iter.len >= 2)
+				bss->proxy_arp = test_bit(iter.data, 12);
+
+			/*
+			 * 802.11-2020 Table 9-153
+			 *
+			 * The spec merely mentions the "exclusive" bit and
+			 * doesn't enforce a requirement to check it anywhere.
+			 * But if set it would indicate the AP will only accept
+			 * auths when a password ID is used so store this in
+			 * order to fail early if no ID is set.
+			 */
+			if (iter.len >= 11) {
+				bss->sae_pw_id_used = test_bit(iter.data, 81);
+				bss->sae_pw_id_exclusive =
+							test_bit(iter.data, 82);
+			}
 
-			bss->proxy_arp = test_bit(iter.data, 12);
 		}
 	}
 
diff --git a/src/scan.h b/src/scan.h
index 0db7752d..65caf41c 100644
--- a/src/scan.h
+++ b/src/scan.h
@@ -88,6 +88,8 @@  struct scan_bss {
 	uint8_t cost_level : 3;
 	uint8_t cost_flags : 4;
 	bool dpp_configurator : 1;
+	bool sae_pw_id_used : 1;
+	bool sae_pw_id_exclusive : 1;
 };
 
 struct scan_parameters {