qcacmn: Add wlan_crypto_is_key_valid check

Add wlan_crypto_is_key_valid to check if key
is valid.

Change-Id: Ica71f56f1739261fff425e793ec8c15d2523e8e7
Bu işleme şunda yer alıyor:
Disha Das
2019-07-26 10:49:12 +05:30
işlemeyi yapan: nshrivas
ebeveyn 9447e47cbb
işleme 07721fc036
2 değiştirilmiş dosya ile 44 ekleme ve 0 silme

Dosyayı Görüntüle

@@ -244,6 +244,20 @@ bool wlan_crypto_vdev_is_pmf_required(struct wlan_objmgr_vdev *vdev);
bool wlan_crypto_is_pmf_enabled(struct wlan_objmgr_vdev *vdev,
struct wlan_objmgr_peer *peer);
/**
* wlan_crypto_is_key_valid - called by mgmt txrx to check if key is valid
* @vdev: vdev
* @peer: peer
* @keyidx : key index
*
* This function gets called by mgmt txrx to check if key is valid
*
* Return: true or false
*/
bool wlan_crypto_is_key_valid(struct wlan_objmgr_vdev *vdev,
struct wlan_objmgr_peer *peer,
uint16_t keyidx);
/**
* wlan_crypto_add_mmie - called by mgmt txrx to add mmie in frame
* @vdev: vdev

Dosyayı Görüntüle

@@ -1724,6 +1724,36 @@ bool wlan_crypto_is_pmf_enabled(struct wlan_objmgr_vdev *vdev,
return false;
}
/**
* wlan_crypto_is_key_valid - called by mgmt txrx to check if key is valid
* @vdev: vdev
* @peer: peer
* @keyidx : key index
*
* This function gets called by mgmt txrx to check if key is valid
*
* Return: true or false
*/
bool wlan_crypto_is_key_valid(struct wlan_objmgr_vdev *vdev,
struct wlan_objmgr_peer *peer,
uint16_t keyidx)
{
struct wlan_crypto_key *key = NULL;
if (!vdev && !peer)
return false;
if (peer)
key = wlan_crypto_peer_getkey(peer, keyidx);
else if (vdev)
key = wlan_crypto_vdev_getkey(vdev, keyidx);
if ((key) && key->valid)
return true;
return false;
}
static void wlan_crypto_gmac_pn_swap(uint8_t *a, uint8_t *b)
{
a[0] = b[5];