From bcd09fce4832c5caa1eac0c9ebc9def8698c66fa Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Thu, 11 Oct 2018 18:17:19 -0700 Subject: [PATCH] qcacld-3.0: Initialize the PN and plumb it to DP Initialize the PN with value, which has been given by upper layer and plumb it to DP Change-Id: If6b14d2b9b92e4571a85cb20dc445608d5f56961 CRs-Fixed: 2350950 --- core/wma/src/wma_mgmt.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index 02ffbb5a1ab4..380df96e2deb 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -2023,7 +2023,31 @@ static QDF_STATUS wma_setup_install_key_cmd(tp_wma_handle wma_handle, key_params->def_key_idx); WMA_LOGD("keyrsc param %llu", *(params.key_rsc_counter)); - /* Set PN check & security type in data path */ + /* + * To prevent from any replay-attack, PN number provided by + * upper layer is used. + * + * Plumb the PN number to HW which will be used to evaluate whether + * incoming traffic is not replayed. + * + * supplicant would have some thing like following, example: + * + * num = 0x123456789ABCDEFF (64 bit number) + * uint8_t keyrsc[16] would look like following + * + * bit 0 7 15 23 31 39 47 55 63 + * +------+-------+-------+-------+-------+-------+-------+-------+ + * byte | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | + * +------+-------+-------+-------+-------+-------+-------+-------+ + * value| 0xFF | 0XDE | 0xBC | 0x9A | 0x78 | 0x56 | 0x34 | 0x12 | + * +------+-------+-------+-------+-------+-------+-------+-------+ + */ + qdf_mem_copy(&pn[0], + &key_params->key_rsc[0], sizeof(pn)); + wma_debug("key_type[%s] pn[%x:%x:%x:%x]", + (key_params->unicast) ? "unicast" : "group", + key_params->key_rsc[3], key_params->key_rsc[2], + key_params->key_rsc[1], key_params->key_rsc[0]); cdp_set_pn_check(soc, txrx_vdev, peer, sec_type, pn); cdp_set_key(soc, peer, key_params->unicast, (uint32_t *)(key_params->key_data +