Commit Graph

109 Commits

Author SHA1 Message Date
Amruta Kulkarni
0f0a36c8d4 qcacmn: Change info/err prints to debug in roaming path
The printk buffer is protected by a global raw spinlock for readers
and writers. This restricts the contexts that are allowed to
access the buffer. So large latencies exists when printing to
kmsg done with QDF trace levels WARN, INFO, ERROR. This results
in roaming KPI for maximum transition time exceeding the expected
100ms.
So change info/err prints to debug prints in roaming path
to reduce delays in roaming time.

Change-Id: I9cdf043da6e88d735ab39812e74ed24784ceede3
CRs-Fixed: 2594867
2020-01-08 20:11:15 -08:00
Disha Das
cde63cdd01 qcacmn: Obtain current PN number for a peer
On rekey, the STA resets it’s PN to 0 but, the
AP sends out pending traffic with old PN values
before it resets the PN as well.
This causes traffic to stall and hence, TSC (transmit
sequence counter) should not be set to zero during rekey.

Instead, obtain last PN number for a non-bss peer while
configuring new key and pass the values to hostap.

Change-Id: I4a604f23944c941c6ade2f57ab03781bc78f7b40
2019-12-18 09:24:44 -08:00
Pooventhiran G
9a1b59247c qcacmn: Reset keys to zero after use
In functions that use key values, reset the local variables (key) to
zero after use to avoid security vulnerability.

Change-Id: I105b1abf7c707102ef99bbe4fa213708039d933e
CRs-fixed: 2581402
2019-12-09 18:57:51 -08:00
Disha Das
bcb1f1738f qcacmn: Replace return value 0 with QDF_STATUS_SUCCESS
Replace return value 0 with QDF_STATUS_SUCCESS as
per coding standards.

Change-Id: I27104d4a9eed29a7008b8970cf78c2ecd097b996
2019-12-06 08:41:10 -08:00
Ashok Kumar
39c0fea7c7 qcacmn: Prevent FILS delkey from calling CRYPTO_OPS
Prevent delkey to call crypto_ops for FILS cipher
type, as this keys are not present in FW.

Change-Id: Ica13a62b6822ee3cee40acffa98b7cc1cb122120
CRs-Fixed: 2520517
2019-09-10 09:04:06 -07:00
Bala Venkatesh
ae946e39c7 qcacmn: Reduce the log level
Reduce the log level from err or info to debug so that logs
are not printed on console.

Change-Id: I0d33c2a8f5b4bb4974656ac0d1eb6713a74cb5f4
CRs-Fixed: 2516287
2019-08-29 01:44:16 -07:00
Disha Das
07721fc036 qcacmn: Add wlan_crypto_is_key_valid check
Add wlan_crypto_is_key_valid to check if key
is valid.

Change-Id: Ica71f56f1739261fff425e793ec8c15d2523e8e7
2019-08-19 06:19:30 -07:00
Gurumoorthi Gnanasambandhan
17d1e0f676 qcacmn: Support group key installation for VLAN
VLAN group keyix is greater than WLAN_CRYPTO_MAXKEYIDX
Each VLAN will have separate group key in single VAP.

CRs-Fixed: 2490599
Change-Id: I585b2deaa13da337c5df7b55ec8e4672221e4edb
2019-08-06 10:31:40 -07:00
Ashok Kumar
cff882eb52 qcacmn: Add support for FT SUITEB
Added support for FT suiteB

Change-Id: I54e89afaecbe0ecabb028de6963b55441b5a369e
CRs-Fixed: 2468754
2019-06-20 23:29:41 -07:00
sheenam monga
d74e1fdc5f qcacmn: Fix bss peer use after free in stats
wlan_vdev_get_bsspeer() return bss peer without taking the ref count
of the peer and thus if peer is deleted after wlan_vdev_get_bsspeer()
returns a valid peer, the caller will have stale entry of the peer.
Stale entry of peer can lead to Assert.

