From b6ea764252f25be75d3e8bc3b1ccc7c613302232 Mon Sep 17 00:00:00 2001 From: Vidyullatha Kanchanapally Date: Tue, 13 Jun 2017 19:09:08 +0530 Subject: [PATCH] nl80211: Make KCK attribute optional in rekey data New AKM suites like FILS-SHA256 do not use KCK and hence KCK length can be zero. Add changes to include KCK attribute in rekey data only if the length is non-zero. Signed-off-by: Jouni Malinen --- src/drivers/driver_nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 87776401b..d18cdeb89 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -7755,7 +7755,7 @@ static void nl80211_set_rekey_info(void *priv, const u8 *kek, size_t kek_len, if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_REKEY_OFFLOAD)) || !(replay_nested = nla_nest_start(msg, NL80211_ATTR_REKEY_DATA)) || nla_put(msg, NL80211_REKEY_DATA_KEK, kek_len, kek) || - nla_put(msg, NL80211_REKEY_DATA_KCK, kck_len, kck) || + (kck_len && nla_put(msg, NL80211_REKEY_DATA_KCK, kck_len, kck)) || nla_put(msg, NL80211_REKEY_DATA_REPLAY_CTR, NL80211_REPLAY_CTR_LEN, replay_ctr)) { nl80211_nlmsg_clear(msg);