]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Exclude PMK when sending NL80211_CMD_DEL_PMKSA explicitly
authorvamsi krishna <vamsin@codeaurora.org>
Wed, 13 Mar 2019 07:43:38 +0000 (13:13 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 13 Mar 2019 11:22:40 +0000 (13:22 +0200)
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 <jouni@codeaurora.org>
src/drivers/driver_nl80211.c

index 5cd4e9b5f5e7e3457343b1497119168b401a8fb9..9a58b81b7ec713fc33cd9939c89897a376371800 100644 (file)
@@ -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);