Use wlan_objmgr_vdev_try_get_bsspeer API for stats to get the BSS
peer which increment the refcount if peer is valid. With this the
peer won't be deleted till the caller release the ref count of the
peer.

Change-Id: I3690f1309cbc7643ed55d8e903814b06f9d8755f
CRs-Fixed: 2454080
2019-05-23 09:31:06 -07:00
sheenam monga
1273bcec05 qcacmn: Fix bss peer use after free in crypto
wlan_vdev_get_bsspeer() return bss peer without taking the ref count
of the peer and thus if peer is deleted after wlan_vdev_get_bsspeer()
returns a valid peer, the caller will have stale entry of the peer.
Stale entry of peer can lead to Assert.

Use wlan_objmgr_vdev_try_get_bsspeer API for crypto to get the BSS
peer which increment the refcount if peer is valid. With this the
peer won't be deleted till the caller release the ref count of the
peer.

Change-Id: I5472c80d267a6639acaff2d47dbc09e37963bc93
CRs-Fixed: 2447249
2019-05-21 13:14:32 -07:00
Rohan Dutta
613f7920c7 qcacmn: For PMF return the igtk key in getkey call
Hostapd requests igtk keys with keyix 4,5.
Adding support to wlan_crypto_getkey to send the igtk keys
for keyix 4,5. In absence of the patch, hostapd getkey
call for igtk keys will fail.

Change-Id: I32cd6b417aae92cf3b3ac17bb72e19b581d21bd6
2019-04-12 08:08:12 -07:00
Min Liu
a3bad2b70e qcacmn: Reject STA with PMF disabled only when PMF is required
In wlan_crypto_rsn_info, only need to reject STA with PMF disabled
when PMF is required.

Change-Id: I7a7d4b2d1a2d44a95d08eb6bfac14540940f0be3
CRs-Fixed: 2424932
2019-04-08 10:50:10 -07:00
Min Liu
bc3bde34bf qcacmn: Add AP mode support for PMKSA
Currently only STA mode is supported in wlan_crypto_set_del_pmksa.
For SAE SAP, need to add AP mode support in this API.

Change-Id: If45a516713e302b3516d163516263bbcbafeaed2
CRs-Fixed: 2424893
2019-04-08 10:50:06 -07:00
Liangwei Dong
51cff6d6e0 qcacmn: Add API for get mgmt cipher
MCL code will need to find the supported mgmt cipher
type from crypto component. Add two api for vdev and
peer for it.

Change-Id: Ic33d4f18a04b48ce4699617569585fd1c2ae6f61
CRs-Fixed: 2421463
2019-04-06 01:54:47 -07:00
Liangwei Dong
ca4abcf92f qcacmn: Add PMK field to pmkid cache
In roaming offload, PMK will be sent to firmware.
So,save the PMK to pmkcache when supplicant provide
from os interface.

Change-Id: Ibfd3d354b9150b40755ba2ab1dd90c2e3c6ddbc3
CRs-Fixed: 2420359
2019-04-04 08:51:38 -07:00
Jeff Johnson
f3a2b8918c qcacmn: crypto: Replace explicit comparison to NULL
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within umac crypto replace any such comparisons with
logical operations performed on the pointer itself.

Change-Id: Id6edc4aa8bf0fef455c1359dacabd74fc7163e44
CRs-Fixed: 2418253
2019-03-28 16:50:36 -07:00
Madhvapathi Sriram
b73fc282d8 qcacmn: Remove error log for qdf_mem_malloc in umac files
qdf layer already has the error trace

Change-Id: I2ea22fe0e3e59b9d41ac21142615ffb96227abaf
CRs-Fixed: 2376418
2019-03-04 07:30:21 -08:00
Varun Reddy Yeturu
09a3b065f9 qcacmn: Fix WEP functionality in converged set key
Fix WEP security mode issues in converged set key.

Change-Id: Idd4071c8aef141cb45db9006c5773a94b352879a
CRs-Fixed: 2400864
2019-03-03 22:25:23 -08:00
Gurumoorthi Gnanasambandhan
612a906f4e qcacmn: Initialize keydata with 0 in delkey
delkey is using the existing keydata instead of memeset to 0

