linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* External Auth FILS Authentication
       [not found]     ` <20230628045628epcms5p5b1820343f828e3229035d6313fe735ce@epcms5p5>
@ 2023-07-03  8:26       ` Kavitha Velayutham
  2023-07-19 10:55         ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Kavitha Velayutham @ 2023-07-03  8:26 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org, johannes@sipsolutions.net; +Cc: Pragya Gupta

Author: Kavitha Velayutham <k.velayutham@samsung.com>
Date:   Thu Jun 22 23:48:11 2023 +0530
 
    [Patch 1/1] changes for FILS Authentication for External Auth
    
    For Auth to be handled by supplicant when sme is in lower layers for FILS Authentication and
    to send Assoc params to the  Lower layers.
    
    Signed-off-by: Kavitha Velayutham <k.velayutham@samsung.com>
 
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
old mode 100644
new mode 100755
index 9e04f69712b1..ac61d326f0f3
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3467,6 +3467,16 @@ struct cfg80211_update_ft_ies_params {
         size_t ie_len;
 };
 
+#ifdef CONFIG_SCSC_WLAN_OCE
+struct cfg80211_external_fils_assoc_params {
+        const u8 *fils_kek;
+        size_t fils_kek_len;
+        const u8 *ie;
+        size_t ie_len;
+        const u8 *fils_nonces;
+        size_t fils_nonces_len;
+};
+#endif
 /**
  * struct cfg80211_mgmt_tx_params - mgmt tx parameters
  *
@@ -4626,6 +4636,10 @@ struct cfg80211_ops {
                                 struct net_device *dev);
         int        (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev,
                                  struct cfg80211_update_ft_ies_params *ftie);
+#ifdef CONFIG_SCSC_WLAN_OCE
+        int        (*set_fils_assoc_params)(struct wiphy *wiphy, struct net_device *dev,
+                                         struct cfg80211_external_fils_assoc_params *ftie);
+#endif
         int        (*crit_proto_start)(struct wiphy *wiphy,
                                     struct wireless_dev *wdev,
                                     enum nl80211_crit_proto_id protocol,
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
old mode 100644
new mode 100755
index c59fec406da5..6ef927c966d3
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1562,6 +1562,10 @@ enum nl80211_commands {
 
         NL80211_CMD_SET_HW_TIMESTAMP,
 
+        NL80211_CMD_SET_SAR_SPECS,
+
+        NL80211_CMD_FILS_ASSOC_REQ_INFO,
+
         /* add new commands above here */
 
         /* used to define NL80211_CMD_MAX below */
