@@ -4110,9 +4110,12 @@ static uint8_t *wpakptr;
41104110static wpakey_t * wpak ;
41114111static eapauth_t * eapauth ;
41124112static uint16_t authlen ;
4113+ static uint64_t eaptimegap ;
41134114static pmkid_t * pmkid ;
41144115static uint8_t keyver ;
41154116static uint64_t rc ;
4117+ static uint64_t rcgap ;
4118+ static uint8_t mpfield ;
41164119
41174120eapolm1count ++ ;
41184121eapolmsgcount ++ ;
@@ -4235,6 +4238,39 @@ if(authlen >= (int)(WPAKEY_SIZE +PMKID_SIZE))
42354238for (zeiger = messagelist ; zeiger < messagelist + MESSAGELIST_MAX + 1 ; zeiger ++ )
42364239 {
42374240 if (zeiger -> timestamp == 0 ) break ;
4241+ if ((zeiger -> message & HS_M2 ) == HS_M2 )
4242+ {
4243+ if (memcmp (zeiger -> ap , macap , 6 ) != 0 ) continue ;
4244+ if (memcmp (zeiger -> client , macclient , 6 ) != 0 ) continue ;
4245+ if (zeiger -> rc >= rc ) rcgap = zeiger -> rc - rc ;
4246+ else rcgap = rc - zeiger -> rc ;
4247+ if (zeiger -> rc != myaktreplaycount )
4248+ {
4249+ if (rcgap > rcgapmax ) rcgapmax = rcgap ;
4250+ }
4251+ if (rcgap > ncvalue ) continue ;
4252+
4253+ if (eaptimestamp > zeiger -> timestamp ) eaptimegap = eaptimestamp - zeiger -> timestamp ;
4254+ else eaptimegap = zeiger -> timestamp - eaptimestamp ;
4255+ if ((authlen + EAPAUTH_SIZE ) <= EAPOL_AUTHLEN_MAX )
4256+ {
4257+ if (myaktreplaycount > 0 )
4258+ {
4259+ if (zeiger -> rc == myaktreplaycount ) continue ;
4260+ }
4261+ if (eaptimegap > eaptimegapmax ) eaptimegapmax = eaptimegap ;
4262+ if (eaptimegap <= eapoltimeoutvalue )
4263+ {
4264+ mpfield = ST_M12E2 ;
4265+ addhandshake (eaptimegap , rcgap , zeiger , messagelist + MESSAGELIST_MAX , keyver , mpfield );
4266+ if (donotcleanflag == true)
4267+ {
4268+ mpfield = ST_M12E2 ;
4269+ addhandshake (eaptimegap , rcgap , zeiger , messagelist + MESSAGELIST_MAX , keyver , mpfield );
4270+ }
4271+ }
4272+ }
4273+ }
42384274 if (((zeiger -> message & HS_M1 ) != HS_M1 ) && ((zeiger -> message & HS_M3 ) != HS_M3 )) continue ;
42394275 if (memcmp (zeiger -> ap , macap , 6 ) != 0 ) continue ;
42404276 if (memcmp (zeiger -> client , macclient , 6 ) != 0 ) continue ;
0 commit comments