Commit Graph

128 Commits

Author SHA1 Message Date
Abhishek Ambure
4d5fb39e3e qcacmn: Add support for ocv support in RSN capability
WLAN_CRYPTO_RSN_CAP_OCV_SUPPORTED i.e. 0x4000 bit in RSN capability
is set to 1 to indicate that the STA supports operating channel
validation by including Operating Channel Information (OCI) in RSNA
exchanges and validates the information when received from another
STA that indicated this capability.

Change-Id: I8cbe640772c95573461ef2ef54c9e86778fe970f
CRs-Fixed: 2765802
2020-08-31 03:32:38 -07:00
Rhythm Patwa
360f0419df qcacmn: Add support to handle frames with HT/VHT/HE control field
Add support to handle the case where the peer transmits a frame
with HT/VHT/HE control field included.

Change-Id: I2b0d04ffa12a983a6c22e0a0bcbdfffa8fd48dcb
CRs-fixed: 2754234
2020-08-25 14:09:23 -07:00
Pragaspathi Thilagaraj
0df12365ac qcacmn: Add FILS crypto API for rIK generation
Replace the lim_default_hmac_sha256_kdf() & lim_create_fils_rik()
API  with crypto API since both these API are primarily for
cryptographic derivation of re-authentication integrity key(rIK)

Use the new crypto APIs qdf_default_hmac_sha256_kdf(),
wlan_crypto_create_fils_rik() for this.

Change-Id: I1c8f38ee0124b8b3eb527d4b01d39add134e181b
CRs-Fixed: 2752635
2020-08-13 10:33:09 -07:00
Pragaspathi Thilagaraj
81b14a586e qcacmn: Add API to get FILS pmksa entry cache id and SSID
Add new API to lookup the pmksa entry by fils cache id
and SSID.

Change-Id: I654d2b29b97a3b02ab6da7d2cfa0884bb8e5d2a1
CRs-Fixed: 2719643
2020-07-07 21:38:43 -07:00
Ashish Kumar Dhanotiya
eba983ed1e qcacmn: Fix return type of auth type and akm
Currently api osif_nl_to_crypto_auth_type is trying to convert
the nl specific auth types to driver specific auth types but
it does not return the correct value, this api always returns
auth type as none as it never updates the return value after
the initialization.

While parsing WPA and WAPI, open authmode and cipher and akm are
set as none by default.

Thus return converted value of the auth type. Also fix the
return type of the akm conversion. Also avoid setting
open authmode and cipher and akm as none while parsing WPA
and WAPI ie.

Change-Id: I260e58a28ddbf6b20a290488e205586a624c9b46
CRs-Fixed: 2725323
2020-07-07 16:23:18 -07:00
Utkarsh Bhatnagar
0b2b5e9e78 qcacmn: Don't reset cipher_caps in crypto_reset_prarams
Remove cipher_caps from wlan_crypto_reset_prarams as it
is FW capability and should only be set once when vdev
is created.

Change-Id: I8beab7ead2217ead532bfaacc0eea133d90cdd0e
CRs-Fixed: 2716728
2020-06-24 15:04:44 -07:00
bings
5ecc1e1ae8 qcacmn: set key as valid after wlan_crypto_save_key
For wep mode, when key is received from cfg80211, wlan_crypto_save_key
is called to save the key, then wlan_crypto_default_key is called to
save default key id.
key should be valid when save default key id.

set key as valid after wlan_crypto_save_key

Change-Id: Ic13e311593154911ee21db5172188c7037f429a3
CRs-Fixed: 2654882
2020-06-18 23:22:04 -07:00
Abhinav Kumar
5839296d1d qcacmn: Fix mem leak while deleting pmksa
Due to commit : I83e8d4c0c8b3ad503aa5894ffdc4a14bc3aeec7a,
while processing set_del_pmk command driver checks pmk_len
to delete pmk. In case if new PMK gets added with 0 lengths,
pmk entry with pmk_len = 0 will never be deleted. It is only
overwritten without freeing due to incorrect logic set_del
pmk logic.

Fix is to modify set and del pmk logic to avoid mem leak.

Change-Id: Idff573d020940dd926d07e1ec4f146eaa1215686
CRs-Fixed: 2696207
2020-05-29 19:52:56 -07:00
Srikanth Marepalli
5c4527f338 qcacmn: Increase the PMKSA Cache entry size to 16 in host
Currently only atmost 3 PMK Cache entries are allowed in Host,
which is not equivalent to that of Firmware, as upto 16 max PMK
cache entries are allowed in Firmware.
This change is to support upto 16 PMKID entries in driver as well

