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

Commit 9c31fd63 authored by Javier Cardona's avatar Javier Cardona Committed by John W. Linville
Browse files

libertas: Reduce the WPA key installation time.

WPA requires that the PTK is installed immediately after the 4-way handshake
in order to properly decrypt the subsequent incoming EAPOL-GTK frame.  If the
PTK is not enabled by the time the EAPOL-GTK frame arrives, the frame is
dropped and the supplicant does not receive the group key.

This will happen with fast Access Points that send the EAPOL-GTK frame before
the suplicant has successfully installed and enabled the PTK.  To mitigate
this situation, this patch simplifies and accelerates the SIOCSIWENCODEEXT
execution.

This patch resolves OLPC ticket 7825 (http://dev.laptop.org/ticket/7825

)

Signed-off-by: default avatarJavier Cardona <javier@cozybit.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent bed7aac9
Loading
Loading
Loading
Loading
+13 −3
Original line number Original line Diff line number Diff line
@@ -30,6 +30,14 @@ static inline void lbs_postpone_association_work(struct lbs_private *priv)
	queue_delayed_work(priv->work_thread, &priv->assoc_work, HZ / 2);
	queue_delayed_work(priv->work_thread, &priv->assoc_work, HZ / 2);
}
}


static inline void lbs_do_association_work(struct lbs_private *priv)
{
	if (priv->surpriseremoved)
		return;
	cancel_delayed_work(&priv->assoc_work);
	queue_delayed_work(priv->work_thread, &priv->assoc_work, 0);
}

static inline void lbs_cancel_association_work(struct lbs_private *priv)
static inline void lbs_cancel_association_work(struct lbs_private *priv)
{
{
	cancel_delayed_work(&priv->assoc_work);
	cancel_delayed_work(&priv->assoc_work);
@@ -1585,12 +1593,14 @@ static int lbs_set_encodeext(struct net_device *dev,
			set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags);
			set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags);
		}
		}


		/* Only disable wep if necessary: can't waste time here. */
		if (priv->mac_control & CMD_ACT_MAC_WEP_ENABLE)
			disable_wep(assoc_req);
			disable_wep(assoc_req);
	}
	}


out:
out:
	if (ret == 0) {
	if (ret == 0) {  /* key installation is time critical: postpone not! */
		lbs_postpone_association_work(priv);
		lbs_do_association_work(priv);
	} else {
	} else {
		lbs_cancel_association_work(priv);
		lbs_cancel_association_work(priv);
	}
	}