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
This commit is contained in:
Pooventhiran G 2019-11-16 18:59:43 +05:30 • committed by nshrivas
commit 9a1b59247c
2 changed files with 5 additions and 0 deletions

View file

@ -220,6 +220,8 @@ QDF_STATUS target_if_crypto_set_key(struct wlan_objmgr_vdev *vdev,
&params.key_rsc_ctr, sizeof(uint64_t));
status = wmi_unified_setup_install_key_cmd(pdev_wmi_handle, &params);
/* Zero-out local key variables */
qdf_mem_zero(&params, sizeof(struct set_key_params));
return status;
}

View file

@ -1104,6 +1104,9 @@ QDF_STATUS wlan_crypto_delkey(struct wlan_objmgr_vdev *vdev,
qdf_mem_free(key->private);
}
}
/* Zero-out local key variables */
qdf_mem_zero(key, sizeof(struct wlan_crypto_key));
qdf_mem_free(key);
return QDF_STATUS_SUCCESS;