Browse Source

qcacmn: Change keyix in wlan_crypto_getkey for athkey tool

wlan_crypto_getkey only gets key data for default index.
Athkey get with idx 0 retrieves default key else, it will
retrieve custom key data.

Change-Id: I3d1d412f7f024b4ed40590be9b74c6a7fcec0303
Nandha Kishore Easwaran 7 years ago
parent
commit
f6ddc0cd3e
1 changed files with 8 additions and 2 deletions
  1. 8 2
      umac/cmn_services/crypto/src/wlan_crypto_global_api.c

+ 8 - 2
umac/cmn_services/crypto/src/wlan_crypto_global_api.c

@@ -561,7 +561,10 @@ QDF_STATUS wlan_crypto_getkey(struct wlan_objmgr_vdev *vdev,
 			return QDF_STATUS_E_INVAL;
 		}
 
-		key = crypto_priv->key[crypto_priv->def_tx_keyid];
+		if (req_key->keyix == WLAN_CRYPTO_KEYIX_NONE)
+		       key = crypto_priv->key[crypto_priv->def_tx_keyid];
+		else
+		       key = crypto_priv->key[req_key->keyix];
 		if (!key)
 			return QDF_STATUS_E_INVAL;
 	} else {
@@ -585,7 +588,10 @@ QDF_STATUS wlan_crypto_getkey(struct wlan_objmgr_vdev *vdev,
 			return QDF_STATUS_E_INVAL;
 		}
 
-		key = crypto_priv->key[crypto_priv->def_tx_keyid];
+		if (req_key->keyix == WLAN_CRYPTO_KEYIX_NONE)
+		       key = crypto_priv->key[crypto_priv->def_tx_keyid];
+		else
+		       key = crypto_priv->key[req_key->keyix];
 		if (!key)
 			return QDF_STATUS_E_INVAL;
 	}