From c6ec9759c53c4a889adfb5f803d2cd7c0409a4b4 Mon Sep 17 00:00:00 2001 From: vamsi krishna Date: Wed, 13 Mar 2019 13:13:38 +0530 Subject: [PATCH] nl80211: Exclude PMK when sending NL80211_CMD_DEL_PMKSA explicitly Add a check in nl80211 driver layer to not include PMK while sending NL80211_CMD_DEL_PMKSA explicitly. Though it is taken care already in supplicant layer by setting the pmk_len to zero, it would be good to have a check in nl80211 layer in order to avoid future accidental inclusions of keying material in commands that do not need them. Signed-off-by: Jouni Malinen --- src/drivers/driver_nl80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 5cd4e9b5f..9a58b81b7 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -7927,7 +7927,8 @@ static int nl80211_pmkid(struct i802_bss *bss, int cmd, (params->fils_cache_id && nla_put(msg, NL80211_ATTR_FILS_CACHE_ID, 2, params->fils_cache_id)) || - (params->pmk_len && params->pmk_len <= PMK_MAX_LEN && + (cmd != NL80211_CMD_DEL_PMKSA && + params->pmk_len && params->pmk_len <= PMK_MAX_LEN && nla_put(msg, NL80211_ATTR_PMK, params->pmk_len, params->pmk))) { nl80211_nlmsg_clear(msg); nlmsg_free(msg);