Hi James,
On 8/5/21 11:59 AM, James Prestwood wrote:
This adds support in netdev_reassociate for SAE. An SAE auth
protocol is created rather than the connect command and from
here there is virtually no difference to a normal connection
attempt. The only differences are 'in_roam' is set as to
Did you mean 'in_reassoc' here?
ignore the inevitable disconnect event and PREV_BSSID is
appended to CMD_ASSOCIATE only for this new reassociation case.
---
src/netdev.c | 32 ++++++++++++++++++++++++--------
1 file changed, 24 insertions(+), 8 deletions(-)
Please rebase on top of git HEAD.
@@ -2716,6 +2719,11 @@ static void netdev_sae_tx_associate(void
*user_data)
l_genl_msg_append_attrv(msg, NL80211_ATTR_IE, iov, n_used);
+ /* If doing a non-FT Reassociation */
+ if (netdev->in_reassoc &&
!IE_AKM_IS_FT(netdev->handshake->akm_suite))
+ l_genl_msg_append_attr(msg, NL80211_ATTR_PREV_BSSID, 6,
+ netdev->prev_bssid);
+
Actually I added auth_proto::prev_bssid just recently with exactly this in mind.
if (!l_genl_family_send(nl80211, msg, netdev_assoc_cb, netdev,
NULL)) {
l_genl_msg_unref(msg);
netdev_connect_failed(netdev, NETDEV_RESULT_ASSOCIATION_FAILED,
@@ -3584,7 +3592,7 @@ int netdev_reassociate(struct netdev *netdev, struct scan_bss
*target_bss,
netdev_event_func_t event_filter,
netdev_connect_cb_t cb, void *user_data)
{
- struct l_genl_msg *cmd_connect;
+ struct l_genl_msg *cmd_connect = NULL;
struct netdev_handshake_state;
struct handshake_state *old_hs;
struct eapol_sm *sm = NULL, *old_sm;
@@ -3594,16 +3602,21 @@ int netdev_reassociate(struct netdev *netdev, struct scan_bss
*target_bss,
if (netdev_handshake_state_setup_connection_type(hs) < 0)
return -ENOTSUP;
- /* TODO: SoftMac SAE/FILS Re-Associations are not suppored yet */
- if (L_WARN_ON(IE_AKM_IS_SAE(hs->akm_suite) ||
- IE_AKM_IS_FILS(hs->akm_suite)))
+ /* TODO: SoftMac FILS Re-Associations are not suppored yet */
+ if (L_WARN_ON(IE_AKM_IS_FILS(hs->akm_suite)))
return -ENOTSUP;
- cmd_connect = netdev_build_cmd_connect(netdev, target_bss, hs,
+ if (IE_AKM_IS_SAE(hs->akm_suite))
+ netdev->ap = sae_sm_new(hs, netdev_sae_tx_authenticate,
+ netdev_sae_tx_associate,
+ netdev);
+ else {
+ cmd_connect = netdev_build_cmd_connect(netdev, target_bss, hs,
orig_bss->addr, NULL, 0);
This should be taking SAE offload into account, similar to netdev_connect path...
- if (is_rsn)
- sm = eapol_sm_new(hs);
+ if (is_rsn)
+ sm = eapol_sm_new(hs);
+ }
old_sm = netdev->sm;
old_hs = netdev->handshake;
Regards,
-Denis