|
@@ -428,15 +428,6 @@ static QDF_STATUS csr_init_channel_power_list(struct mac_context *mac,
|
|
|
static QDF_STATUS csr_roam_free_connected_info(struct mac_context *mac,
|
|
|
struct csr_roam_connectedinfo *
|
|
|
pConnectedInfo);
|
|
|
-static QDF_STATUS csr_send_mb_set_context_req_msg(struct mac_context *mac,
|
|
|
- uint32_t sessionId,
|
|
|
- struct qdf_mac_addr peer_macaddr,
|
|
|
- uint8_t numKeys,
|
|
|
- tAniEdType edType, bool fUnicast,
|
|
|
- tAniKeyDirection aniKeyDirection,
|
|
|
- uint8_t keyId, uint8_t keyLength,
|
|
|
- uint8_t *pKey, uint8_t paeRole,
|
|
|
- uint8_t *pKeyRsc);
|
|
|
static void csr_roam_link_up(struct mac_context *mac, struct qdf_mac_addr bssid);
|
|
|
static void csr_roam_link_down(struct mac_context *mac, uint32_t sessionId);
|
|
|
static enum csr_cfgdot11mode
|
|
@@ -457,10 +448,6 @@ static QDF_STATUS csr_roam_start_wds(struct mac_context *mac,
|
|
|
struct csr_roam_profile *pProfile,
|
|
|
struct bss_description *bss_desc);
|
|
|
static void csr_init_session(struct mac_context *mac, uint32_t sessionId);
|
|
|
-static QDF_STATUS csr_roam_issue_set_key_command(struct mac_context *mac,
|
|
|
- uint32_t sessionId,
|
|
|
- tCsrRoamSetKey *pSetKey,
|
|
|
- uint32_t roamId);
|
|
|
|
|
|
static QDF_STATUS
|
|
|
csr_roam_get_qos_info_from_bss(struct mac_context *mac,
|
|
@@ -10753,7 +10740,6 @@ void csr_roam_joined_state_msg_processor(struct mac_context *mac, void *msg_buf)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-#ifdef CRYPTO_SET_KEY_CONVERGED
|
|
|
static QDF_STATUS csr_roam_issue_set_context_req(struct mac_context *mac_ctx,
|
|
|
uint32_t session_id,
|
|
|
bool add_key, bool unicast,
|
|
@@ -10856,450 +10842,6 @@ QDF_STATUS csr_roam_issue_set_context_req_helper(
|
|
|
unicast, key_id);
|
|
|
}
|
|
|
|
|
|
-#else
|
|
|
-static QDF_STATUS
|
|
|
-csr_roam_issue_set_context_req(struct mac_context *mac, uint32_t sessionId,
|
|
|
- eCsrEncryptionType EncryptType,
|
|
|
- struct bss_description *pBssDescription,
|
|
|
- tSirMacAddr *bssId, bool addKey, bool fUnicast,
|
|
|
- tAniKeyDirection aniKeyDirection, uint8_t keyId,
|
|
|
- uint16_t keyLength, uint8_t *pKey,
|
|
|
- uint8_t paeRole)
|
|
|
-{
|
|
|
- QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
- tAniEdType edType;
|
|
|
-
|
|
|
- sme_debug("sessionId: %d EncryptType: %d", sessionId, EncryptType);
|
|
|
-
|
|
|
- if (eCSR_ENCRYPT_TYPE_UNKNOWN == EncryptType)
|
|
|
- EncryptType = eCSR_ENCRYPT_TYPE_NONE;
|
|
|
-
|
|
|
- edType = csr_translate_encrypt_type_to_ed_type(EncryptType);
|
|
|
-
|
|
|
- /*
|
|
|
- * Allow 0 keys to be set for the non-WPA encrypt types. For WPA encrypt
|
|
|
- * types, the num keys must be non-zero or LIM will reject the set
|
|
|
- * context (assumes the SET_CONTEXT does not occur until the keys are
|
|
|
- * distrubuted).
|
|
|
- */
|
|
|
- if (CSR_IS_ENC_TYPE_STATIC(EncryptType) || addKey) {
|
|
|
- tCsrRoamSetKey setKey;
|
|
|
-
|
|
|
- setKey.encType = EncryptType;
|
|
|
- setKey.keyDirection = aniKeyDirection;
|
|
|
- qdf_mem_copy(&setKey.peerMac, bssId, sizeof(struct
|
|
|
- qdf_mac_addr));
|
|
|
- /* 0 for supplicant */
|
|
|
- setKey.paeRole = paeRole;
|
|
|
- /* Key index */
|
|
|
- setKey.keyId = keyId;
|
|
|
- setKey.keyLength = keyLength;
|
|
|
- if (keyLength)
|
|
|
- qdf_mem_copy(setKey.Key, pKey, keyLength);
|
|
|
- status = csr_roam_issue_set_key_command(mac, sessionId,
|
|
|
- &setKey, 0);
|
|
|
- }
|
|
|
- return status;
|
|
|
-}
|
|
|
-
|
|
|
-QDF_STATUS csr_roam_issue_set_context_req_helper(
|
|
|
- struct mac_context *mac_ctx,
|
|
|
- uint32_t session_id,
|
|
|
- eCsrEncryptionType encr_type,
|
|
|
- struct bss_description *bss_descr,
|
|
|
- tSirMacAddr *bssid, bool addkey,
|
|
|
- bool unicast,
|
|
|
- tAniKeyDirection key_direction,
|
|
|
- uint8_t key_id, uint16_t key_length,
|
|
|
- uint8_t *key, uint8_t pae_role)
|
|
|
-{
|
|
|
- return csr_roam_issue_set_context_req(mac_ctx, session_id, encr_type,
|
|
|
- bss_descr, bssid, addkey,
|
|
|
- unicast, key_direction, key_id,
|
|
|
- key_length, key, pae_role);
|
|
|
-}
|
|
|
-#endif
|
|
|
-
|
|
|
-/**
|
|
|
- * csr_update_key_cmd() - update key info in set key command
|
|
|
- * @mac_ctx: mac global context
|
|
|
- * @session: roam session
|
|
|
- * @set_key: input set key command
|
|
|
- * @set_key_cmd: set key command to update
|
|
|
- * @is_key_valid: indicates if key is valid
|
|
|
- *
|
|
|
- * This function will validate the key length, adjust if too long. It will
|
|
|
- * update is_key_valid flag to false if some error has occurred key are local.
|
|
|
- *
|
|
|
- * Return: status of operation
|
|
|
- */
|
|
|
-static QDF_STATUS
|
|
|
-csr_update_key_cmd(struct mac_context *mac_ctx, struct csr_roam_session *session,
|
|
|
- tCsrRoamSetKey *set_key, struct setkey_cmd *set_key_cmd,
|
|
|
- bool *is_key_valid)
|
|
|
-{
|
|
|
- switch (set_key->encType) {
|
|
|
- case eCSR_ENCRYPT_TYPE_WEP40:
|
|
|
- case eCSR_ENCRYPT_TYPE_WEP40_STATICKEY:
|
|
|
- /* KeyLength maybe 0 for static WEP */
|
|
|
- if (set_key->keyLength) {
|
|
|
- if (set_key->keyLength < WLAN_CRYPTO_KEY_WEP40_LEN) {
|
|
|
- sme_warn("Invalid WEP40 keylength [= %d]",
|
|
|
- set_key->keyLength);
|
|
|
- *is_key_valid = false;
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
-
|
|
|
- set_key_cmd->keyLength = WLAN_CRYPTO_KEY_WEP40_LEN;
|
|
|
- qdf_mem_copy(set_key_cmd->Key, set_key->Key,
|
|
|
- WLAN_CRYPTO_KEY_WEP40_LEN);
|
|
|
- }
|
|
|
- *is_key_valid = true;
|
|
|
- break;
|
|
|
- case eCSR_ENCRYPT_TYPE_WEP104:
|
|
|
- case eCSR_ENCRYPT_TYPE_WEP104_STATICKEY:
|
|
|
- /* KeyLength maybe 0 for static WEP */
|
|
|
- if (set_key->keyLength) {
|
|
|
- if (set_key->keyLength < WLAN_CRYPTO_KEY_WEP104_LEN) {
|
|
|
- sme_warn("Invalid WEP104 keylength [= %d]",
|
|
|
- set_key->keyLength);
|
|
|
- *is_key_valid = false;
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
-
|
|
|
- set_key_cmd->keyLength = WLAN_CRYPTO_KEY_WEP104_LEN;
|
|
|
- qdf_mem_copy(set_key_cmd->Key, set_key->Key,
|
|
|
- WLAN_CRYPTO_KEY_WEP104_LEN);
|
|
|
- }
|
|
|
- *is_key_valid = true;
|
|
|
- break;
|
|
|
- case eCSR_ENCRYPT_TYPE_TKIP:
|
|
|
- if (set_key->keyLength < CSR_TKIP_KEY_LEN) {
|
|
|
- sme_warn("Invalid TKIP keylength [= %d]",
|
|
|
- set_key->keyLength);
|
|
|
- *is_key_valid = false;
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
- set_key_cmd->keyLength = CSR_TKIP_KEY_LEN;
|
|
|
- qdf_mem_copy(set_key_cmd->Key, set_key->Key,
|
|
|
- CSR_TKIP_KEY_LEN);
|
|
|
- *is_key_valid = true;
|
|
|
- break;
|
|
|
- case eCSR_ENCRYPT_TYPE_AES:
|
|
|
- if (set_key->keyLength < CSR_AES_KEY_LEN) {
|
|
|
- sme_warn("Invalid AES/CCMP keylength [= %d]",
|
|
|
- set_key->keyLength);
|
|
|
- *is_key_valid = false;
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
- set_key_cmd->keyLength = CSR_AES_KEY_LEN;
|
|
|
- qdf_mem_copy(set_key_cmd->Key, set_key->Key,
|
|
|
- CSR_AES_KEY_LEN);
|
|
|
- *is_key_valid = true;
|
|
|
- break;
|
|
|
- case eCSR_ENCRYPT_TYPE_AES_GCMP:
|
|
|
- if (set_key->keyLength < CSR_AES_GCMP_KEY_LEN) {
|
|
|
- sme_warn(
|
|
|
- "Invalid AES_GCMP keylength [= %d]",
|
|
|
- set_key->keyLength);
|
|
|
- *is_key_valid = false;
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
- set_key_cmd->keyLength = CSR_AES_GCMP_KEY_LEN;
|
|
|
- qdf_mem_copy(set_key_cmd->Key, set_key->Key,
|
|
|
- CSR_AES_GCMP_KEY_LEN);
|
|
|
- *is_key_valid = true;
|
|
|
- break;
|
|
|
- case eCSR_ENCRYPT_TYPE_AES_GCMP_256:
|
|
|
- if (set_key->keyLength < CSR_AES_GCMP_256_KEY_LEN) {
|
|
|
- sme_warn(
|
|
|
- "Invalid AES_GCMP_256 keylength [= %d]",
|
|
|
- set_key->keyLength);
|
|
|
- *is_key_valid = false;
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
- set_key_cmd->keyLength = CSR_AES_GCMP_256_KEY_LEN;
|
|
|
- qdf_mem_copy(set_key_cmd->Key, set_key->Key,
|
|
|
- CSR_AES_GCMP_256_KEY_LEN);
|
|
|
- *is_key_valid = true;
|
|
|
- break;
|
|
|
-#ifdef FEATURE_WLAN_WAPI
|
|
|
- case eCSR_ENCRYPT_TYPE_WPI:
|
|
|
- if (set_key->keyLength < CSR_WAPI_KEY_LEN) {
|
|
|
- sme_warn("Invalid WAPI keylength [= %d]",
|
|
|
- set_key->keyLength);
|
|
|
- *is_key_valid = false;
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
- set_key_cmd->keyLength = CSR_WAPI_KEY_LEN;
|
|
|
- qdf_mem_copy(set_key_cmd->Key, set_key->Key,
|
|
|
- CSR_WAPI_KEY_LEN);
|
|
|
- if (session->pCurRoamProfile) {
|
|
|
- session->pCurRoamProfile->negotiatedUCEncryptionType =
|
|
|
- eCSR_ENCRYPT_TYPE_WPI;
|
|
|
- } else {
|
|
|
- sme_err("pCurRoamProfile is NULL");
|
|
|
- *is_key_valid = false;
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
- *is_key_valid = true;
|
|
|
- break;
|
|
|
-#endif /* FEATURE_WLAN_WAPI */
|
|
|
-#ifdef FEATURE_WLAN_ESE
|
|
|
- case eCSR_ENCRYPT_TYPE_KRK:
|
|
|
- /* no need to enqueue KRK key request, since they are local */
|
|
|
- *is_key_valid = false;
|
|
|
- if (set_key->keyLength < CSR_KRK_KEY_LEN) {
|
|
|
- sme_warn("Invalid KRK keylength [= %d]",
|
|
|
- set_key->keyLength);
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
- qdf_mem_copy(session->eseCckmInfo.krk, set_key->Key,
|
|
|
- CSR_KRK_KEY_LEN);
|
|
|
- session->eseCckmInfo.reassoc_req_num = 1;
|
|
|
- session->eseCckmInfo.krk_plumbed = true;
|
|
|
- break;
|
|
|
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
|
|
- case eCSR_ENCRYPT_TYPE_BTK:
|
|
|
- /* no need to enqueue KRK key request, since they are local */
|
|
|
- *is_key_valid = false;
|
|
|
- if (set_key->keyLength < SIR_BTK_KEY_LEN) {
|
|
|
- sme_warn("LFR3:Invalid BTK keylength [= %d]",
|
|
|
- set_key->keyLength);
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
- qdf_mem_copy(session->eseCckmInfo.btk, set_key->Key,
|
|
|
- SIR_BTK_KEY_LEN);
|
|
|
- /*
|
|
|
- * KRK and BTK are updated by upper layer back to back. Send
|
|
|
- * updated KRK and BTK together to FW here.
|
|
|
- */
|
|
|
- csr_roam_update_cfg(mac_ctx, session->sessionId,
|
|
|
- REASON_ROAM_PSK_PMK_CHANGED);
|
|
|
- break;
|
|
|
-#endif
|
|
|
-#endif /* FEATURE_WLAN_ESE */
|
|
|
-#ifdef WLAN_FEATURE_11W
|
|
|
- /* Check for 11w BIP */
|
|
|
- case eCSR_ENCRYPT_TYPE_AES_CMAC:
|
|
|
- if (set_key->keyLength < CSR_AES_KEY_LEN) {
|
|
|
- sme_warn("Invalid AES/CCMP keylength [= %d]",
|
|
|
- set_key->keyLength);
|
|
|
- *is_key_valid = false;
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
- set_key_cmd->keyLength = CSR_AES_KEY_LEN;
|
|
|
- qdf_mem_copy(set_key_cmd->Key, set_key->Key,
|
|
|
- CSR_AES_KEY_LEN);
|
|
|
- *is_key_valid = true;
|
|
|
- break;
|
|
|
-
|
|
|
- case eCSR_ENCRYPT_TYPE_AES_GMAC_128:
|
|
|
- if (set_key->keyLength < CSR_AES_GMAC_128_KEY_LEN) {
|
|
|
- sme_warn("Invalid AES GMAC 128 keylength [= %d]",
|
|
|
- set_key->keyLength);
|
|
|
- *is_key_valid = false;
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
- set_key_cmd->keyLength = CSR_AES_GMAC_128_KEY_LEN;
|
|
|
- qdf_mem_copy(set_key_cmd->Key, set_key->Key,
|
|
|
- CSR_AES_GMAC_128_KEY_LEN);
|
|
|
- *is_key_valid = true;
|
|
|
- break;
|
|
|
-
|
|
|
- case eCSR_ENCRYPT_TYPE_AES_GMAC_256:
|
|
|
- if (set_key->keyLength < CSR_AES_GMAC_256_KEY_LEN) {
|
|
|
- sme_warn("Invalid AES GMAC 256 keylength [= %d]",
|
|
|
- set_key->keyLength);
|
|
|
- *is_key_valid = false;
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
- set_key_cmd->keyLength = CSR_AES_GMAC_256_KEY_LEN;
|
|
|
- qdf_mem_copy(set_key_cmd->Key, set_key->Key,
|
|
|
- CSR_AES_GMAC_256_KEY_LEN);
|
|
|
- *is_key_valid = true;
|
|
|
- break;
|
|
|
-
|
|
|
-#endif /* WLAN_FEATURE_11W */
|
|
|
- default:
|
|
|
- /* for open security also we want to enqueue command */
|
|
|
- *is_key_valid = true;
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
- } /* end of switch */
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-static QDF_STATUS csr_roam_issue_set_key_command(
|
|
|
-struct mac_context *mac_ctx, uint32_t session_id,
|
|
|
- tCsrRoamSetKey *set_key,
|
|
|
- uint32_t roam_id)
|
|
|
-{
|
|
|
- QDF_STATUS status = QDF_STATUS_E_INVAL;
|
|
|
- bool is_key_valid = true;
|
|
|
- struct setkey_cmd set_key_cmd;
|
|
|
-#if defined(FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_WAPI)
|
|
|
- struct csr_roam_session *session = CSR_GET_SESSION(mac_ctx, session_id);
|
|
|
-
|
|
|
- if (!session) {
|
|
|
- QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
|
|
- "session %d not found", session_id);
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
- }
|
|
|
-#endif /* FEATURE_WLAN_ESE */
|
|
|
-
|
|
|
- qdf_mem_zero(&set_key_cmd, sizeof(struct setkey_cmd));
|
|
|
- /*
|
|
|
- * following function will validate the key length, Adjust if too long.
|
|
|
- * for static WEP the keys are not set thru' SetContextReq
|
|
|
- *
|
|
|
- * it will update bool is_key_valid, to false if some error has occurred
|
|
|
- * key are local. enqueue sme command only if is_key_valid is true
|
|
|
- * status is indication of success or failure and will be returned to
|
|
|
- * called of current function if command is not enqueued due to key req
|
|
|
- * being local
|
|
|
- */
|
|
|
- status = csr_update_key_cmd(mac_ctx, session, set_key,
|
|
|
- &set_key_cmd, &is_key_valid);
|
|
|
- if (is_key_valid) {
|
|
|
- set_key_cmd.roamId = roam_id;
|
|
|
- set_key_cmd.encType = set_key->encType;
|
|
|
- set_key_cmd.keyDirection = set_key->keyDirection;
|
|
|
- qdf_copy_macaddr(&set_key_cmd.peermac,
|
|
|
- &set_key->peerMac);
|
|
|
- /* 0 for supplicant */
|
|
|
- set_key_cmd.paeRole = set_key->paeRole;
|
|
|
- set_key_cmd.keyId = set_key->keyId;
|
|
|
- qdf_mem_copy(set_key_cmd.keyRsc, set_key->keyRsc,
|
|
|
- WLAN_CRYPTO_RSC_SIZE);
|
|
|
- /*
|
|
|
- * Always put set key to the head of the Q because it is the
|
|
|
- * only thing to get executed in case of WT_KEY state
|
|
|
- */
|
|
|
- sme_debug("set key req for session-%d authtype-%d",
|
|
|
- session_id, set_key->encType);
|
|
|
- status = csr_roam_send_set_key_cmd(mac_ctx, session_id,
|
|
|
- &set_key_cmd);
|
|
|
- if (!QDF_IS_STATUS_SUCCESS(status))
|
|
|
- sme_err("fail to send message status = %d", status);
|
|
|
- }
|
|
|
- return status;
|
|
|
-}
|
|
|
-
|
|
|
-QDF_STATUS csr_roam_send_set_key_cmd(struct mac_context *mac_ctx,
|
|
|
- uint32_t session_id,
|
|
|
- struct setkey_cmd *set_key_cmd)
|
|
|
-{
|
|
|
- QDF_STATUS status;
|
|
|
- uint8_t num_keys = (set_key_cmd->keyLength) ? 1 : 0;
|
|
|
- tAniEdType ed_type = csr_translate_encrypt_type_to_ed_type(
|
|
|
- set_key_cmd->encType);
|
|
|
- bool unicast = (set_key_cmd->peermac.bytes[0] == 0xFF) ? false : true;
|
|
|
-#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
|
|
|
- struct wlan_mlme_wep_cfg *wep_params = &mac_ctx->mlme_cfg->wep_params;
|
|
|
- struct csr_roam_session *session = CSR_GET_SESSION(mac_ctx, session_id);
|
|
|
-
|
|
|
- WLAN_HOST_DIAG_EVENT_DEF(setKeyEvent,
|
|
|
- host_event_wlan_security_payload_type);
|
|
|
-
|
|
|
- if (!session) {
|
|
|
- sme_err("session %d not found", session_id);
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
- }
|
|
|
-
|
|
|
- if (eSIR_ED_NONE != ed_type) {
|
|
|
- qdf_mem_zero(&setKeyEvent,
|
|
|
- sizeof(host_event_wlan_security_payload_type));
|
|
|
- if (qdf_is_macaddr_group(&set_key_cmd->peermac)) {
|
|
|
- setKeyEvent.eventId = WLAN_SECURITY_EVENT_SET_BCAST_REQ;
|
|
|
- setKeyEvent.encryptionModeMulticast =
|
|
|
- (uint8_t) diag_enc_type_from_csr_type(
|
|
|
- set_key_cmd->encType);
|
|
|
- setKeyEvent.encryptionModeUnicast =
|
|
|
- (uint8_t) diag_enc_type_from_csr_type(session->
|
|
|
- connectedProfile.
|
|
|
- EncryptionType);
|
|
|
- } else {
|
|
|
- setKeyEvent.eventId =
|
|
|
- WLAN_SECURITY_EVENT_SET_UNICAST_REQ;
|
|
|
- setKeyEvent.encryptionModeUnicast =
|
|
|
- (uint8_t) diag_enc_type_from_csr_type(
|
|
|
- set_key_cmd->encType);
|
|
|
- setKeyEvent.encryptionModeMulticast =
|
|
|
- (uint8_t) diag_enc_type_from_csr_type(session->
|
|
|
- connectedProfile.
|
|
|
- mcEncryptionType);
|
|
|
- }
|
|
|
- qdf_mem_copy(setKeyEvent.bssid,
|
|
|
- session->connectedProfile.bssid.bytes,
|
|
|
- QDF_MAC_ADDR_SIZE);
|
|
|
- if (CSR_IS_ENC_TYPE_STATIC(set_key_cmd->encType)) {
|
|
|
- /* It has to be static WEP here */
|
|
|
- setKeyEvent.keyId = wep_params->wep_default_key_id;
|
|
|
- } else {
|
|
|
- setKeyEvent.keyId = set_key_cmd->keyId;
|
|
|
- }
|
|
|
- setKeyEvent.authMode =
|
|
|
- (uint8_t) diag_auth_type_from_csr_type(session->
|
|
|
- connectedProfile.
|
|
|
- AuthType);
|
|
|
- WLAN_HOST_DIAG_EVENT_REPORT(&setKeyEvent, EVENT_WLAN_SECURITY);
|
|
|
- }
|
|
|
-#endif /* FEATURE_WLAN_DIAG_SUPPORT_CSR */
|
|
|
- if (csr_is_set_key_allowed(mac_ctx, session_id)) {
|
|
|
- status = csr_send_mb_set_context_req_msg(mac_ctx, session_id,
|
|
|
- set_key_cmd->peermac,
|
|
|
- num_keys, ed_type, unicast,
|
|
|
- set_key_cmd->keyDirection,
|
|
|
- set_key_cmd->keyId,
|
|
|
- set_key_cmd->keyLength,
|
|
|
- set_key_cmd->Key,
|
|
|
- set_key_cmd->paeRole,
|
|
|
- set_key_cmd->keyRsc);
|
|
|
- } else {
|
|
|
- sme_warn(" cannot process not connected");
|
|
|
- /* Set this status so the error handling take
|
|
|
- * care of the case.
|
|
|
- */
|
|
|
- status = QDF_STATUS_CSR_WRONG_STATE;
|
|
|
- }
|
|
|
- if (!QDF_IS_STATUS_SUCCESS(status)) {
|
|
|
- sme_err(" error status %d", status);
|
|
|
- csr_roam_call_callback(mac_ctx, session_id, NULL,
|
|
|
- set_key_cmd->roamId,
|
|
|
- eCSR_ROAM_SET_KEY_COMPLETE,
|
|
|
- eCSR_ROAM_RESULT_FAILURE);
|
|
|
-#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
|
|
|
- if (eSIR_ED_NONE != ed_type) {
|
|
|
- if (qdf_is_macaddr_group(&set_key_cmd->peermac))
|
|
|
- setKeyEvent.eventId =
|
|
|
- WLAN_SECURITY_EVENT_SET_BCAST_RSP;
|
|
|
- else
|
|
|
- setKeyEvent.eventId =
|
|
|
- WLAN_SECURITY_EVENT_SET_UNICAST_RSP;
|
|
|
- setKeyEvent.status = WLAN_SECURITY_STATUS_FAILURE;
|
|
|
- WLAN_HOST_DIAG_EVENT_REPORT(&setKeyEvent,
|
|
|
- EVENT_WLAN_SECURITY);
|
|
|
- }
|
|
|
-#endif /* FEATURE_WLAN_DIAG_SUPPORT_CSR */
|
|
|
- }
|
|
|
- return status;
|
|
|
-}
|
|
|
-
|
|
|
-QDF_STATUS csr_roam_set_key(struct mac_context *mac, uint32_t sessionId,
|
|
|
- tCsrRoamSetKey *pSetKey, uint32_t roamId)
|
|
|
-{
|
|
|
- QDF_STATUS status;
|
|
|
-
|
|
|
- if (!csr_is_set_key_allowed(mac, sessionId)) {
|
|
|
- status = QDF_STATUS_CSR_WRONG_STATE;
|
|
|
- } else {
|
|
|
- status = csr_roam_issue_set_key_command(mac, sessionId,
|
|
|
- pSetKey, roamId);
|
|
|
- }
|
|
|
- return status;
|
|
|
-}
|
|
|
-
|
|
|
#ifdef WLAN_FEATURE_FILS_SK
|
|
|
/*
|
|
|
* csr_create_fils_realm_hash: API to create hash using realm
|
|
@@ -16933,82 +16475,6 @@ QDF_STATUS csr_send_assoc_cnf_msg(struct mac_context *mac,
|
|
|
return status;
|
|
|
}
|
|
|
|
|
|
-QDF_STATUS csr_send_mb_set_context_req_msg(struct mac_context *mac,
|
|
|
- uint32_t sessionId,
|
|
|
- struct qdf_mac_addr peer_macaddr,
|
|
|
- uint8_t numKeys,
|
|
|
- tAniEdType edType, bool fUnicast,
|
|
|
- tAniKeyDirection aniKeyDirection,
|
|
|
- uint8_t keyId, uint8_t keyLength,
|
|
|
- uint8_t *pKey, uint8_t paeRole,
|
|
|
- uint8_t *pKeyRsc)
|
|
|
-{
|
|
|
- struct set_context_req *pMsg;
|
|
|
- struct scheduler_msg msg = {0};
|
|
|
- uint16_t msgLen;
|
|
|
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
|
|
- struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId);
|
|
|
-
|
|
|
- sme_debug("keylength: %d Encry type: %d", keyLength, edType);
|
|
|
- do {
|
|
|
- if ((1 != numKeys) && (0 != numKeys))
|
|
|
- break;
|
|
|
- /*
|
|
|
- * All of these fields appear in every SET_CONTEXT message.
|
|
|
- * Below we'll add in the size for each key set. Since we only
|
|
|
- * support up to one key, we always allocate memory for 1 key.
|
|
|
- */
|
|
|
- msgLen = sizeof(*pMsg);
|
|
|
-
|
|
|
- pMsg = qdf_mem_malloc(msgLen);
|
|
|
- if (!pMsg)
|
|
|
- return QDF_STATUS_E_NOMEM;
|
|
|
- pMsg->messageType = eWNI_SME_SETCONTEXT_REQ;
|
|
|
- pMsg->length = msgLen;
|
|
|
- pMsg->vdev_id = (uint8_t) sessionId;
|
|
|
- qdf_copy_macaddr(&pMsg->peer_macaddr, &peer_macaddr);
|
|
|
- qdf_copy_macaddr(&pMsg->bssid,
|
|
|
- &pSession->connectedProfile.bssid);
|
|
|
-
|
|
|
- /**
|
|
|
- * Set the pMsg->keyMaterial.length field
|
|
|
- * (this length is defined as all data that follows the
|
|
|
- * edType field in the tSirKeyMaterial keyMaterial; field).
|
|
|
- *
|
|
|
- * NOTE: This keyMaterial.length contains the length of a
|
|
|
- * MAX size key, though the keyLength can be shorter than this
|
|
|
- * max size. Is LIM interpreting this ok ?
|
|
|
- */
|
|
|
- pMsg->keyMaterial.length =
|
|
|
- sizeof(pMsg->keyMaterial.numKeys) +
|
|
|
- (numKeys * sizeof(pMsg->keyMaterial.key));
|
|
|
- pMsg->keyMaterial.edType = edType;
|
|
|
- pMsg->keyMaterial.numKeys = numKeys;
|
|
|
- pMsg->keyMaterial.key[0].keyId = keyId;
|
|
|
- pMsg->keyMaterial.key[0].unicast = fUnicast;
|
|
|
- pMsg->keyMaterial.key[0].keyDirection = aniKeyDirection;
|
|
|
- qdf_mem_copy(pMsg->keyMaterial.key[0].keyRsc,
|
|
|
- pKeyRsc, WLAN_CRYPTO_RSC_SIZE);
|
|
|
- /* 0 is Supplicant */
|
|
|
- pMsg->keyMaterial.key[0].paeRole = paeRole;
|
|
|
- pMsg->keyMaterial.key[0].keyLength = keyLength;
|
|
|
- if (keyLength && pKey)
|
|
|
- qdf_mem_copy(pMsg->keyMaterial.key[0].key,
|
|
|
- pKey, keyLength);
|
|
|
-
|
|
|
- msg.type = eWNI_SME_SETCONTEXT_REQ;
|
|
|
- msg.bodyptr = pMsg;
|
|
|
- status = scheduler_post_message(QDF_MODULE_ID_SME,
|
|
|
- QDF_MODULE_ID_PE,
|
|
|
- QDF_MODULE_ID_PE, &msg);
|
|
|
- if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
- qdf_mem_zero(pMsg, msgLen);
|
|
|
- qdf_mem_free(pMsg);
|
|
|
- }
|
|
|
- } while (0);
|
|
|
- return status;
|
|
|
-}
|
|
|
-
|
|
|
QDF_STATUS csr_send_mb_start_bss_req_msg(struct mac_context *mac, uint32_t
|
|
|
sessionId, eCsrRoamBssType bssType,
|
|
|
struct csr_roamstart_bssparams *pParam,
|