Grafico dei commit

183 Commit

Autore SHA1 Messaggio Data
Pragaspathi Thilagaraj
cbefdcb9f0 qcacmn: Add support for WMI_ROAM_SYNCH_KEY_EVENTID
Add support to handle WMI_ROAM_SYNCH_KEY_EVENTID.
WMI_ROAM_SYNCH_KEY_EVENTID is received after roaming to 3 Link
MLO AP when standby link is supported.

Add changes to register handler function pointers and parse
the event.

Change-Id: Iee17560f9f1f3242ef512a550764a9c64319b67f
CRs-Fixed: 3571673
2023-08-10 14:42:56 -07:00
Pragaspathi Thilagaraj
3efd94838f qcacmn: Add crypto changes to support roam sync key event
Change few static crypto API's to global.
Add support to add new crypto entry based on passing the entire
entry structure itself.

Change-Id: Id2e0a46bb8b44a834d17d2a04b0dc28fc881b4e3
CRs-Fixed: 3571796
2023-07-31 19:37:59 -07:00
Aasir Rasheed
cc94ae4317 qcacmn: Add crypto api's for individual link
Currently crypto module is using vdev to get
and delete the crypto key, However there is a need to get
and delete the crypto key based on psoc level.
The change is to use psoc handler for retrieving and deleting
the key.
Change-Id: I4fcf0fd5c7d9d5a579c092c43117594f7d9fc6a3
CRs-Fixed: 3561978
2023-07-21 16:50:50 -07:00
Aditya Kodukula
e382b8c781 qcacmn: Fix arguments of QDF_MAC_ADDR_REF to avoid compilation failure
Currently in driver while using QDF_MAC_ADDR_FMT to print mac
address, the mac address reference provided to QDF_MAC_ADDR_REF is
incorrect in some cases and it can cause compilation failure.
So, fix all such instances.

Change-Id: I31aa5abddc3c207b2fd2eb823ac2000f5ed3f0a6
CRs-Fixed: 3563985
2023-07-21 16:50:24 -07:00
Sai Pratyusha Magam
799450bbce qcacmn: Changes for 11az related security params
Changes for 11az related security params.

Change-Id: I28414f046ec7aa01152df605a6c4f99d243ff587
CRs-Fixed: 3560800
2023-07-20 19:19:13 -07:00
Aasir Rasheed
cf3f12281d qcacmn: Integrate hashing framework in crypto module
The current implementation of the crypto module utilizes
the vdev object for saving and retrieving crypto keys.
However, there is a need to store keys for individual
links in the n-link MLO. To address this requirement,
a proposal has been made to leverage the hashing
framework and store/retrieve keys from the PSoC level.
The change involves leveraging the hashing framework
to save and retrieve keys from the PSoC level.
Change-Id: I9c93545869b0c1d42b2c0e31bc672aa78573be2a
CRs-Fixed: 3549390
2023-07-14 01:12:03 -07:00
Aasir Rasheed
b39b050462 qcacmn: Introduce hashing framework support for crypto
This change incorporates support for the hashing framework,
enabling key storage for individual links in the n-link MLO.
The implementation includes the addition of new APIs
specifically designed to accommodate the crypto hashing
framework.

Change-Id: I9305c4a71b8970a8a6037d6d80f11c6139a77bd8
CRs-Fixed: 3498849
2023-07-14 01:11:52 -07:00
Aasir Rasheed
aa7c47fe95 qcacmn: Add crypto changes for code convergence
At present, the crypto module utilizes the wlan_crypto_comp_priv
structure to store crypto keys. However, there is a need to store
keys for individual links in n-link MLO. To address this requirement
it is proposed to store the key from the vdev level to the psoc level.
This change will allow the reuse of a common structure.

Change-Id: Idc0d8bb11a80b66c7ded5c930ec0560566398890
CRs-Fixed: 3527400
2023-06-23 15:47:23 -07:00
Pradeep Kumar Palraj
1a7ce50c83 qcacmn: Return error when key install fail
Low throughput is seen with interop clients when
set key is issued before wmi_peer_assoc command,
hence avoide key install before wmi_peer_assoc.

We are check here to verify the key install success
or failure.

