Lines Matching refs:conf

28 static int wpa_write_wpa_ie(struct wpa_auth_config *conf, u8 *buf, size_t len)  in wpa_write_wpa_ie()  argument
41 suite = wpa_cipher_to_suite(WPA_PROTO_WPA, conf->wpa_group); in wpa_write_wpa_ie()
44 conf->wpa_group); in wpa_write_wpa_ie()
53 num_suites = wpa_cipher_put_suites(pos, conf->wpa_pairwise); in wpa_write_wpa_ie()
56 conf->wpa_pairwise); in wpa_write_wpa_ie()
66 if (conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X) { in wpa_write_wpa_ie()
71 if (conf->wpa_key_mgmt & WPA_KEY_MGMT_PSK) { in wpa_write_wpa_ie()
79 conf->wpa_key_mgmt); in wpa_write_wpa_ie()
92 static u16 wpa_own_rsn_capab(struct wpa_auth_config *conf, in wpa_own_rsn_capab() argument
97 if (conf->rsn_preauth) in wpa_own_rsn_capab()
99 if (conf->wmm_enabled) { in wpa_own_rsn_capab()
109 if (conf->ocv) in wpa_own_rsn_capab()
116 if (conf->extended_key_id) in wpa_own_rsn_capab()
403 int wpa_write_rsn_ie(struct wpa_auth_config *conf, u8 *buf, size_t len, in wpa_write_rsn_ie() argument
414 pos = rsne_write_data(buf, len, pos, conf->wpa_group, in wpa_write_rsn_ie()
415 conf->rsn_pairwise, conf->wpa_key_mgmt, in wpa_write_rsn_ie()
416 wpa_own_rsn_capab(conf, conf->ieee80211w), pmkid, in wpa_write_rsn_ie()
417 conf->ieee80211w, conf->group_mgmt_cipher); in wpa_write_rsn_ie()
427 static int wpa_write_rsne_override(struct wpa_auth_config *conf, u8 *buf, in wpa_write_rsne_override() argument
442 pos = rsne_write_data(buf, len, pos, conf->wpa_group, in wpa_write_rsne_override()
443 conf->rsn_override_pairwise, in wpa_write_rsne_override()
444 conf->rsn_override_key_mgmt, in wpa_write_rsne_override()
445 wpa_own_rsn_capab(conf, conf->rsn_override_mfp), in wpa_write_rsne_override()
446 NULL, conf->rsn_override_mfp, in wpa_write_rsne_override()
447 conf->group_mgmt_cipher); in wpa_write_rsne_override()
457 static int wpa_write_rsne_override_2(struct wpa_auth_config *conf, u8 *buf, in wpa_write_rsne_override_2() argument
472 pos = rsne_write_data(buf, len, pos, conf->wpa_group, in wpa_write_rsne_override_2()
473 conf->rsn_override_pairwise_2, in wpa_write_rsne_override_2()
474 conf->rsn_override_key_mgmt_2, in wpa_write_rsne_override_2()
475 wpa_own_rsn_capab(conf, conf->rsn_override_mfp_2), in wpa_write_rsne_override_2()
476 NULL, conf->rsn_override_mfp_2, in wpa_write_rsne_override_2()
477 conf->group_mgmt_cipher); in wpa_write_rsne_override_2()
487 static u32 rsnxe_capab(struct wpa_auth_config *conf, int key_mgmt) in rsnxe_capab() argument
492 (conf->sae_pwe == SAE_PWE_HASH_TO_ELEMENT || in rsnxe_capab()
493 conf->sae_pwe == SAE_PWE_BOTH || conf->sae_pk || in rsnxe_capab()
497 if (conf->sae_pk) in rsnxe_capab()
502 if (conf->secure_ltf) in rsnxe_capab()
504 if (conf->secure_rtt) in rsnxe_capab()
506 if (conf->prot_range_neg) in rsnxe_capab()
508 if (conf->ssid_protection) in rsnxe_capab()
515 int wpa_write_rsnxe(struct wpa_auth_config *conf, u8 *buf, size_t len) in wpa_write_rsnxe() argument
521 capab = rsnxe_capab(conf, conf->wpa_key_mgmt); in wpa_write_rsnxe()
546 static int wpa_write_rsnxe_override(struct wpa_auth_config *conf, u8 *buf, in wpa_write_rsnxe_override() argument
553 capab = rsnxe_capab(conf, conf->rsn_override_key_mgmt | in wpa_write_rsnxe_override()
554 conf->rsn_override_key_mgmt_2); in wpa_write_rsnxe_override()
582 static u8 * wpa_write_osen(struct wpa_auth_config *conf, u8 *eid) in wpa_write_osen() argument
611 if (conf->wmm_enabled) { in wpa_write_osen()
615 if (conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) { in wpa_write_osen()
617 if (conf->ieee80211w == MGMT_FRAME_PROTECTION_REQUIRED) in wpa_write_osen()
621 if (conf->ocv) in wpa_write_osen()
639 if (wpa_auth->conf.own_ie_override_len) { in wpa_auth_gen_wpa_ie()
641 wpa_auth->conf.own_ie_override, in wpa_auth_gen_wpa_ie()
642 wpa_auth->conf.own_ie_override_len); in wpa_auth_gen_wpa_ie()
645 os_malloc(wpa_auth->conf.own_ie_override_len); in wpa_auth_gen_wpa_ie()
648 os_memcpy(wpa_auth->wpa_ie, wpa_auth->conf.own_ie_override, in wpa_auth_gen_wpa_ie()
649 wpa_auth->conf.own_ie_override_len); in wpa_auth_gen_wpa_ie()
650 wpa_auth->wpa_ie_len = wpa_auth->conf.own_ie_override_len; in wpa_auth_gen_wpa_ie()
657 if (wpa_auth->conf.wpa == WPA_PROTO_OSEN) { in wpa_auth_gen_wpa_ie()
658 pos = wpa_write_osen(&wpa_auth->conf, pos); in wpa_auth_gen_wpa_ie()
660 if (wpa_auth->conf.wpa & WPA_PROTO_RSN) { in wpa_auth_gen_wpa_ie()
662 if (wpa_auth->conf.rsne_override_set) { in wpa_auth_gen_wpa_ie()
665 wpa_auth->conf.rsne_override, in wpa_auth_gen_wpa_ie()
666 wpa_auth->conf.rsne_override_len); in wpa_auth_gen_wpa_ie()
668 wpa_auth->conf.rsne_override_len) in wpa_auth_gen_wpa_ie()
670 os_memcpy(pos, wpa_auth->conf.rsne_override, in wpa_auth_gen_wpa_ie()
671 wpa_auth->conf.rsne_override_len); in wpa_auth_gen_wpa_ie()
672 pos += wpa_auth->conf.rsne_override_len; in wpa_auth_gen_wpa_ie()
676 res = wpa_write_rsn_ie(&wpa_auth->conf, in wpa_auth_gen_wpa_ie()
683 if (wpa_auth->conf.rsnxe_override_set) { in wpa_auth_gen_wpa_ie()
686 wpa_auth->conf.rsnxe_override, in wpa_auth_gen_wpa_ie()
687 wpa_auth->conf.rsnxe_override_len); in wpa_auth_gen_wpa_ie()
689 wpa_auth->conf.rsnxe_override_len) in wpa_auth_gen_wpa_ie()
691 os_memcpy(pos, wpa_auth->conf.rsnxe_override, in wpa_auth_gen_wpa_ie()
692 wpa_auth->conf.rsnxe_override_len); in wpa_auth_gen_wpa_ie()
693 pos += wpa_auth->conf.rsnxe_override_len; in wpa_auth_gen_wpa_ie()
697 if (wpa_auth->conf.rsn_override_omit_rsnxe) in wpa_auth_gen_wpa_ie()
700 res = wpa_write_rsnxe(&wpa_auth->conf, pos, in wpa_auth_gen_wpa_ie()
710 if (wpa_key_mgmt_ft(wpa_auth->conf.wpa_key_mgmt)) { in wpa_auth_gen_wpa_ie()
711 res = wpa_write_mdie(&wpa_auth->conf, pos, in wpa_auth_gen_wpa_ie()
718 if (wpa_auth->conf.wpa & WPA_PROTO_WPA) { in wpa_auth_gen_wpa_ie()
719 res = wpa_write_wpa_ie(&wpa_auth->conf, in wpa_auth_gen_wpa_ie()
725 if ((wpa_auth->conf.wpa & WPA_PROTO_RSN) && in wpa_auth_gen_wpa_ie()
726 wpa_auth->conf.rsn_override_key_mgmt) { in wpa_auth_gen_wpa_ie()
728 if (wpa_auth->conf.rsnoe_override_set) { in wpa_auth_gen_wpa_ie()
731 wpa_auth->conf.rsnoe_override, in wpa_auth_gen_wpa_ie()
732 wpa_auth->conf.rsnoe_override_len); in wpa_auth_gen_wpa_ie()
734 wpa_auth->conf.rsnoe_override_len) in wpa_auth_gen_wpa_ie()
736 os_memcpy(pos, wpa_auth->conf.rsnoe_override, in wpa_auth_gen_wpa_ie()
737 wpa_auth->conf.rsnoe_override_len); in wpa_auth_gen_wpa_ie()
738 pos += wpa_auth->conf.rsnoe_override_len; in wpa_auth_gen_wpa_ie()
742 res = wpa_write_rsne_override(&wpa_auth->conf, in wpa_auth_gen_wpa_ie()
751 if ((wpa_auth->conf.wpa & WPA_PROTO_RSN) && in wpa_auth_gen_wpa_ie()
752 wpa_auth->conf.rsn_override_key_mgmt_2) { in wpa_auth_gen_wpa_ie()
754 if (wpa_auth->conf.rsno2e_override_set) { in wpa_auth_gen_wpa_ie()
757 wpa_auth->conf.rsno2e_override, in wpa_auth_gen_wpa_ie()
758 wpa_auth->conf.rsno2e_override_len); in wpa_auth_gen_wpa_ie()
760 wpa_auth->conf.rsno2e_override_len) in wpa_auth_gen_wpa_ie()
762 os_memcpy(pos, wpa_auth->conf.rsno2e_override, in wpa_auth_gen_wpa_ie()
763 wpa_auth->conf.rsno2e_override_len); in wpa_auth_gen_wpa_ie()
764 pos += wpa_auth->conf.rsno2e_override_len; in wpa_auth_gen_wpa_ie()
768 res = wpa_write_rsne_override_2(&wpa_auth->conf, pos, in wpa_auth_gen_wpa_ie()
777 if ((wpa_auth->conf.wpa & WPA_PROTO_RSN) && in wpa_auth_gen_wpa_ie()
778 (wpa_auth->conf.rsn_override_key_mgmt || in wpa_auth_gen_wpa_ie()
779 wpa_auth->conf.rsn_override_key_mgmt_2)) { in wpa_auth_gen_wpa_ie()
781 if (wpa_auth->conf.rsnxoe_override_set) { in wpa_auth_gen_wpa_ie()
784 wpa_auth->conf.rsnxoe_override, in wpa_auth_gen_wpa_ie()
785 wpa_auth->conf.rsnxoe_override_len); in wpa_auth_gen_wpa_ie()
787 wpa_auth->conf.rsnxoe_override_len) in wpa_auth_gen_wpa_ie()
789 os_memcpy(pos, wpa_auth->conf.rsnxoe_override, in wpa_auth_gen_wpa_ie()
790 wpa_auth->conf.rsnxoe_override_len); in wpa_auth_gen_wpa_ie()
791 pos += wpa_auth->conf.rsnxoe_override_len; in wpa_auth_gen_wpa_ie()
795 res = wpa_write_rsnxe_override(&wpa_auth->conf, pos, in wpa_auth_gen_wpa_ie()
862 struct wpa_auth_config *conf = &wpa_auth->conf; in wpa_validate_wpa_ie() local
880 if (!(wpa_auth->conf.wpa & version)) { in wpa_validate_wpa_ie()
1011 if (data.group_cipher != wpa_auth->conf.wpa_group) { in wpa_validate_wpa_ie()
1019 wpa_auth->conf.rsn_override_key_mgmt_2; in wpa_validate_wpa_ie()
1021 key_mgmt = data.key_mgmt & wpa_auth->conf.rsn_override_key_mgmt; in wpa_validate_wpa_ie()
1023 key_mgmt = data.key_mgmt & wpa_auth->conf.wpa_key_mgmt; in wpa_validate_wpa_ie()
1094 wpa_auth->conf.rsn_override_pairwise_2; in wpa_validate_wpa_ie()
1097 wpa_auth->conf.rsn_override_pairwise; in wpa_validate_wpa_ie()
1099 ciphers = data.pairwise_cipher & wpa_auth->conf.rsn_pairwise; in wpa_validate_wpa_ie()
1101 ciphers = data.pairwise_cipher & wpa_auth->conf.wpa_pairwise; in wpa_validate_wpa_ie()
1110 if (wpa_auth->conf.ieee80211w == MGMT_FRAME_PROTECTION_REQUIRED) { in wpa_validate_wpa_ie()
1117 if (data.mgmt_group_cipher != wpa_auth->conf.group_mgmt_cipher) in wpa_validate_wpa_ie()
1126 if (wpa_auth->conf.ieee80211w == MGMT_FRAME_PROTECTION_OPTIONAL && in wpa_validate_wpa_ie()
1127 wpa_auth->conf.sae_require_mfp && in wpa_validate_wpa_ie()
1137 if (wpa_auth->conf.ocv && (data.capabilities & WPA_CAPABILITY_OCVC) && in wpa_validate_wpa_ie()
1144 if (wpa_auth->conf.ocv == 2) { in wpa_validate_wpa_ie()
1155 wpa_auth->conf.ocv : 0); in wpa_validate_wpa_ie()
1159 if (wpa_auth->conf.ieee80211w == NO_MGMT_FRAME_PROTECTION || in wpa_validate_wpa_ie()
1179 if (os_memcmp(mdie, wpa_auth->conf.mobility_domain, in wpa_validate_wpa_ie()
1202 ((conf->dpp_pfs == 1 && !owe_dh) || in wpa_validate_wpa_ie()
1203 (conf->dpp_pfs == 2 && owe_dh))) { in wpa_validate_wpa_ie()
1205 conf->dpp_pfs == 1 ? "required" : "not allowed"); in wpa_validate_wpa_ie()
1255 for (i = 0; sm->pmksa == NULL && wpa_auth->conf.okc && in wpa_validate_wpa_ie()
1316 if (conf->extended_key_id && sm->wpa == WPA_VERSION_WPA2 && in wpa_validate_wpa_ie()
1320 if (conf->extended_key_id == 2 && in wpa_validate_wpa_ie()
1420 struct wpa_auth_config *conf; in wpa_auth_write_assoc_resp_owe() local
1424 conf = &sm->wpa_auth->conf; in wpa_auth_write_assoc_resp_owe()
1427 if (conf->own_ie_override_len) { in wpa_auth_write_assoc_resp_owe()
1428 if (max_len < conf->own_ie_override_len) in wpa_auth_write_assoc_resp_owe()
1431 conf->own_ie_override, conf->own_ie_override_len); in wpa_auth_write_assoc_resp_owe()
1432 os_memcpy(pos, conf->own_ie_override, in wpa_auth_write_assoc_resp_owe()
1433 conf->own_ie_override_len); in wpa_auth_write_assoc_resp_owe()
1434 return pos + conf->own_ie_override_len; in wpa_auth_write_assoc_resp_owe()
1438 res = wpa_write_rsn_ie(conf, pos, max_len, in wpa_auth_write_assoc_resp_owe()
1460 res = wpa_write_rsn_ie(&sm->wpa_auth->conf, pos, max_len, NULL); in wpa_auth_write_assoc_resp_fils()
1470 struct wpa_auth_config *conf; in wpa_auth_write_fd_rsn_info() local
1479 conf = &wpa_auth->conf; in wpa_auth_write_fd_rsn_info()
1481 if (!(conf->wpa & WPA_PROTO_RSN)) in wpa_auth_write_fd_rsn_info()
1485 WPA_PUT_LE16(pos, wpa_own_rsn_capab(conf, conf->ieee80211w)); in wpa_auth_write_fd_rsn_info()
1489 suite = wpa_cipher_to_suite(WPA_PROTO_RSN, conf->wpa_group); in wpa_auth_write_fd_rsn_info()
1500 if (conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) { in wpa_auth_write_fd_rsn_info()
1501 switch (conf->group_mgmt_cipher) { in wpa_auth_write_fd_rsn_info()
1520 res = rsn_cipher_put_suites(tmp, conf->rsn_pairwise); in wpa_auth_write_fd_rsn_info()
1530 if ((conf->wpa_key_mgmt & mask) && (conf->wpa_key_mgmt & ~mask) == 0) { in wpa_auth_write_fd_rsn_info()
1531 suite = conf->wpa_key_mgmt & mask; in wpa_auth_write_fd_rsn_info()