refactor(nan): put RSN KDE OUI in one array, drop dead OUI byte macros

Replace the three NAN_KDE_OUI_RSN_* byte writes in nan_kde_put_hdr() with a
single nan_kde_rsn_oui[] array, and remove the now-unused NAN_KDE_OUI_RSN_*
byte macros and the never-used NAN_KDE_OUI_WFA_* byte macros. The combined
NAN_KDE_OUI_RSN / NAN_KDE_OUI_WFA (used by the KDE parser) are kept.
This commit is contained in:
Sarvesh Bodakhe
2026-07-01 16:05:36 +05:30
parent dc3ada69b5
commit 5275d5ef08
2 changed files with 5 additions and 9 deletions

View File

@@ -132,12 +132,6 @@ extern void *s_nan_data_lock;
/* NAN KDE OUIs and Data Types carried in the Key Data field (Wi-Fi Aware
* v4.0 §9.5.21.5 Table 126; formats per 802.11 Fig 12-36/12-42/12-47). */
#define NAN_KDE_OUI_RSN_0 0x00
#define NAN_KDE_OUI_RSN_1 0x0F
#define NAN_KDE_OUI_RSN_2 0xAC
#define NAN_KDE_OUI_WFA_0 0x50
#define NAN_KDE_OUI_WFA_1 0x6F
#define NAN_KDE_OUI_WFA_2 0x9A
#define NAN_KDE_OUI_RSN 0x000FACUL
#define NAN_KDE_OUI_WFA 0x506F9AUL
#define NAN_KDE_TYPE_GTK 1 /* 00-0F-AC GTK KDE */

View File

@@ -778,15 +778,17 @@ void nan_security_reset_own_group_keys(void)
s_nan_ctx.own_bigtk_set = false;
}
/* 00-0F-AC RSN OUI written into every NAN KDE header. */
static const uint8_t nan_kde_rsn_oui[3] = {0x00, 0x0f, 0xac};
/* NAN KDE header (802.11 Fig 12-34: DD len OUI(3) DataType(1)); mirrors hostap
* nan_add_kde_hdr(). data_len excludes the DD/len/OUI/type bytes. */
static uint8_t *nan_kde_put_hdr(uint8_t *p, uint8_t data_type, uint8_t data_len)
{
*p++ = 0xDD;
*p++ = (uint8_t)(4 + data_len); /* OUI(3) + DataType(1) + data */
*p++ = NAN_KDE_OUI_RSN_0;
*p++ = NAN_KDE_OUI_RSN_1;
*p++ = NAN_KDE_OUI_RSN_2;
memcpy(p, nan_kde_rsn_oui, sizeof(nan_kde_rsn_oui));
p += sizeof(nan_kde_rsn_oui);
*p++ = data_type;
return p;
}