Change-Id: I553a5ed01165354afc19885b4f62c13632908808
CRs-Fixed: 3274020
2023-05-11 06:31:59 -07:00
Sai Pratyusha Magam
1d681b7823 qcacmn: Use vdev macaddr for GTK/BIGTK PN fetch from FW
Use vdev macaddr instead of bcast addr for GTK/BIGTK PN fetch.
Also, copy back TX PN back to hostapd.

Change-Id: I98fc7a78c194c84de6554a684d3ce14f66772040
CRs-Fixed: 3370635
2023-05-09 04:07:08 -07:00
Surya Prakash Sivaraj
88804f2cfc qcacmn: Add support for AKM25
Add support for FT-SAE-EXT-KEY AKM.

Change-Id: I832b414b31d42113eec6d099ba4c62e76dfe6cb1
CRs-Fixed: 3406626
2023-03-27 11:21:18 -07:00
Rohan Dutta
b606c4ad39 qcacmn: Add support for AKM25
Add support for AKM FT_SAE_EXT (00:0f:ac:25)

Change-Id: Iae9fbfbc0989e0bcac343c1814ad4a442243e8f4
CRs-Fixed: 3408695
2023-03-08 04:19:12 -08:00
Sai Pratyusha Magam
373c20c855 qcacmn: Fix improper naming convention
Fix improper naming convention for store_def_keyix_peer
Avoid qdf_export since the function is defined and called
from the same file

Change-Id: I488267eccf521071038958fe85e9c1be90df27b2
CRs-Fixed: 3384714
2023-02-20 10:39:10 -08:00
Jeff Johnson
b0fa96084a qcacmn: Fix umac/cmn_services/crypto documentation
The kernel-doc script identified some documentation issues in the
umac/cmn_services/crypto folder, so fix them. In addition there are
multiple instances of both the interface and the implementation being
documented, so remove the duplicates, keeping just the interface
documentation.

Change-Id: Ied5bfcdff185d0b144f8c41affb5adcb3b8a5b88
CRs-Fixed: 3394398
2023-02-07 09:41:28 -08:00
Jeff Johnson
8dabb37995 qcacmn: Fix bad crypto function brace placements
Per the coding style "functions [...] have the opening brace at the
beginning of the next line."

In umac/cmn_services/crypto there are two files that are not
consistently following this style, so fix them.

That will address the following error flagged by the Linux checkpatch
script:
ERROR:OPEN_BRACE: open brace '{' following function definitions go on
the next line

Change-Id: I774e027c594689b8ab4ff49bab5fc0b536d685f6
CRs-Fixed: 3384735
2023-01-24 01:35:26 -08:00
Pooventhiran G
e69557093d qcacmn: Fix Rx PN error stats for broadcast mgmt frames
Rx PN error stats for broadcast management frames is being tracked
as a ucast stats. Fix it to be tracked as part of mcast stats.

Change-Id: If76c512107728b792ed6d92d56036325592f0fd1
CRs-Fixed: 3361840
2023-01-05 14:30:52 -08:00
Qun Zhang
1eafc7e4d9 qcacmn: Return real result for setting key request
Currently in function wlan_crypto_set_key_req(), as long as
WLAN_CRYPTO_TX_OPS_SET_KEY() isn't NULL, it always returns
QDF_STATUS_SUCCESS irrespective of the real processing result
of setting key request and causes FW assert in below test:
1. DUT work as SAP role
2. Peer STA repeatedly do connect/deauth with very short
time interval
3. When SAP just finish 4-way handshake and supplicant don't
add key to wlan host yet, peer STA send deauth again. Once
deauth is received, wlan host will free peer STA related info.
Just after this, supplicant key setting is arrived, and wlan
host return QDF_STATUS_SUCCESS and wait for completion event
of key setting, like below log:
 target_if_crypto_set_key: key_type 0, mac: 7c:c2:c6:32:cb:90
 target_if_crypto_set_key: Invalid peer
4. During the waiting time, peer STA trigger connection again,
due to previous key setting isn't still done, it will block
new key setting. And when completion event timeout happen, it
will still call wma_update_set_key() to notify successful key
setting. So when wlan host send WMI_PEER_SET_PARAM_CMDID to
update authenticate state, FW find key isn't still installed
and trigger assert.

Change-Id: Ice1c5dcfbbde394e1271b900ba783fea98493647
CRs-Fixed: 3364767
2022-12-22 10:44:58 -08:00
Surya Prakash Sivaraj
dda3f7844b qcacmn: Add support for AKM 24
Add support for AKM 24

