|
@@ -1,6 +1,6 @@
|
|
|
/*
|
|
|
* Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
|
|
|
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
|
|
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
|
|
*
|
|
|
* Permission to use, copy, modify, and/or distribute this software for
|
|
|
* any purpose with or without fee is hereby granted, provided that the
|
|
@@ -390,103 +390,3 @@ bool lim_is_sme_deauth_req_valid(struct mac_context *mac,
|
|
|
|
|
|
return true;
|
|
|
} /*** end lim_is_sme_deauth_req_valid() ***/
|
|
|
-
|
|
|
-bool lim_is_sme_set_context_req_valid(struct mac_context *mac,
|
|
|
- struct set_context_req *set_context_req)
|
|
|
-{
|
|
|
- uint8_t i = 0;
|
|
|
- uint8_t valid = true;
|
|
|
- tpSirKeys key = set_context_req->keyMaterial.key;
|
|
|
-
|
|
|
- if ((set_context_req->keyMaterial.edType != eSIR_ED_WEP40) &&
|
|
|
- (set_context_req->keyMaterial.edType != eSIR_ED_WEP104) &&
|
|
|
- (set_context_req->keyMaterial.edType != eSIR_ED_NONE) &&
|
|
|
-#ifdef FEATURE_WLAN_WAPI
|
|
|
- (set_context_req->keyMaterial.edType != eSIR_ED_WPI) &&
|
|
|
-#endif
|
|
|
- !set_context_req->keyMaterial.numKeys) {
|
|
|
- /**
|
|
|
- * No keys present in case of TKIP or CCMP
|
|
|
- * Log error.
|
|
|
- */
|
|
|
- pe_warn("No keys present in SME_SETCONTEXT_REQ for edType: %d",
|
|
|
- set_context_req->keyMaterial.edType);
|
|
|
-
|
|
|
- valid = false;
|
|
|
- goto end;
|
|
|
- }
|
|
|
-
|
|
|
- if (set_context_req->keyMaterial.numKeys &&
|
|
|
- (set_context_req->keyMaterial.edType == eSIR_ED_NONE)) {
|
|
|
- /**
|
|
|
- * Keys present in case of no ED policy
|
|
|
- * Log error.
|
|
|
- */
|
|
|
- pe_warn("Keys present in SME_SETCONTEXT_REQ for edType: %d",
|
|
|
- set_context_req->keyMaterial.edType);
|
|
|
-
|
|
|
- valid = false;
|
|
|
- goto end;
|
|
|
- }
|
|
|
-
|
|
|
- if (set_context_req->keyMaterial.edType >= eSIR_ED_NOT_IMPLEMENTED) {
|
|
|
- /**
|
|
|
- * Invalid edType in the message
|
|
|
- * Log error.
|
|
|
- */
|
|
|
- pe_warn("Invalid edType: %d in SME_SETCONTEXT_REQ",
|
|
|
- set_context_req->keyMaterial.edType);
|
|
|
-
|
|
|
- valid = false;
|
|
|
- goto end;
|
|
|
- } else if (set_context_req->keyMaterial.edType > eSIR_ED_NONE) {
|
|
|
- bool privacy;
|
|
|
-
|
|
|
- privacy = mac->mlme_cfg->wep_params.is_privacy_enabled;
|
|
|
-
|
|
|
- if (!privacy) {
|
|
|
- /**
|
|
|
- * Privacy is not enabled
|
|
|
- * In order to allow mixed mode for Guest access
|
|
|
- * allow BSS creation/join with no Privacy capability
|
|
|
- * yet advertising WPA IE
|
|
|
- */
|
|
|
- pe_debug("Privacy is not enabled, yet non-None EDtype: %d in SME_SETCONTEXT_REQ",
|
|
|
- set_context_req->keyMaterial.edType);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- for (i = 0; i < set_context_req->keyMaterial.numKeys; i++) {
|
|
|
- if (((set_context_req->keyMaterial.edType == eSIR_ED_WEP40) &&
|
|
|
- (key->keyLength != 5)) ||
|
|
|
- ((set_context_req->keyMaterial.edType == eSIR_ED_WEP104) &&
|
|
|
- (key->keyLength != 13)) ||
|
|
|
- ((set_context_req->keyMaterial.edType == eSIR_ED_TKIP) &&
|
|
|
- (key->keyLength != 32)) ||
|
|
|
-#ifdef FEATURE_WLAN_WAPI
|
|
|
- ((set_context_req->keyMaterial.edType == eSIR_ED_WPI) &&
|
|
|
- (key->keyLength != 32)) ||
|
|
|
-#endif
|
|
|
- ((set_context_req->keyMaterial.edType == eSIR_ED_GCMP) &&
|
|
|
- (key->keyLength != 16)) ||
|
|
|
- ((set_context_req->keyMaterial.edType == eSIR_ED_GCMP_256) &&
|
|
|
- (key->keyLength != 32)) ||
|
|
|
- ((set_context_req->keyMaterial.edType == eSIR_ED_CCMP) &&
|
|
|
- (key->keyLength != 16))) {
|
|
|
- /**
|
|
|
- * Invalid key length for a given ED type
|
|
|
- * Log error.
|
|
|
- */
|
|
|
- pe_warn("Invalid keyLength: %d for edType: %d in SME_SETCONTEXT_REQ",
|
|
|
- key->keyLength,
|
|
|
- set_context_req->keyMaterial.edType);
|
|
|
-
|
|
|
- valid = false;
|
|
|
- goto end;
|
|
|
- }
|
|
|
- key++;
|
|
|
- }
|
|
|
-
|
|
|
-end:
|
|
|
- return valid;
|
|
|
-} /*** end lim_is_sme_set_context_req_valid() ***/
|