diff options
| author | Padma, Santhosh Kumar <skpadma@codeaurora.org> | 2018-03-07 17:50:01 +0530 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2018-03-23 09:00:04 -0700 |
| commit | b727b43a19084f055e14219d3996372bbb7eda63 (patch) | |
| tree | b9b3a501edfc56b7fe21e614b4cb7e2d1e63cebc | |
| parent | 9d18a7a62191d453f18b634051bf2d0766fda5ca (diff) | |
qcacld-3.0: Add changes to send SAE auth frame to user space
Add changes to send authentication response frame to user space
when authentication type is SAE.
Change-Id: I0b28b7550d629d6fe9f5661538ea71687f5dd989
CRs-Fixed: 2029357
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg80211.c | 3 | ||||
| -rw-r--r-- | core/mac/src/pe/lim/lim_process_auth_frame.c | 49 |
2 files changed, 50 insertions, 2 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 02d1e716aff7..14d7fc8e6656 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -349,7 +349,8 @@ static const struct ieee80211_txrx_stypes [NL80211_IFTYPE_STATION] = { .tx = 0xffff, .rx = BIT(SIR_MAC_MGMT_ACTION) | - BIT(SIR_MAC_MGMT_PROBE_REQ), + BIT(SIR_MAC_MGMT_PROBE_REQ) | + BIT(SIR_MAC_MGMT_AUTH), }, [NL80211_IFTYPE_AP] = { .tx = 0xffff, diff --git a/core/mac/src/pe/lim/lim_process_auth_frame.c b/core/mac/src/pe/lim/lim_process_auth_frame.c index 571fa25bcb03..6537699300fb 100644 --- a/core/mac/src/pe/lim/lim_process_auth_frame.c +++ b/core/mac/src/pe/lim/lim_process_auth_frame.c @@ -265,6 +265,45 @@ static void lim_process_auth_open_system_algo(tpAniSirGlobal mac_ctx, pe_session); } +#ifdef WLAN_FEATURE_SAE +/** + * lim_process_sae_auth_frame()-Process SAE authentication frame + * @mac_ctx: MAC context + * @rx_pkt_info: Rx packet + * @pe_session: PE session + * + * Return: None + */ +static void lim_process_sae_auth_frame(tpAniSirGlobal mac_ctx, + uint8_t *rx_pkt_info, tpPESession pe_session) +{ + tpSirMacMgmtHdr mac_hdr; + uint32_t frame_len; + uint8_t *body_ptr; + + mac_hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info); + body_ptr = WMA_GET_RX_MPDU_DATA(rx_pkt_info); + frame_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info); + + pe_debug("Received SAE Auth frame type %d subtype %d", + mac_hdr->fc.type, mac_hdr->fc.subType); + + if (pe_session->limMlmState != eLIM_MLM_WT_SAE_AUTH_STATE) + pe_err("received SAE auth response in unexpected state %x", + pe_session->limMlmState); + + lim_send_sme_mgmt_frame_ind(mac_ctx, mac_hdr->fc.subType, + (uint8_t *) mac_hdr, + frame_len + sizeof(tSirMacMgmtHdr), 0, + WMA_GET_RX_CH(rx_pkt_info), pe_session, + WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info)); +} +#else +static inline void lim_process_sae_auth_frame(tpAniSirGlobal mac_ctx, + uint8_t *rx_pkt_info, tpPESession pe_session) +{} +#endif + static void lim_process_auth_frame_type1(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr mac_hdr, tSirMacAuthFrameBody *rx_auth_frm_body, @@ -1060,7 +1099,7 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, uint8_t defaultkey[SIR_MAC_KEY_LENGTH]; uint8_t *plainbody = NULL; uint8_t decrypt_result; - uint16_t frame_len, curr_seq_num = 0; + uint16_t frame_len, curr_seq_num = 0, auth_alg; uint32_t val, key_length = 8; tSirMacAuthFrameBody *rx_auth_frm_body, *rx_auth_frame, *auth_frame; tpSirMacMgmtHdr mac_hdr; @@ -1106,6 +1145,9 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, body_ptr = WMA_GET_RX_MPDU_DATA(rx_pkt_info); + auth_alg = *(uint16_t *) body_ptr; + pe_debug("auth_alg %d ", auth_alg); + /* Restore default failure timeout */ if (QDF_P2P_CLIENT_MODE == pe_session->pePersona && pe_session->defaultAuthFailureTimeout) { @@ -1335,6 +1377,11 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, pe_err("failed to convert Auth Frame to structure or Auth is not valid"); goto free; } + } else if ((auth_alg == + eSIR_AUTH_TYPE_SAE) && (LIM_IS_STA_ROLE(pe_session))) { + lim_process_sae_auth_frame(mac_ctx, + rx_pkt_info, pe_session); + goto free; } else if ((sir_convert_auth_frame2_struct(mac_ctx, body_ptr, frame_len, rx_auth_frame) != eSIR_SUCCESS) || (!is_auth_valid(mac_ctx, rx_auth_frame, |
