From: cinap_lenrek Date: Sat, 9 Mar 2013 17:12:49 +0000 (+0100) Subject: aux/wpa: check reply counter only after mic check X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=b6581f21e59e0a9575a46166dd7d95136fb4340e;p=plan9front.git aux/wpa: check reply counter only after mic check --- diff --git a/sys/src/cmd/aux/wpa.c b/sys/src/cmd/aux/wpa.c index c918ad54f..2f0442156 100644 --- a/sys/src/cmd/aux/wpa.c +++ b/sys/src/cmd/aux/wpa.c @@ -368,18 +368,6 @@ main(int argc, char *argv[]) (uvlong)kd->rsc[4]<<32 | (uvlong)kd->rsc[5]<<40; - repc = (uvlong)kd->repc[7] | - (uvlong)kd->repc[6]<<8 | - (uvlong)kd->repc[5]<<16 | - (uvlong)kd->repc[4]<<24 | - (uvlong)kd->repc[3]<<32 | - (uvlong)kd->repc[2]<<40 | - (uvlong)kd->repc[1]<<48 | - (uvlong)kd->repc[0]<<56; - - if(repc <= lastrepc) - continue; - if((flags & Fmic) == 0){ if((flags & (Fptk|Fack)) != (Fptk|Fack)) continue; @@ -404,6 +392,16 @@ main(int argc, char *argv[]) if(memcmp(tmp, mic, sizeof(mic)) != 0) continue; + repc = (uvlong)kd->repc[7] | + (uvlong)kd->repc[6]<<8 | + (uvlong)kd->repc[5]<<16 | + (uvlong)kd->repc[4]<<24 | + (uvlong)kd->repc[3]<<32 | + (uvlong)kd->repc[2]<<40 | + (uvlong)kd->repc[1]<<48 | + (uvlong)kd->repc[0]<<56; + if(repc <= lastrepc) + continue; lastrepc = repc; if((flags & (Fptk|Fsec|Fack)) == (Fptk|Fack)){