Change-Id: I7bd483afbe1659c56b6708085f0bfd1e1d5dd261
CRs-Fixed: 3299891
2022-12-09 07:32:52 -08:00
Vijay Raj
af28913edf qcacmn: Modify KEK and KCK length in WMI_GTK_OFFLOAD_CMDID for AKM24
In order to support AKM24, the max length of KCK is modified to
24 bytes and KEK max length is modified to 32 bytes for
cmd WMI_GTK_OFFLOAD_CMDID.

Change-Id: Ia504a1ce92c80793fc1302fdf03b8d93471d9322
CRs-Fixed: 3305317
2022-12-09 07:32:32 -08:00
Sai Pratyusha Magam
c87c0928b1 qcacmn: Add Keyix param for PN request to FW
Add Keyix param for PN request cmdid and event to FW
WMI_PEER_TX_PN_REQUEST_CMDID,
WMI_PEER_TX_PN_RESPONSE_EVENTID

Change-Id: I2803fdfaa20fae543cf0de34dd5c3f0966f2d605
CRs-Fixed: 3345914
2022-12-03 11:34:15 -08:00
Jeff Johnson
0906d287f3 qcacmn: Fix misspellings of "nonce"
In wlan_crypto_global_api.c there are several functions which use a
misspelled term for "nonce" so replace them with the correct spelling.

Change-Id: Iedc65bbad173c5fc398e25730853bc7b36e86b31
CRs-Fixed: 3313801
2022-10-18 16:30:45 -07:00
Jeff Johnson
ed240b1daf qcacmn: umac: cmn_services: Fix misspellings
Fix misspellings in umac/cmn_services/...

Change-Id: I74c006b3e585e3d4f6ec8c025ef313133c9e3068
CRs-Fixed: 3304695
2022-10-11 00:47:41 -07:00
Kani M
2cfc1273ba qcacmn: Fix for memleak in VLAN cases
During wlan_crypto_setkey, the mem_alloc for key is done and
all keyidx within WLAN_CRYPTO_MAX_VLANKEYIX are to freed in
crypto_free_key.

Change-Id: Ieae0f9f4eecabe1fb23812a9e436037bb4dad128
CRs-Fixed: 3296394
2022-09-30 07:49:17 -07:00
Abhishek Singh
3ec922f543 qcacmn: Avoid using igtk key index for Mcast WEP key
Use def_tx_keyid for Mcast wep key.
Also reset all the key index in wlan_crypto_free_key once igtk,
bigtk and Ucast/Mcast are freed, so that their values are not
carried to next connection.

Change-Id: I9a1e8715c54f47905889511f983b3127b9b5cfcd
CRs-Fixed: 3297270
2022-09-22 10:41:39 -07:00
abhinav kumar
93eb9ca13a qcacmn: For Adaptive 11R connection , choose the first AKM in RSNIE
Supplicant compares AKM(s) in RSN IE of Beacon/Probe response and
AKM on third EAPOL frame received by AP. In the case of multi AKM,
previously Host converts all adaptive 11r AKM(s), if any, present
in RSN IE of Beacon/Probe response to corresponding FT AKM but the
AP(s) which support adaptive 11r (ADAPTIVE_11R_OUI: 0x964000) only
converts first AKM to corresponding FT AKM and sends third EAPOL
frame to DUT. This results in failure in a 4-way handshake in
supplicant due to RSN IE miss-match between RSNIE sent by host
and RSNIE present in third EAPOL frame. Now like AP, the host is
converting only the first AKM to corresponding FT AKM to avoid
RSNIE mismatch in supplicant.

Change-Id: I522c6e313df50c1ef2952ec2e464a107ae739dad
CRs-Fixed: 3230622
2022-07-07 14:24:35 -07:00
Pragaspathi Thilagaraj
b7fa703306 qcacmn: Add support to send PASN commands
Add support to send below PASN commands:
WMI_RTT_PASN_AUTH_STATUS_CMD
WMI_RTT_PASN_DEAUTH_CMD
WMI_VDEV_SET_LTF_KEY_SEED_CMDID

Change-Id: I5a50a634317d0a692feee5be5a36da22b4c5d713
CRs-Fixed: 3154530
2022-07-06 23:07:52 -07:00
Chaoli Zhou
6cd686dc0e qcacmn: Support setting wapi crypto for SAP mode
Support setting crypto prarameters from WAPI IE.