CR Fixed: 2393644
Change-Id: I7ee6718647d27d31e302e670e2bf12ce0fcdec8e
2019-02-18 05:00:24 -08:00
Arif Hussain
20a228a631 qcacmn: Add BKID only for sta mode
BKID is part of only assosciation and reassociation
request frames, So include it only for sta mode.

Change-Id: Ic43e20b46154a957a7290cdcc70615247949cba7
CRs-Fixed: 2398256
2019-02-14 21:29:29 -08:00
Ashok Kumar
1b91304c4c qcacmn: use bool instead of uint8_t
Replace uint8_t type with bool where only
variable is used for set true or false.

Change-Id: I04592bfc4d0d4b19c67cedafd3b8cb625544cd18
2019-02-12 08:45:15 -08:00
Kiran Kumar Lokere
b4d634fbf2 qcacmn: Fix compilation issue with crypto set key
Fix compilation issue with crypto set key feature.

Change-Id: I82d8220a9fea1f9e48338baa74307c124c98e784
CRs-Fixed: 2381329
2019-02-08 15:40:27 -08:00
Shiva Sankar Gajula
9d76260ac9 qcacmn: Fix the KW issue by increasing Max cipher types by 1
Increase the max cipher types by 1 to access WLAN_CRYPTO_CIPHER_NONE
crypto ops.

Change-Id: I7bfa7e9df73dfe7f8836880bfa0e3934e05f0522
2019-02-06 17:12:49 -08:00
Ashok Kumar
509aeeb4b5 qcacmn: Fix warning in crypto
Fix warning for uninitialized variable

Change-Id: I7ac7b96d7097ec74264926bdf321f9d406681271
CRs-Fixed: 2363632
2019-01-20 23:26:29 -08:00
Ashok Kumar
6f8b924d64 qcacmn: Add support for pmksa handling
Added support for pmksa handling in crypto to
support add_pmksa, del_pmksa and
flush_pmksa function calls from cfg80211.
Added support for adding pmkid in rsnie.

Change-Id: Ic8add9635c2e7fd73da21b1305467e6500f6d73c
CRs-Fixed: 2363632
2019-01-17 22:20:42 -08:00
Arif Hussain
c1e7877ff5 qcacmn: Add wapi bkid count in crypto module
Add wapi bkid count in crypto module.

Change-Id: Ia242eaefc24fde0fdd25c10e127e6b85f233ade3
CRs-Fixed: 2379886
2019-01-14 17:32:52 -08:00
Kiran Kumar Lokere
25531c4717 qcacmn: Add support for SET KEY convergence
Make changes to the cmn driver to support SET KEY
convergence feature

Change-Id: I17b5f368a1f735eb394ea70f9b61cc033c3eb20a
CRs-Fixed: 2358796
2019-01-08 18:21:17 -08:00
Rachit Kankane
6adabaf78a qcacmn: define FT_8021X and FT_PSK suites
Define WLAN_AKM_SUITE_FT_8021X and WLAN_AKM_SUITE_FT_PSK for kernel version
less then 4.14.

Change-Id: Id5518511bc4f639fff6d1e20bcf0aad973d9ab46
CRs-Fixed: 2362888
2018-12-26 07:47:50 -08:00
Disha Das
df10f65cb7 qcacmn: Move out Crypto files
Move only-win-specific crypto files from cmn_dev to
component dev

Change-Id: I55c2c44100d3a9c0799ccbafd2ce31aa242d3e71
2018-12-25 22:18:43 -08:00
Kiran Kumar Lokere
605e7a710b qcacmn: Add new crypto serivce apis for security checks
Add new crypto component service apis to check the security
match.

Change-Id: I66336c4924b2a2c203d6ba197ab649725f960ef8
CRs-Fixed: 2337195
2018-11-22 00:43:41 -08:00
Subrat Mishra
d95bfa449c qcacmn: Fix FILS IE parsing issue
Fix FILS IE parsing issue in assoc response frame.