@@ -1581,6 +1585,7 @@ enum nl80211_commands {
 #define NL80211_CMD_DEAUTHENTICATE NL80211_CMD_DEAUTHENTICATE
 #define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE
 #define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT
+#define NL80211_CMD_FILS_ASSOC_REQ_INFO NL80211_CMD_FILS_ASSOC_REQ_INFO
 
 #define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
 
@@ -3302,6 +3307,14 @@ enum nl80211_attrs {
 
         NL80211_ATTR_DISABLE_HE,
 
+        NL80211_ATTR_FILS_ASSOC_IE,
+
+        NL80211_ATTR_RECONNECT_REQUESTED,
+
+        NL80211_ATTR_SAR_SPEC,
+
+        NL80211_ATTR_DISABLE_HE,
+
         NL80211_ATTR_OBSS_COLOR_BITMAP,
 
         NL80211_ATTR_COLOR_CHANGE_COUNT,
@@ -6443,7 +6456,7 @@ enum nl80211_ext_feature_index {
         NL80211_EXT_FEATURE_PUNCT,
         NL80211_EXT_FEATURE_SECURE_NAN,
         NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA,
-
+        NL80211_EXT_FEATURE_EXTERNAL_AUTH_FILS,
         /* add new features before the definition below */
         NUM_NL80211_EXT_FEATURES,
         MAX_NL80211_EXT_FEATURES = NUM_NL80211_EXT_FEATURES - 1
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
index f620acd2a0f5..cac4586e21e1 100644
--- a/net/wireless/Kconfig
+++ b/net/wireless/Kconfig
@@ -67,6 +67,11 @@ config CFG80211_DEVELOPER_WARNINGS
           Say Y only if you are developing cfg80211 or a driver based
           on it (or mac80211).
 
+config SCSC_WLAN_OCE
+        bool "OCE Auth Support with External Auth"
+        default y
+        help
+          This option enables external Auth Support for FILS Authentication
 
 config CFG80211_CERTIFICATION_ONUS
         bool "cfg80211 certification onus"
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
old mode 100644
new mode 100755
index d95f8053020d..b78236883b84
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -559,6 +559,11 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
         [NL80211_ATTR_IE] = NLA_POLICY_VALIDATE_FN(NLA_BINARY,
                                                    validate_ie_attr,
                                                    IEEE80211_MAX_DATA_LEN),
+#ifdef CONFIG_SCSC_WLAN_OCE
+        [NL80211_ATTR_FILS_ASSOC_IE] = NLA_POLICY_VALIDATE_FN(NLA_BINARY,
+                                                              validate_ie_attr,
+                                                              IEEE80211_MAX_DATA_LEN),
+#endif
         [NL80211_ATTR_SCAN_FREQUENCIES] = { .type = NLA_NESTED },
         [NL80211_ATTR_SCAN_SSIDS] = { .type = NLA_NESTED },
 
@@ -5844,10 +5849,11 @@ static bool nl80211_valid_auth_type(struct cfg80211_registered_device *rdev,
                 if (auth_type == NL80211_AUTHTYPE_FILS_SK_PFS ||
                     auth_type == NL80211_AUTHTYPE_FILS_PK)
                         return false;
-                if (!wiphy_ext_feature_isset(
-                            &rdev->wiphy,
-                            NL80211_EXT_FEATURE_FILS_SK_OFFLOAD) &&
-                    auth_type == NL80211_AUTHTYPE_FILS_SK)
+                if (!(wiphy_ext_feature_isset(&rdev->wiphy, NL80211_EXT_FEATURE_FILS_SK_OFFLOAD)
+#ifdef CONFIG_SCSC_WLAN_OCE
+                    || wiphy_ext_feature_isset(&rdev->wiphy, NL80211_EXT_FEATURE_EXTERNAL_AUTH_FILS)
+#endif
+                    ) && auth_type == NL80211_AUTHTYPE_FILS_SK)
                         return false;
                 return true;
         case NL80211_CMD_START_AP:
@@ -11929,9 +11935,11 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
                 }
         }
 
-        if (wiphy_ext_feature_isset(&rdev->wiphy,
-                                    NL80211_EXT_FEATURE_FILS_SK_OFFLOAD) &&
-            info->attrs[NL80211_ATTR_FILS_ERP_USERNAME] &&
+        if ((wiphy_ext_feature_isset(&rdev->wiphy, NL80211_EXT_FEATURE_FILS_SK_OFFLOAD)
+#ifdef CONFIG_SCSC_WLAN_OCE
+            || wiphy_ext_feature_isset(&rdev->wiphy, NL80211_EXT_FEATURE_EXTERNAL_AUTH_FILS)
+#endif
+            ) && info->attrs[NL80211_ATTR_FILS_ERP_USERNAME] &&
             info->attrs[NL80211_ATTR_FILS_ERP_REALM] &&
             info->attrs[NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM] &&
             info->attrs[NL80211_ATTR_FILS_ERP_RRK]) {
@@ -12013,8 +12021,8 @@ static int nl80211_update_connect_params(struct sk_buff *skb,
                 changed |= UPDATE_ASSOC_IES;
         }
 
-        fils_sk_offload = wiphy_ext_feature_isset(&rdev->wiphy,
-                                                  NL80211_EXT_FEATURE_FILS_SK_OFFLOAD);
+        fils_sk_offload = wiphy_ext_feature_isset(&rdev->wiphy, NL80211_EXT_FEATURE_FILS_SK_OFFLOAD) ||
+                          wiphy_ext_feature_isset(&rdev->wiphy, NL80211_EXT_FEATURE_EXTERNAL_AUTH_FILS);
 
         /*
          * when driver supports fils-sk offload all attributes must be
@@ -14789,6 +14797,33 @@ static int nl80211_update_ft_ies(struct sk_buff *skb, struct genl_info *info)
         return rdev_update_ft_ies(rdev, dev, &ft_params);
 }
 
+#ifdef CONFIG_SCSC_WLAN_OCE
+static int nl80211_fils_assoc_req_ies(struct sk_buff *skb, struct genl_info *info)
+{
+        struct cfg80211_registered_device *rdev = info->user_ptr[0];
+        struct cfg80211_external_fils_assoc_params fils_params;
+        struct net_device *dev = info->user_ptr[1];
+
+        if (!rdev->ops->set_fils_assoc_params)
+                return -EOPNOTSUPP;
+
+        if (!info->attrs[NL80211_ATTR_FILS_KEK] ||
+            !info->attrs[NL80211_ATTR_FILS_ASSOC_IE] ||
+            !info->attrs[NL80211_ATTR_FILS_NONCES])
+                return -EINVAL;
+
+        memset(&fils_params, 0, sizeof(fils_params));
+        fils_params.fils_kek = nla_data(info->attrs[NL80211_ATTR_FILS_KEK]);
+        fils_params.fils_kek_len = nla_len(info->attrs[NL80211_ATTR_FILS_KEK]);
+        fils_params.ie = nla_data(info->attrs[NL80211_ATTR_FILS_ASSOC_IE]);
+        fils_params.ie_len = nla_len(info->attrs[NL80211_ATTR_FILS_ASSOC_IE]);
+        fils_params.fils_nonces = nla_data(info->attrs[NL80211_ATTR_FILS_NONCES]);
+        fils_params.fils_nonces_len = nla_len(info->attrs[NL80211_ATTR_FILS_NONCES]);
+
+        return rdev_fils_assoc_req_ies(rdev, dev, &fils_params);
+}
+#endif
+
 static int nl80211_crit_protocol_start(struct sk_buff *skb,
                                        struct genl_info *info)
 {
@@ -16631,6 +16666,16 @@ static const struct genl_small_ops nl80211_small_ops[] = {
                 .doit = nl80211_set_wiphy,
                 .flags = GENL_UNS_ADMIN_PERM,
         },
+#ifdef CONFIG_SCSC_WLAN_OCE
+        {
+                .cmd = NL80211_CMD_FILS_ASSOC_REQ_INFO,
+                .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+                .doit = nl80211_fils_assoc_req_ies,
+                .flags = GENL_UNS_ADMIN_PERM,
+                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
+                                  NL80211_FLAG_NEED_RTNL,
+        },
+#endif
         {
                 .cmd = NL80211_CMD_GET_INTERFACE,
                 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
old mode 100644
new mode 100755
index 2e497cf26ef2..000d2019901d
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -1062,6 +1062,20 @@ static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev,
         return ret;
 }
 
+#ifdef CONFIG_SCSC_WLAN_OCE
+static inline int rdev_fils_assoc_req_ies(struct cfg80211_registered_device *rdev,
+                                          struct net_device *dev,
+                                          struct cfg80211_external_fils_assoc_params *params)
+{
+        int ret;
+
+        trace_rdev_fils_assoc_req_ies(&rdev->wiphy, dev, params);
+        ret = rdev->ops->set_fils_assoc_params(&rdev->wiphy, dev, params);
+        trace_rdev_return_int(&rdev->wiphy, ret);
+        return ret;
+}
+#endif
+
 static inline int rdev_crit_proto_start(struct cfg80211_registered_device *rdev,
                                         struct wireless_dev *wdev,
                                         enum nl80211_crit_proto_id protocol,
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
old mode 100644
new mode 100755
index 716a1fa70069..7c2877a7099b
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -2256,6 +2256,30 @@ TRACE_EVENT(rdev_update_ft_ies,
                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->md)
 );
 
+#ifdef CONFIG_SCSC_WLAN_OCE
+TRACE_EVENT(rdev_fils_assoc_req_ies,
+        TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
+                 struct cfg80211_external_fils_assoc_params *filsie),
+        TP_ARGS(wiphy, netdev, filsie),
+        TP_STRUCT__entry(
+                WIPHY_ENTRY
+                NETDEV_ENTRY
+                __dynamic_array(u8, kek, filsie->fils_kek_len)
+                __dynamic_array(u8, ie, filsie->ie_len)
+                __dynamic_array(u8, nonces, filsie->fils_nonces_len)
+        ),
+        TP_fast_assign(
+                WIPHY_ASSIGN;
+                NETDEV_ASSIGN;
+                memcpy(__get_dynamic_array(kek), filsie->fils_kek, filsie->fils_kek_len);
+                memcpy(__get_dynamic_array(ie), filsie->ie, filsie->ie_len);
+                memcpy(__get_dynamic_array(ie), filsie->fils_nonces, filsie->fils_nonces_len);
+        ),
+        TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ,
+                  WIPHY_PR_ARG, NETDEV_PR_ARG)
+);
+#endif
+
 TRACE_EVENT(rdev_crit_proto_start,
         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
                  enum nl80211_crit_proto_id protocol, u16 duration),
 


 




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: External Auth FILS Authentication
  2023-07-03  8:26       ` External Auth FILS Authentication Kavitha Velayutham
@ 2023-07-19 10:55         ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2023-07-19 10:55 UTC (permalink / raw)
  To: Kavitha Velayutham
  Cc: linux-wireless@vger.kernel.org, johannes@sipsolutions.net,
	Pragya Gupta

Kavitha Velayutham <k.velayutham@samsung.com> writes:

> Author: Kavitha Velayutham <k.velayutham@samsung.com>
> Date:   Thu Jun 22 23:48:11 2023 +0530.
>  .
>     [Patch 1/1] changes for FILS Authentication for External Auth.
>     .
>     For Auth to be handled by supplicant when sme is in lower layers for FILS Authentication and.
>     to send Assoc params to the  Lower layers..
>     .
>     Signed-off-by: Kavitha Velayutham <k.velayutham@samsung.com>.

This patch seems to be badly formatted, I see ^M control characters etc.
Please read the wiki documentation below and use git send-email to
submit patches.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-19 10:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230622103041epcms5p873a0f3404f38216c9802f6b299787d9d@epcms5p8>
     [not found] ` <202306221827.35MIRU0c2989147@administrator-PowerEdge-R740xd.sa.corp.samsungelectronics.net>
     [not found]   ` <CGME20230622102548epcas5p3e347215405116f1b64befe72ec99d567@epcms5p4>
     [not found]     ` <20230628045628epcms5p5b1820343f828e3229035d6313fe735ce@epcms5p5>
2023-07-03  8:26       ` External Auth FILS Authentication Kavitha Velayutham
2023-07-19 10:55         ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).