.. | .. |
---|
2781 | 2781 | goto authclnt_fail; |
---|
2782 | 2782 | } |
---|
2783 | 2783 | |
---|
2784 | | - if (len > sizeof(pmlmeinfo->chg_txt)) { |
---|
2785 | | - goto authclnt_fail; |
---|
2786 | | - } |
---|
2787 | | - |
---|
2788 | 2784 | _rtw_memcpy((void *)(pmlmeinfo->chg_txt), (void *)(p + 2), len); |
---|
2789 | 2785 | pmlmeinfo->auth_seq = 3; |
---|
2790 | 2786 | issue_auth(padapter, NULL, 0); |
---|
.. | .. |
---|
4686 | 4682 | /* Try to get the device password ID from the WPS IE of group negotiation request frame */ |
---|
4687 | 4683 | /* WiFi Direct test plan 5.1.15 */ |
---|
4688 | 4684 | rtw_get_wps_ie(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, wpsie, &wpsielen); |
---|
4689 | | - wps_devicepassword_id_len = sizeof(wps_devicepassword_id); |
---|
4690 | 4685 | rtw_get_wps_attr_content(wpsie, wpsielen, WPS_ATTR_DEVICE_PWID, (u8 *) &wps_devicepassword_id, &wps_devicepassword_id_len); |
---|
4691 | 4686 | wps_devicepassword_id = be16_to_cpu(wps_devicepassword_id); |
---|
4692 | 4687 | |
---|
.. | .. |
---|
6788 | 6783 | |
---|
6789 | 6784 | merged_p2p_ielen = rtw_p2p_merge_ies(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, merged_p2pie); |
---|
6790 | 6785 | |
---|
6791 | | - attr_contentlen = sizeof(invitation_flag); |
---|
6792 | 6786 | rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_INVITATION_FLAGS, &invitation_flag, &attr_contentlen); |
---|
6793 | 6787 | if (attr_contentlen) { |
---|
6794 | 6788 | |
---|
6795 | | - attr_contentlen = sizeof(pwdinfo->p2p_peer_interface_addr); |
---|
6796 | 6789 | rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_BSSID, pwdinfo->p2p_peer_interface_addr, &attr_contentlen); |
---|
6797 | 6790 | /* Commented by Albert 20120510 */ |
---|
6798 | 6791 | /* Copy to the pwdinfo->p2p_peer_interface_addr. */ |
---|
.. | .. |
---|
6811 | 6804 | /* Re-invoke the persistent group. */ |
---|
6812 | 6805 | |
---|
6813 | 6806 | _rtw_memset(&group_id, 0x00, sizeof(struct group_id_info)); |
---|
6814 | | - attr_contentlen = sizeof(struct group_id_info); |
---|
6815 | 6807 | rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_ID, (u8 *) &group_id, &attr_contentlen); |
---|
6816 | 6808 | if (attr_contentlen) { |
---|
6817 | 6809 | if (_rtw_memcmp(group_id.go_device_addr, adapter_mac_addr(padapter), ETH_ALEN)) { |
---|
.. | .. |
---|
6823 | 6815 | /* The p2p device sending this p2p invitation request wants to be the persistent GO. */ |
---|
6824 | 6816 | if (is_matched_in_profilelist(pwdinfo->p2p_peer_interface_addr, &pwdinfo->profileinfo[0])) { |
---|
6825 | 6817 | u8 operatingch_info[5] = { 0x00 }; |
---|
6826 | | - attr_contentlen = sizeof(operatingch_info); |
---|
6827 | 6818 | if (rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_OPERATING_CH, operatingch_info, |
---|
6828 | 6819 | &attr_contentlen)) { |
---|
6829 | 6820 | if (rtw_chset_search_ch(adapter_to_chset(padapter), (u32)operatingch_info[4]) >= 0) { |
---|
.. | .. |
---|
6867 | 6858 | /* Received the invitation to join a P2P group. */ |
---|
6868 | 6859 | |
---|
6869 | 6860 | _rtw_memset(&group_id, 0x00, sizeof(struct group_id_info)); |
---|
6870 | | - attr_contentlen = sizeof(struct group_id_info); |
---|
6871 | 6861 | rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_ID, (u8 *) &group_id, &attr_contentlen); |
---|
6872 | 6862 | if (attr_contentlen) { |
---|
6873 | 6863 | if (_rtw_memcmp(group_id.go_device_addr, adapter_mac_addr(padapter), ETH_ALEN)) { |
---|
.. | .. |
---|
6912 | 6902 | _cancel_timer_ex(&pwdinfo->restore_p2p_state_timer); |
---|
6913 | 6903 | p2p_ie = rtw_get_p2p_ie(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen); |
---|
6914 | 6904 | if (p2p_ie) { |
---|
6915 | | - attr_contentlen = sizeof(attr_content); |
---|
6916 | 6905 | rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, &attr_content, &attr_contentlen); |
---|
6917 | 6906 | |
---|
6918 | 6907 | if (attr_contentlen == 1) { |
---|
.. | .. |
---|
9402 | 9391 | #endif /* CONFIG_IOCTL_CFG80211 */ |
---|
9403 | 9392 | |
---|
9404 | 9393 | pframe = rtw_set_ie(pframe, EID_WPA2, pIE->Length, pIE->data, &(pattrib->pktlen)); |
---|
9405 | | - /* tmp: update rsn's spp related opt. */ |
---|
9406 | | - rtw_set_spp_amsdu_mode(padapter->registrypriv.amsdu_mode, pframe - (pIE->Length + 2), pIE->Length +2); |
---|
9407 | 9394 | } |
---|
9408 | 9395 | break; |
---|
9409 | 9396 | #ifdef CONFIG_80211N_HT |
---|
.. | .. |
---|
10331 | 10318 | else /* TX AMSDU disabled */ |
---|
10332 | 10319 | BA_para_set &= ~BIT(0); |
---|
10333 | 10320 | #endif |
---|
10334 | | - psta = rtw_get_stainfo(pstapriv, raddr); |
---|
10335 | | - if (psta != NULL) { |
---|
10336 | | - if (psta->flags & WLAN_STA_AMSDU_DISABLE) |
---|
10337 | | - BA_para_set &= ~BIT(0); |
---|
10338 | | - } |
---|
10339 | | - |
---|
10340 | 10321 | BA_para_set = cpu_to_le16(BA_para_set); |
---|
10341 | 10322 | pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_para_set)), &(pattrib->pktlen)); |
---|
10342 | 10323 | |
---|
.. | .. |
---|
10379 | 10360 | BA_para_set &= ~BIT(0); |
---|
10380 | 10361 | else if (pregpriv->rx_ampdu_amsdu == 1) /* enabled */ |
---|
10381 | 10362 | BA_para_set |= BIT(0); |
---|
10382 | | - } |
---|
10383 | | - psta = rtw_get_stainfo(pstapriv, raddr); |
---|
10384 | | - if (psta != NULL) { |
---|
10385 | | - if (psta->flags & WLAN_STA_AMSDU_DISABLE) |
---|
10386 | | - BA_para_set &= ~BIT(0); |
---|
10387 | 10363 | } |
---|
10388 | 10364 | |
---|
10389 | 10365 | BA_para_set = cpu_to_le16(BA_para_set); |
---|
.. | .. |
---|
11265 | 11241 | u32 attr_contentlen = 0; |
---|
11266 | 11242 | u8 listen_ch[5] = { 0x00 }; |
---|
11267 | 11243 | |
---|
11268 | | - attr_contentlen = sizeof(listen_ch); |
---|
11269 | 11244 | rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_LISTEN_CH, listen_ch, &attr_contentlen); |
---|
11270 | 11245 | bssid->Configuration.DSConfig = listen_ch[4]; |
---|
11271 | 11246 | } else { |
---|
.. | .. |
---|
11397 | 11372 | #ifdef CONFIG_RTW_80211K |
---|
11398 | 11373 | p = rtw_get_ie(bssid->IEs + ie_offset, _EID_RRM_EN_CAP_IE_, &len, bssid->IELength - ie_offset); |
---|
11399 | 11374 | if (p) |
---|
11400 | | - _rtw_memcpy(bssid->PhyInfo.rm_en_cap, (p + 2), MIN(*(p + 1), |
---|
11401 | | - sizeof(bssid->PhyInfo.rm_en_cap))); |
---|
| 11375 | + _rtw_memcpy(bssid->PhyInfo.rm_en_cap, (p + 2), *(p + 1)); |
---|
11402 | 11376 | |
---|
11403 | 11377 | /* save freerun counter */ |
---|
11404 | 11378 | bssid->PhyInfo.free_cnt = precv_frame->u.hdr.attrib.free_cnt; |
---|
.. | .. |
---|
15123 | 15097 | return H2C_SUCCESS; |
---|
15124 | 15098 | } |
---|
15125 | 15099 | |
---|
15126 | | -static u8 amsdu_spp_enable(_adapter *pdapter, enum security_type type) |
---|
15127 | | -{ |
---|
15128 | | - u8 ret = _FALSE; |
---|
15129 | | - |
---|
15130 | | - if (pdapter->registrypriv.amsdu_mode == RTW_AMSDU_MODE_SPP) { |
---|
15131 | | - if ( type == _AES_ || type == _CCMP_256_ |
---|
15132 | | - || type == _GCMP_ || type == _GCMP_256_ ) |
---|
15133 | | - ret = _SUCCESS; |
---|
15134 | | - } |
---|
15135 | | - |
---|
15136 | | - return ret; |
---|
15137 | | -} |
---|
15138 | | - |
---|
15139 | | - |
---|
15140 | 15100 | /* |
---|
15141 | 15101 | SEC CAM Entry format (32 bytes) |
---|
15142 | 15102 | DW0 - MAC_ADDR[15:0] | Valid[15] | MFB[14:8] | RSVD[7] | GK[6] | MIC_KEY[5] | SEC_TYPE[4:2] | KID[1:0] |
---|
.. | .. |
---|
15229 | 15189 | RTW_INFO_DUMP("GTK : ", pparm->key, sizeof(pparm->key)); |
---|
15230 | 15190 | ctrl |= BIT(9); |
---|
15231 | 15191 | } |
---|
15232 | | - if (amsdu_spp_enable(padapter, pparm->algorithm) == _SUCCESS) |
---|
15233 | | - ctrl |= BIT(7); |
---|
15234 | 15192 | |
---|
15235 | 15193 | write_cam(padapter, cam_id, ctrl, addr, pparm->key); |
---|
15236 | 15194 | |
---|
.. | .. |
---|
15378 | 15336 | RTW_INFO_DUMP("PTK : ", pparm->key, sizeof(pparm->key)); |
---|
15379 | 15337 | ctrl |= BIT(9); |
---|
15380 | 15338 | } |
---|
15381 | | - if (amsdu_spp_enable(padapter, pparm->algorithm) == _SUCCESS) |
---|
15382 | | - ctrl |= BIT(7); |
---|
15383 | 15339 | |
---|
15384 | 15340 | write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key); |
---|
15385 | | - if (!(pparm->gk)) |
---|
15386 | | - ATOMIC_INC(&psta->keytrack); /*CVE-2020-24587*/ |
---|
15387 | 15341 | } |
---|
15388 | 15342 | ret = H2C_SUCCESS_RSP; |
---|
15389 | 15343 | |
---|