Change-Id: I45b554c215280533ae6831d51526b8b98bc46c94
CRs-Fixed: 2329206
2018-10-09 12:37:37 -07:00
Rohan Dutta
0bdfabfecd qcacmn: Add support to check peer has mcast cipher
Add support to check if peer has MCAST cipher set

Change-Id: I9eb2983c33583b4af39d07a5793993a56b7d27ad
2018-10-03 05:10:56 -07:00
Hariharan Basuthkar
f8da572209 qcacmn: Print Optimization
Came up with changes to replace “qdf_print” with crypto_err/
crypto_debug/crypto_info implementing QDF_TRACE in crypto
component, to avoid flooding of error prints on the console.

Change-Id: I411efd78f808f7c893ece9096ebc429c8753fc82
CRs-Fixed: 2299590
2018-09-28 09:06:35 -07:00
Vignesh Mohan
9d1c7a223f qcacmn: cleanup crypto component prints
Updated error log from qdf_print to crypto_err/
crypto_debug/crypto_info implementing QDF_TRACE
for files in crypto to avoid console cluttering.

Change-Id: I1f7860373c505f4e1d80909662b6673f8263bdcd
CRs-Fixed: 2299591
2018-09-24 05:07:35 -07:00
Ashok Kumar Ponnaiah
ac40b6beda qcacmn: Add optional cabapilites in WPA ie
Add optional cabapilites in WPA ie.

Change-Id: I9be9e5f79837fe21a109d7e4c881023403297736
2018-09-18 11:10:18 -07:00
Harprit Chhabada
e166eb7b15 qcacmn: Add APIs to translate NL to crypto param
Add following APIs to translate NL param type to
crypto param type.

1.osif_nl_to_crypto_auth_type()
2.osif_nl_to_crypto_akm_type()
3.osif_nl_to_crypto_cipher_type()

Change-Id: Iba0d57e63db98cf81ed0ce5c0a79ae7f8239d1a9
CRs-Fixed: 2300761
2018-09-12 22:27:24 -07:00
Ashok Kumar Ponnaiah
6e0a63ce63 qcacmn: Correct keymgmt append order in rsnie
Correct keymgmt addition order in rsnie to match
with hostapd order of addition.
Added support to add new keymgmt values in rsnie.

Change-Id: Ib96ed6b3986f6dd45ab8f926e7a4e4415aed507d
CRs-Fixed: 2302389
2018-08-28 07:25:08 -07:00
Ashok Kumar Ponnaiah
d652f8ffde qcacmn: Correct the pairwaise cipher order in rsnie
Correct the pairwise cipher order in rsnie to match
hostapd ie generation order. as there difference in the order
cipher is added in rsnie between beacon/probe response generated
in driver and rsnie generated in hostapd, clients drop
this particular association.

Change-Id: I6bc5094a3ff03b013ab1672e8c028a1312eebd3b
CRs-Fixed: 2302389
2018-08-28 07:25:06 -07:00
Ashok Kumar Ponnaiah
17a6db2aa6 qcacmn: Correct parameter passed to cipher2cap function
Correct parameter passed to cipher2cap function.

Change-Id: Ib962c7d908eb0591c9e87ad5987938ad5f24ef93
CRs-Fixed: 2302379
2018-08-27 23:51:42 -07:00
Harprit Chhabada
6e8c57303b qcacmn: Add new wlan crypto params
Add new param types for wlan_crypto_auth_mode,
wlan_crypto_key_mgmt, wlan_crypto_cipher_type.
Need as part of convergence while converting
param type received from NL to crypto param type.

Change-Id: I0110990d9d2b4b24a87770ebce2b17312a2894fc
CRs-Fixed: 2258383
2018-08-27 18:35:53 -07:00
Aditya Sathish
f78a3d8ca5 qcacmn: Clean up spectral, tif and umac component prints
Clean up spectral, tif and umac component prints by correcting trace
levels for regularly occurring prints and removing newlines from
converged print APIs since qdf_trace_msg appends them by default.

