Extend VENDOR_ELEM parameters to cover non-P2P Association Request

The new VENDOR_ELEM value 13 can now be used to add a vendor element
into all (Re)Association Request frames, not just for P2P use cases like
the previous item was for.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-01-14 00:50:58 +02:00 committed by Jouni Malinen
parent 615d8a9705
commit d29fa3a767
3 changed files with 27 additions and 0 deletions

View file

@ -277,6 +277,7 @@ enum wpa_vendor_elem_frame {
VENDOR_ELEM_P2P_INV_RESP = 10, VENDOR_ELEM_P2P_INV_RESP = 10,
VENDOR_ELEM_P2P_ASSOC_REQ = 11, VENDOR_ELEM_P2P_ASSOC_REQ = 11,
VENDOR_ELEM_P2P_ASSOC_RESP = 12, VENDOR_ELEM_P2P_ASSOC_RESP = 12,
VENDOR_ELEM_ASSOC_REQ = 13,
NUM_VENDOR_ELEM_FRAMES NUM_VENDOR_ELEM_FRAMES
}; };

View file

@ -449,6 +449,20 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
os_memcpy(pos, ext_capab, ext_capab_len); os_memcpy(pos, ext_capab, ext_capab_len);
} }
if (wpa_s->vendor_elem[VENDOR_ELEM_ASSOC_REQ]) {
struct wpabuf *buf = wpa_s->vendor_elem[VENDOR_ELEM_ASSOC_REQ];
size_t len;
len = sizeof(wpa_s->sme.assoc_req_ie) -
wpa_s->sme.assoc_req_ie_len;
if (wpabuf_len(buf) <= len) {
os_memcpy(wpa_s->sme.assoc_req_ie +
wpa_s->sme.assoc_req_ie_len,
wpabuf_head(buf), wpabuf_len(buf));
wpa_s->sme.assoc_req_ie_len += wpabuf_len(buf);
}
}
sme_auth_handle_rrm(wpa_s, bss); sme_auth_handle_rrm(wpa_s, bss);
#ifdef CONFIG_SAE #ifdef CONFIG_SAE

View file

@ -2029,6 +2029,18 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
} }
} }
if (wpa_s->vendor_elem[VENDOR_ELEM_ASSOC_REQ]) {
struct wpabuf *buf = wpa_s->vendor_elem[VENDOR_ELEM_ASSOC_REQ];
size_t len;
len = sizeof(wpa_ie) - wpa_ie_len;
if (wpabuf_len(buf) <= len) {
os_memcpy(wpa_ie + wpa_ie_len,
wpabuf_head(buf), wpabuf_len(buf));
wpa_ie_len += wpabuf_len(buf);
}
}
wpa_clear_keys(wpa_s, bss ? bss->bssid : NULL); wpa_clear_keys(wpa_s, bss ? bss->bssid : NULL);
use_crypt = 1; use_crypt = 1;
cipher_pairwise = wpa_s->pairwise_cipher; cipher_pairwise = wpa_s->pairwise_cipher;