From: vamsi krishna Date: Wed, 13 Mar 2019 07:43:38 +0000 (+0530) Subject: nl80211: Exclude PMK when sending NL80211_CMD_DEL_PMKSA explicitly X-Git-Tag: hostap_2_8~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6ec9759c53c4a889adfb5f803d2cd7c0409a4b4;p=thirdparty%2Fhostap.git 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 --- 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);