Change-Id: Ib10f1b1c54ecbcb9f4076be7c2c4708359d488e0
CRs-Fixed: 2243843
2018-08-10 18:11:18 -07:00
Ashok Kumar Ponnaiah
07a8aa0379 qcacmn: Added extra check to prevent buffer overflow
Added extra check to prevent buffer overflow pointed out
by static code analyzer tool.

Change-Id: Ieeb3e89089b63eac3dc210447d7ec8e964cd52c9
CRs-Fixed: 2285486
2018-08-02 15:00:33 -07:00
Varun Reddy Yeturu
7174208352 qcacmn: Add feature flags to crypto component
Add below featurization flags to crypto component:
WLAN_CRYPTO_WEP_OS_DERIVATIVE
WLAN_CRYPTO_TKIP_OS_DERIVATIVE
WLAN_CRYPTO_CCMP_OS_DERIVATIVE
WLAN_CRYPTO_GCMP_OS_DERIVATIVE
WLAN_CRYPTO_WAPI_OS_DERIVATIVE
WLAN_CRYPTO_GCM_OS_DERIVATIVE
WLAN_CRYPTO_FILS_OS_DERIVATIVE

Remove the below unused functions:
wlan_crypto_psoc_obj_create_handler()
wlan_crypto_psoc_obj_destroy_handler()
wlan_crypto_pdev_obj_destroy_handler()

Change-Id: Ie2a9a4ca240773dc0d32aa6884b21ee08244829c
CRs-Fixed: 2269826
2018-07-30 16:34:14 -07:00
Subrat Mishra
4493d2d605 qcacmn: Allow FILS decap for (Re)Assoc frame
Allow FILS decap for (Re)Association request/response frame
by returning keyid as 0.

Change-Id: Icdf6d325eeccda36eeaf5a5635fcf9cf361d1028
CRs-Fixed: 2217523
2018-06-28 17:50:02 -07:00
Ashok Ponnaiah
09ec6f98d0 qcacmn: Fix key_mgmt datatype
key_mgmt was using uint16 datatype and used
to hold more than it's size.
increased its data size to uint32 address this
issue.

Change-Id: I88a4550bff2e0543700ba1470df3340e7020b7f0
CR-Fixed: 2254883
2018-06-23 18:03:19 -07:00
Ashok Ponnaiah
513c8ead13 qcacmn: Init crypto params with default value
Crypto params are not initalized with default values.
Crypto params initalized with default value during vdev
and peer creation.

Change-Id: I8adacc8b2770e3518bfbfe2da2eb3f6e0d9a5586
Crs-Fixed: 2251816
2018-06-18 16:33:42 -07:00
Padma Raghunathan
43ebaa7182 qcacmn: [CRYPTO] Fix encap/decap issues in TKIP/WEP
1. Fetch keyid from pkt during TKIP demic
2. Support to restore keys in h/w keycache, when h/w reset takes place

Change-Id: Icc4039a6cf6b89bd3ec3a874b698445382aff024
CRs-Fixed: 2233228
2018-05-24 13:32:38 -07:00
Padma Raghunathan
51d1103376 qcacmn: [CRYPTO] Add apis to access key information
APIs to retrieve following based on cipher type -
1. Header length
2. Trailer length
3. Miclen

Change-Id: Ia9c3a8d6a1459e637af80fcf73077e2d6b5f310c
CRs-Fixed: 2233228
2018-05-24 13:32:36 -07:00
Padma Raghunathan
6ac6143190 qcacmn: [CRYPTO] Support word-aligned 802.11 headers
Some chipsets using Direct-attach architecture need the 802.11 header
padded to a 32-bit boundary for 4-address and QoS frames.

Change-Id: Id29c114b2246cbb1230c9b22f4d04c070069d569
CRs-Fixed: 2233228
2018-05-24 13:32:33 -07:00