Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c80328e5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cfg80211: Key management offload support for 802.1X LEAP"

parents 31fa2d5f 0aead796
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2338,7 +2338,7 @@ struct cfg80211_ops {
				    struct cfg80211_chan_def *chandef);

	int	(*key_mgmt_set_pmk)(struct wiphy *wiphy, struct net_device *dev,
				    const u8 *pmk);
				    const u8 *pmk, size_t pmk_len);
};

/*
+2 −0
Original line number Diff line number Diff line
@@ -1570,6 +1570,7 @@ enum nl80211_commands {
 *	derivation used as part of key management offload.
 * @NL80211_ATTR_PMK: The Pairwise Master Key to be used for the
 *	connection.
 * @NL80211_ATTR_PMK_LEN: The length of the PMK.
 *
 * @NL80211_ATTR_MAX: highest attribute number currently defined
 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -1914,6 +1915,7 @@ enum nl80211_attrs {
	NL80211_ATTR_KEY_MGMT_OFFLOAD_SUPPORT,
	NL80211_ATTR_KEY_DERIVE_OFFLOAD_SUPPORT,
	NL80211_ATTR_PMK,
	NL80211_ATTR_PMK_LEN,

	/* add attributes here, update the policy in nl80211.c */

+7 −1
Original line number Diff line number Diff line
@@ -399,6 +399,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
	[NL80211_ATTR_KEY_DERIVE_OFFLOAD_SUPPORT] = { .type = NLA_U32 },
	[NL80211_ATTR_PMK] = { .type = NLA_BINARY,
				   .len = NL80211_KEY_LEN_PMK },
	[NL80211_ATTR_PMK_LEN] = { .type = NLA_U32 },
};

/* policy for the key attributes */
@@ -8702,16 +8703,21 @@ static int nl80211_key_mgmt_set_pmk(struct sk_buff *skb, struct genl_info *info)
	struct cfg80211_registered_device *rdev = info->user_ptr[0];
	struct net_device *dev = info->user_ptr[1];
	u8 *pmk;
	size_t pmk_len;

	if (info->attrs[NL80211_ATTR_PMK])
		pmk = nla_data(info->attrs[NL80211_ATTR_PMK]);
	else
		return -EINVAL;
	if (info->attrs[NL80211_ATTR_PMK_LEN])
		pmk_len = nla_get_u32(info->attrs[NL80211_ATTR_PMK_LEN]);
	else
		return -EINVAL;

	if (!rdev->ops->key_mgmt_set_pmk)
		return -EOPNOTSUPP;

	return rdev_key_mgmt_set_pmk(rdev, dev, pmk);
	return rdev_key_mgmt_set_pmk(rdev, dev, pmk, pmk_len);
}

#define NL80211_FLAG_NEED_WIPHY		0x01
+3 −2
Original line number Diff line number Diff line
@@ -954,12 +954,13 @@ rdev_set_ap_chanwidth(struct cfg80211_registered_device *rdev,
}

static inline int rdev_key_mgmt_set_pmk(struct cfg80211_registered_device *rdev,
				   struct net_device *dev, u8 *pmk)
				   struct net_device *dev, u8 *pmk,
				   size_t pmk_len)
{
	int ret;

	trace_rdev_key_mgmt_set_pmk(&rdev->wiphy, dev, pmk);
	ret = rdev->ops->key_mgmt_set_pmk(&rdev->wiphy, dev, pmk);
	ret = rdev->ops->key_mgmt_set_pmk(&rdev->wiphy, dev, pmk, pmk_len);
	trace_rdev_return_int(&rdev->wiphy, ret);

	return ret;