os_memcpy(wpa_auth->wpa_ie, buf, pos - buf);
wpa_auth->wpa_ie_len = pos - buf;
- if ((wpa_auth->conf.wpa & WPA_PROTO_RSN) &&
- wpa_auth->conf.rsn_override_key_mgmt) {
-#ifdef CONFIG_TESTING_OPTIONS
- if (wpa_auth->conf.rsnoe_override_set) {
- os_memcpy(buf, wpa_auth->conf.rsnoe_override,
- wpa_auth->conf.rsnoe_override_len);
- res = wpa_auth->conf.rsnoe_override_len;
- } else
-#endif /* CONFIG_TESTING_OPTIONS */
- res = wpa_write_rsne_override(&wpa_auth->conf, buf,
- sizeof(buf));
- if (res < 0)
- return res;
- os_free(wpa_auth->rsne_override);
- wpa_auth->rsne_override = os_malloc(res - 4);
- if (!wpa_auth->rsne_override)
- return -1;
- pos = wpa_auth->rsne_override;
- *pos++ = WLAN_EID_RSN;
- *pos++ = res - 2 - 4;
- os_memcpy(pos, &buf[2 + 4], res - 2 - 4);
- }
-
- if ((wpa_auth->conf.wpa & WPA_PROTO_RSN) &&
- wpa_auth->conf.rsn_override_key_mgmt_2) {
-#ifdef CONFIG_TESTING_OPTIONS
- if (wpa_auth->conf.rsno2e_override_set) {
- os_memcpy(buf, wpa_auth->conf.rsno2e_override,
- wpa_auth->conf.rsno2e_override_len);
- res = wpa_auth->conf.rsno2e_override_len;
- } else
-#endif /* CONFIG_TESTING_OPTIONS */
- res = wpa_write_rsne_override_2(&wpa_auth->conf, buf,
- sizeof(buf));
- if (res < 0)
- return res;
- os_free(wpa_auth->rsne_override_2);
- wpa_auth->rsne_override_2 = os_malloc(res - 4);
- if (!wpa_auth->rsne_override_2)
- return -1;
- pos = wpa_auth->rsne_override_2;
- *pos++ = WLAN_EID_RSN;
- *pos++ = res - 2 - 4;
- os_memcpy(pos, &buf[2 + 4], res - 2 - 4);
- }
-
- if ((wpa_auth->conf.wpa & WPA_PROTO_RSN) &&
- (wpa_auth->conf.rsn_override_key_mgmt ||
- wpa_auth->conf.rsn_override_key_mgmt_2)) {
-#ifdef CONFIG_TESTING_OPTIONS
- if (wpa_auth->conf.rsnxoe_override_set) {
- os_memcpy(buf, wpa_auth->conf.rsnxoe_override,
- wpa_auth->conf.rsnxoe_override_len);
- res = wpa_auth->conf.rsnxoe_override_len;
- } else
-#endif /* CONFIG_TESTING_OPTIONS */
- res = wpa_write_rsnxe_override(&wpa_auth->conf, buf,
- sizeof(buf));
- if (res < 0)
- return res;
- os_free(wpa_auth->rsnxe_override);
- if (res == 0) {
- wpa_auth->rsnxe_override = NULL;
- return 0;
- }
- wpa_auth->rsnxe_override = os_malloc(res - 4);
- if (!wpa_auth->rsnxe_override)
- return -1;
- pos = wpa_auth->rsnxe_override;
- *pos++ = WLAN_EID_RSNX;
- *pos++ = res - 2 - 4;
- os_memcpy(pos, &buf[2 + 4], res - 2 - 4);
- }
-
return 0;
}