Change-Id: I383ca79e284de4913197ca4afec317e8669edd86
CRs-Fixed: 2689482
2020-05-21 22:32:18 -07:00
Neha Bisht
4bda764146 qcacmn: remove dependency of public files from wlan_objmgr_psoc_obj.h
Remove dependency of wlan_lmac_if_def headerfiles from
wlan_objmgr_psoc_obj.h

Change-Id: Ibe2f22c4b4f22b15eef201d1a42844ccf2931fef
2020-05-15 10:41:50 -07:00
Vulupala Shashank Reddy
f3d1f2a4be qcacmn: Delete older PMK of all APs which have the same PMK
Currently when supplicant sends set_pmkid_cache (Either after
initial connection or after session timeout with AP) to host to
set the new pmkid derived after the EAP is done. Host deletes
PMK entry only if bssid/ssid matches.
For OKC, the PMK derived from the initially associated AP will
be used for deriving PMKID for all APs. In case of connection with OKC
supported APs, If STA receive session timeout from AP, HOST should
delete older PMK of all APs which have the same PMK. Else While
roaming HOST could send older PMK to OKC supported AP and this
results PMK flush in FW and leads to full EAP.

Change-Id: I83e8d4c0c8b3ad503aa5894ffdc4a14bc3aeec7a
CRs-Fixed: 2679749
2020-05-13 01:30:33 -07:00
Abhishek Singh
d96c0dbfbf qcacmn: In crypto use QDF api to calculate MIC for OS derivatives
For WLAN_CRYPTO_OMAC1_OS_DERIVATIVE and
WLAN_CRYPTO_GCM_OS_DERIVATIVE set use QDF API to calculate MIC

Change-Id: I5971eb39414a292534981753805df6d9beb54be0
CRs-Fixed: 2664275
2020-05-04 03:50:18 -07:00
Gurumoorthi Gnanasambandhan
4ed7012ed6 qcacmn: Fix IGTK key index
Fix IGTK key index for adding MIC IE in Broadcast packets.

CRs-Fixed: 2672548
Change-Id: I8605acc0f484909e29b258ccb82e3966e9481efb
2020-04-29 08:19:59 -07:00
Pragaspathi Thilagaraj
91be4be6de qcacmn: Introduce crypto API for single pmk AP cache management
Add new crypto API to set the single PMK AP flag in
crypto pmksa entry and to clear the BSSID entries in the
crypto pmk cache with the SAE single pmk flag set.

Clear the entries with Sae single pmk flag on connection
and roaming success case. Mark the BSS as Sae pmk capable
after initial connection and roaming if the AP advertises
the VSIE

Change-Id: I42ca0c3a70945f974eec1065661ac0b781096126
CRs-Fixed: 2652936
2020-04-19 07:01:16 -07:00
Abhishek Singh
aadc772e84 qcacmn: Add igtk def index and igtk key type in crypto
In wlan_crypto_save_key store igtk def index, bigtk def index and
igtk key type in crypto priv.

Change-Id: I96161a6dd376e7e80f88da00c891d15a5645cfa7
CRs-Fixed: 2661197
2020-04-11 12:40:32 -07:00
Gurumoorthi Gnanasambandhan
806b7c72df qcacmn: Beacon protection support
Changes to support Beacon protection. Additional key ix 6 and 7
support BIGTK. Update beacon template for Beacon protection support.

CRs-Fixed: 2632290
Change-Id: Ic37d17f5076bb28d2e1f2430da039cc8b9f759b6
2020-03-30 13:40:07 -07:00
Abhishek Singh
d9e7ba7cc6 qcacmn: Optimize logging in crypto module
Optimize logging in crypto module.

Change-Id: I4da7dfcaae81f9a6511bce5b422b5e81faa189ef
CRs-Fixed: 2635263
2020-03-05 14:02:14 -08:00
Nirav Shah
5ad9b66679 qcacmn: Disallow TKIP/WEP with HT supported client
As softap, send assoc failure if HT supported client try to associate
as WEP/TKIP pairwise key.

Change-Id: Ie33e5d83ec18e10aae51a4cc3515f754bd24774e
CRs-Fixed: 2623660
2020-02-26 20:47:06 -08:00
Liangwei Dong
5d64a83690 qcacmn: Add pmksa based on SSID and cache id
For FILS pmksa cache, the pmksa add/del/query is based on SSID
and cache id. The current crypto pmksa cache API dosn't support
SSID and cache ID.

1. Add SSID/Cache ID support to pmksa API
2. Add RSN IE pmkid field based on SSID/cache ID

Change-Id: I1577c6293b75d6f8e6210f314dd83462e06d8190
CRs-Fixed: 2621860
2020-02-26 06:42:56 -08:00
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