Fix for a false replay detection when seq was initialized to zero and first packet...
authormtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Sun, 28 Oct 2007 20:40:04 +0000 (20:40 +0000)
committermtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Sun, 28 Oct 2007 20:40:04 +0000 (20:40 +0000)
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2794 0192ed92-7a03-0410-a25b-9323aeb14dbd

net80211/ieee80211_crypto_ccmp.c
net80211/ieee80211_crypto_tkip.c

index 34bfe2445b68c125801490edc603ffdb4d344cc6..361a99a00bc21239d954794d24262ee053b560bd 100644 (file)
@@ -267,7 +267,7 @@ ccmp_decap(struct ieee80211_key *k, struct sk_buff *skb, int hdrlen)
                tid = ((struct ieee80211_qosframe *)wh)->i_qos[0] & IEEE80211_QOS_TID;
        /* NB: assume IEEE80211_WEP_MINLEN covers the extended IV */
        pn = READ_6(ivp[0], ivp[1], ivp[4], ivp[5], ivp[6], ivp[7]);
-       if (pn <= k->wk_keyrsc[tid]) {
+       if (pn && pn <= k->wk_keyrsc[tid]) {
                /*
                 * Replay violation.
                 */
index d4318bb018d3240fa98b5b1aa65a8514aaaa0ec2..2aedcb3f5d51b060e17ca84fa51b669c43fb9e20 100644 (file)
@@ -297,7 +297,7 @@ tkip_decap(struct ieee80211_key *k, struct sk_buff *skb, int hdrlen)
                tid = ((struct ieee80211_qosframe *)wh)->i_qos[0] & IEEE80211_QOS_TID;
 
        ctx->rx_rsc = READ_6(ivp[2], ivp[0], ivp[4], ivp[5], ivp[6], ivp[7]);
-       if (ctx->rx_rsc <= k->wk_keyrsc[tid]) {
+       if (ctx->rx_rsc && ctx->rx_rsc <= k->wk_keyrsc[tid]) {
                /*
                 * Replay violation; notify upper layer.
                 */