[PATCH 1/7] AP: Configure groups for 802.1X in Authentication frames
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Tue Nov 24 06:30:22 PST 2026
From: Ilan Peer <ilan.peer at intel.com>
The groups accepted in the Diffie-Hellman Parameter element of IEEE
802.1X authentication utilizing Authentication frames were fixed to
group 19.
Add the ieee8021x_auth_groups configuration option to allow other
groups. Only the ECC groups 19, 20 and 21 are accepted, and the default
remains group 19.
Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
hostapd/config_file.c | 10 ++++++++++
hostapd/hostapd.conf | 6 ++++++
src/ap/ap_config.c | 4 ++++
src/ap/ap_config.h | 3 +++
src/ap/ieee802_11.c | 14 ++++++++++++--
src/common/wpa_common.c | 14 ++++++++++++++
src/common/wpa_common.h | 1 +
7 files changed, 50 insertions(+), 2 deletions(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index aa5122957f..1a9057b9d0 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -3031,6 +3031,16 @@ static int hostapd_config_fill(struct hostapd_config *conf,
} else if (os_strcmp(buf, "eap_using_authentication_frames") == 0) {
bss->eap_using_authentication_frames = atoi(pos);
#endif /* CONFIG_ENC_ASSOC */
+#ifdef CONFIG_IEEE8021X_AUTH
+ } else if (os_strcmp(buf, "ieee8021x_auth_groups") == 0) {
+ if (hostapd_parse_intlist(&bss->ieee8021x_auth_groups, pos) ||
+ !wpa_802_1x_auth_groups_valid(bss->ieee8021x_auth_groups)) {
+ wpa_printf(MSG_ERROR,
+ "Line %d: Invalid ieee8021x_auth_groups value '%s'",
+ line, pos);
+ return 1;
+ }
+#endif /* CONFIG_IEEE8021X_AUTH */
} else if (os_strcmp(buf, "wpa_group_rekey") == 0) {
bss->wpa_group_rekey = atoi(pos);
bss->wpa_group_rekey_set = 1;
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index c2bd5efe55..700b3bb883 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -2815,6 +2815,12 @@ own_ip_addr=127.0.0.1
# 1 = enabled
#eap_using_authentication_frames=0
+# Finite cyclic groups accepted in the Diffie-Hellman Parameter element of IEEE
+# 802.1X authentication utilizing Authentication frames, as a space separated
+# list of group numbers. The default is group 19 only. Only the ECC groups 19,
+# 20 and 21 are supported.
+#ieee8021x_auth_groups=19 20 21
+
##### Neighbor table ##########################################################
# Maximum number of entries kept in AP table (either for neighbor table or for
# detecting Overlapping Legacy BSS Condition). The oldest entry will be
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
index c7aef9230d..86cfc281a7 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -1020,6 +1020,10 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf)
}
#endif /* CONFIG_AIRTIME_POLICY */
+#ifdef CONFIG_IEEE8021X_AUTH
+ os_free(conf->ieee8021x_auth_groups);
+#endif /* CONFIG_IEEE8021X_AUTH */
+
#ifdef CONFIG_PASN
os_free(conf->pasn_groups);
#ifdef CONFIG_TESTING_OPTIONS
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index b8179818ea..c3cb04b3bd 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -1035,6 +1035,9 @@ struct hostapd_bss_config {
unsigned int pmksa_caching_privacy:1;
unsigned int eap_using_authentication_frames:1;
#endif /* CONFIG_ENC_ASSOC */
+#ifdef CONFIG_IEEE8021X_AUTH
+ int *ieee8021x_auth_groups;
+#endif /* CONFIG_IEEE8021X_AUTH */
#ifdef CONFIG_ROBUST_AV
bool enable_dscp_policy_capa;
#endif /* CONFIG_ROBUST_AV */
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 736b1bda34..62e68ce685 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -2861,6 +2861,17 @@ static u16 wpa_res_to_status_code(enum wpa_validate_result res)
#ifdef CONFIG_IEEE8021X_AUTH
+static const int * dot1x_auth_groups(struct hostapd_data *hapd)
+{
+ static const int default_groups[] = { 19, 0 };
+
+ if (hapd->conf->ieee8021x_auth_groups)
+ return hapd->conf->ieee8021x_auth_groups;
+
+ return default_groups;
+}
+
+
#ifdef CONFIG_PQC
static struct wpabuf *
build_802_1x_pqc_element(struct hostapd_data *hapd, struct sta_info *sta)
@@ -3320,7 +3331,6 @@ u16 wpa_auth_validate_802_1x_frame(struct hostapd_data *hapd,
struct ieee802_11_elems *elems)
{
struct wpa_ie_data rsn;
- const int default_groups[] = { 19, 0 };
bool enc_assoc = ap_sta_support_enc_assoc(hapd,
elems->rsnxe,
elems->rsnxe_len);
@@ -3460,7 +3470,7 @@ u16 wpa_auth_validate_802_1x_frame(struct hostapd_data *hapd,
struct wpabuf *secret;
group = WPA_GET_LE16(elems->owe_dh);
- if (!int_array_includes(default_groups, group)) {
+ if (!int_array_includes(dot1x_auth_groups(hapd), group)) {
wpa_printf(MSG_INFO,
"Received unsupported group value %u",
group);
diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c
index 1743097088..e81b6a11f0 100644
--- a/src/common/wpa_common.c
+++ b/src/common/wpa_common.c
@@ -5189,6 +5189,20 @@ void wpa_add_supported_groups(struct wpabuf *buf, const int *groups)
}
+bool wpa_802_1x_auth_groups_valid(const int *groups)
+{
+ if (!groups || groups[0] <= 0)
+ return false;
+
+ for (; *groups > 0; groups++) {
+ if (*groups != 19 && *groups != 20 && *groups != 21)
+ return false;
+ }
+
+ return true;
+}
+
+
static const struct security_profile_entry
security_profile_table[] = {
/* number, key_mgmt, pairwise_cipher, ieee8021x_auth_frame,
diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h
index f55901a948..0fe8933319 100644
--- a/src/common/wpa_common.h
+++ b/src/common/wpa_common.h
@@ -876,6 +876,7 @@ int wpa_auth_802_1x_pmk_to_ptk(const u8 *pmk, size_t pmk_len, const u8 *spa,
size_t dhss_len, struct wpa_ptk *ptk,
size_t kdk_len);
void wpa_add_supported_groups(struct wpabuf *buf, const int *groups);
+bool wpa_802_1x_auth_groups_valid(const int *groups);
/* Security Profile entry (IEEE P802.11bn/D2.0) */
struct security_profile_entry {
--
2.56.1
More information about the Hostap
mailing list