Change-Id: Iee0e42e692dd2d9c2c6d645defd858c3c29eb322
CRs-Fixed: 3213432
2022-06-10 18:58:35 -07:00
abhinav kumar
e7861fb758 qcacmn: Update pmk for roamed AP to pmk cache table
Assume AP1 and AP2 are SPMK APs. For SPMK AP(s), Host
should add an entry of an AP in PMK cache table like below in
two cases only:
Case 1. When DUT successfully associated with SPMK supported AP
            In this case host update “is_spmk_ap” flag in PMK
            table by parsing beacon of associated AP after
            successful connection.
Case 2. When DUT successfully roamed to SPMK supported AP
            In this case host update “is_spmk_ap” flag in PMK
            table by parsing roam sync indication event.

In case of connection with SPMK AP, Host selectively deletes PMK
entry for other SPMK supported AP(s) on basis of “is_spmk_ap”
flag and maintains only one entry for all SPMK AP(s). And host
sends the same single PMK in RSO for further roaming to SPMK AP.

Initially, DUT is connected with AP2. Then Disconnection happens with
AP2 due to NUD failure. After disconnection, the upper layer sends
flush PMK requests for AP1 and AP2. Host deletes old PMK entries for
both APs. Now upper layer sends a set PMK request for AP2. Host adds
AP2 entry in PMK cache table but host does not set "is_spmk_ap" flag
in PMK table for this entry as DUT is not connected to AP2. Now host
receives a connect request for AP1 from the upper layer. DUT
successfully associated with AP1 by performing full SAE authentication.
Host adds an entry for AP1 in the PMK cache table and sets "is_spmk_ap"
flag for AP1 but fails to delete the entry for other SPMK AP(s), here
AP2, from PMK cache table. This is because of "is_spmk_ap" flag is not
set for AP2. At this point of time below is the PMK cache table entry
for SPMK AP(s): The Host PMK cache table has two entries for two SPMK
APs.

   BSSID       PMK     is_spmk_ap flag
    AP2       PMK2           0
    AP1       PMK1           1

Now FW roams to AP2 using PMK1. Host process roam sync indication for
AP2 and updates "is_spmk_ap" flag for AP2 in the PMK cache table. As
Host has a stale entry for AP2 in the PMK cache table, Host sends AP2’s
PMK (here PMK2) in RSO command which firmware will use for further
roaming but roaming fails due to invalid PMK, as target SPMK AP expects
PMK1 in reassociation request.

To handle these scenarios, FW should send PMK info of roamed AP and
host override stale entry for roamed AP (if any) with roamed AP's PMK
in PMK cache table.

Change-Id: I3c6a49be065e4744e438c2762c103eb3095a2253
CRs-Fixed: 3168078
2022-04-20 11:49:22 -07:00
Pooventhiran G
1f04b5497c qcacmn: Retrieve cipher_type for IGTK/BIGTK keyix
For IGTK/BIGTK keyix, cipher table is not populated. Retrieve
cipher_type from key structure.

Change-Id: Ic61e66854f91317194ee90f64187fd2b787827b0
CRs-Fixed: 3163335
2022-04-05 03:42:25 -07:00
Pooventhiran G
f5e2da429b qcacmn: Add Get RxPN WMI to obtain Rx PN
Add WMI support to obtain Rx packet number of a non-bss peer.

Change-Id: I841c1869299ebf5eeb21ee6406426a964d2d7112
CRs-Fixed: 3150832
2022-03-16 19:34:14 -07:00
Wu Gao
ce53a6f23f qcacmn: Fix error of macro CLEAR_PARAM
CLEAR_PARAM failed to clear bit at bit position of "val". This change
correct to ((__param) &= (~(1 << (__val)))).

Change-Id: I20a9203592c0f48c3d2999985edd8ff81f55eb9d
CRs-Fixed: 3137825
2022-03-15 00:10:48 -07:00
Pooventhiran G
886ce189d0 qcacmn: Track PN failures with relevant stats
When validating MMIE, if PN error is found, track it using relevant
statistics. Defined WMI_HOST_RXERR_PN to flag such PN errors.

Change-Id: Icb1fe9a653f67611539b5cb463adfceadedae38e
2022-02-02 03:16:24 -08:00
Sai Pratyusha Magam
36f141c9a4 qcacmn: Pass key index from wlan_crypto_getkey function
Pass key index from wlan_crypto_getkey function

Change-Id: I3a09e67358f2bc30c0789489d2c0184c475c7776
2022-01-25 01:33:51 -08:00
Disha Das
d162a849f1 qcacmn: Allocate mmie mic of size 16
Issue: On receiving robust bcast mgmt frames, for mmie
mic validation, mic of length 8 could be allocated.
The encrypt function however, always writes mic of length
16 resulting in memory corruption issue.

Fix: Allocate mic of size 16 for wlan_crypto_is_mmie_valid().
This is also corresponding to mic buffer size of 16 in
wlan_crypto_add_mmie().

Change-Id: I870251c0ed4224a7a974dad86f2808af7148be95
CRs-Fixed: 3091165
2022-01-03 06:34:01 -08:00
Sai Pratyusha Magam
5d58a41518 qcacmn: Store default keyix in wlan_crypto_setkey for each peer
Store default keyix in crypto_priv for each peer.

Change-Id: Ieb77c390fddd667f99fd97c5ecdd4f3de61ae045
2021-12-30 03:23:17 -08:00
Sai Pratyusha Magam
fc5f47db1a qcacmn: Release peer only after key access for peer is completed
Release peer only after key access for peer is completed

Change-Id: I88948536605eb4afac82772428938e0aaecbc957
2021-12-28 07:43:23 -08:00
Disha Das
601e5975d1 qcacmn: Fix for concurrency issues in wlan_crypto_getkey
Adding changes to call getpn after checking if key is valid,
and releasing the peer reference.

Change-Id: I8821407472db2b7008ad8226e754077a601d325e
2021-12-27 18:33:59 -08:00
Krishna Rao
0d7d011c82 qcacmn: Move basic 802.11 definitions from crypto to common
Move basic IEEE 802.11 field definitions that are not specific to
cryptographic functionality, from a cryptography related header file
to a common header file for IEEE 802.11 definitions so that these can
be used by other 802.11 protocol processing modules. The crypto header
file already includes the common header file, so there is no effective
change in code visibility of the definitions for crypto code.

Change-Id: I439fe818a457cc7694fdb431f5d2c1a7552f2caa
CRs-Fixed: 3059572
2021-10-21 14:05:49 -07:00
Liangwei Dong
dffbb1b320 qcacmn: Fix SAE pmkid update issue
For SAE SAP, after full SAE authentication, only pmkid
will be sent down to driver, PMK len is zero.
Driver should accept the set pmksa without PMK.
Add check pmk length checking and if pmk len is zero,
driver allow the set pmksa.

Change-Id: Ic05dee4cce31233dbe6dfced05df54fe8972dd1f
CRs-Fixed: 3042899
2021-10-13 17:42:40 -07:00
Pragaspathi Thilagaraj
ce387c8fd3 qcacmn: Validate SSID first while fetching peer pmksa
Validate the SSID & cache ID if SSID length is present in the
pmksa entry, as in FILS case only SSID and cache id are filled
and BSSID is not filled.

So validate the BSSID only if the SSID is not present.

Change-Id: Ia0a31f953869f00495fad597bb564ec706425312
CRs-Fixed: 3051530
2021-10-08 23:15:58 -07:00
Sai Pratyusha Magam
ce2fc16440 qcacmn: Add additional packet type check in wlan_crypto_get_keyid function
Add additional packet type check in wlan_crypto_get_keyid function

Change-Id: Iee31a428a20c256797c1b460b835dbe31dc6f2e9
CRs-Fixed: 3040714
2021-09-27 15:44:45 -07:00
Shiva Sankar Gajula
d3b7b11795 qcacmn: Reset mgmt ciphers and key mgmt to 0 by default
The 11r roaming is not happening when PMF disabled STA is trying to
roam from PMF disabled AP to PMF optinally configured(ieee80211w=1)
AP which is due to candidate_list is not found because of mgmt
ciphers mismatch (the PMF disabled mgmt cipher is None(1<<17) and PMF
optional AP's mgmt cipher is CMAC(1<<6)) happening while comparing
security params and is due to mgmt cipher value is reset to None(17)
after STA connected to AP.

So, Added changes to reset the mgmt cipher value to zero. Also, added
changes to reset the keymgmt to 0 instead of None since this is
missing in earlier implementation.

Change-Id: I9f24a215011b4984937e98225bcb3975bc3f685f
2021-08-25 07:25:20 -07:00
Kani M
7438cab313 qcacmn: Fix for the order of ol_getpn
Ideally, the validation of keys have to be done before
ol_getpn() is called to make sure the correct keys are
fetched and to avoid default key values being set.
Earlier, the key validation was done after ol_getpn()
function was called. This change reorders the ol_getpn()
to be called after the key validation.

Change-Id: I5be95b66b19228e2e9d1bca808b294a6b9b01935
2021-07-26 03:46:48 -07:00
Yu Wang
dcd269c55a qcacmn: enhance crypto api to install key synchronously
Add parameter 'bool sync' for wlan_cfg80211_crypto_add_key()
to indicate whether or not to add key synchronously.
If it's set to true, wait until install key complete event
is received.

Change-Id: I9a69d486665fb3f65a5720ccfbfb638c09329418
CRs-Fixed: 2865832
2021-06-21 23:14:27 -07:00
Srinivas Dasari
1db04afdb1 qcacmn: Allow PMKID only entries also to pmksa cache
In SAP case, external authentication(offloaded SAE authentication
to userspace) status event carries only PMKID to allow/disallow
peers to do PMKID+open auth based connection once the peers are
already SAE authenticated.
A check is added on the PMK length with the below change,
change: Ic41c2044e70f8d375130ef9e0af9fe4b83027c26. It rejects the
PMKID update to the pmk cache if the PMK length is 0. It's not
allowing to cache PMKID derived as part of SAE authentication.

There is no need to cache the PMK in SAE case as it won't be
used internally by driver or won't even be sent to firmware.
So, don't add any check and allow PMKID only entries also to
facilitate PMK caching mechanism in SAE SAP.

Change-Id: Ibd72975e91d93af9665c392b4e7a708a5f9c336a
CRs-Fixed: 2967752
2021-06-18 11:07:45 -07:00
Abhishek Singh
e5a60db99c qcacmn: Removed unused API for open and WEP check
Removed unused API for open and WEP check, as the logic, to check
open and WEP mode is not valid. If required proper API can
be added later.

Change-Id: Ia57bc28d40a70c8bd3b908400126c9741080a5fd
CRs-Fixed: 2949965
2021-05-20 07:58:41 -07:00
Liangwei Dong
6291826a31 qcacmn: Fix group mgmt cipher error
The value of req->crypto.mgmt_ciphers is bit mask
of wlan_crypto_cipher_type, but the API
wlan_crypto_set_mgmtcipher expects the enum value of
wlan_crypto_cipher_type at present.
Fix by change wlan_crypto_set_mgmtcipher to use bit
mask of mgmt cipher type.

Change-Id: I2d262bbe3f47e41635097ef8ce5722a2baa38001
CRs-Fixed: 2946164
2021-05-19 19:32:55 -07:00
abhinav kumar
ecd3f845e7 qcacmn: Handle invalid or unsupported AKM/unicast cipher
AP sets multiple AKM suites in RSN information of beacon
or unicast probe response. In case if the invalid or
unsupported AKM/unicast cipher suite present in the AKM
suite list, the driver detects it as wrong RSN IE and
drops it. This results Device driver doesn't send
authentication to initiate a connection to that AP even
one or more than one valid AKM suites present in RSN IE.

Ideally, the driver should able to initiate connection if
at least one AKM/unicast cipher is valid and supported in
AKM suite list.

Change-Id: I8ed525e3945e4e437d15b496c80b1ad2aef4cb65
CRs-Fixed: 2948248
2021-05-19 14:38:05 -07:00
Kiran Kumar Lokere
eb4b6bf958 qcacmn: Update the security check mask for 6GHz AP
Update the security check mask value for 6GHz AP.

Change-Id: I8d9637a95c6191124372a7bdba119837e6553ed4
CRs-Fixed: 2930941
2021-04-28 16:42:04 -07:00
Shiva Sankar Gajula
4bdf46d8ed qcacmn: Access wlan_crypto_cipher structure if key->valid flag is set
Access wlan_crypto_cipher structure if the key and cipher_table's
are valid. Also, added changes to avoid dangling pointer accessing
after deleting key.

Change-Id: Ia9a5942c9597f03eb1707d149797f33760eeac21
2021-04-22 15:25:32 -07:00