save M1 from PMKID attack vector only if authlen > 95
@@ -629,7 +629,7 @@ int c;
macmaclist_t *zeiger;
zeiger = pownedlist;
-for(c = 0; c < POWNEDLIST_MAX -1; c++)
+for(c = 0; c < POWNEDLIST_MAX; c++)
{
if(memcmp(zeiger->addr2, &mac_null, 6) == 0)
{
@@ -650,7 +650,7 @@ int c;
macmaclist_t *zeiger;
zeiger = pownedlist;
-for(c = 0; c < POWNEDLIST_MAX -1; c++)
+for(c = 0; c < POWNEDLIST_MAX; c++)
{
if(memcmp(zeiger->addr2, &mac_null, 6) == 0)
{
@@ -1190,10 +1190,6 @@ if(eapauth->type == EAPOL_KEY)
rc = byte_swap_64(wpak->replaycount);
if(keyinfo == 1)
{
- if(fd_pcapng != 0)
- {
- writeepb(fd_pcapng);
- }
if(rc == rcrandom)
{
memcpy(&laststam1, macfrx->addr1, 6);
@@ -1202,8 +1198,18 @@ if(eapauth->type == EAPOL_KEY)
lasttimestampm1 = timestamp;
return;
}
+ if((authlen == 95) && (memcmp(macfrx->addr1, &mac_mysta, 6) == 0))
+ {
+ return;
+ }
+ if(authlen > 95)
+ {
if(detectpmkid(authlen, eapauthptr +EAPAUTH_SIZE) == true)
{
+ if(fd_pcapng != 0)
+ {
+ writeepb(fd_pcapng);
+ }
if(addpownedstaap(macfrx->addr1, macfrx->addr2, RX_PMKID) == false)
{
if((statusout & STATUS_EAPOL) == STATUS_EAPOL)
@@ -1219,6 +1225,12 @@ if(eapauth->type == EAPOL_KEY)
}
}
}
+ return;
+ }
+ }
+ if(fd_pcapng != 0)
+ {
+ writeepb(fd_pcapng);
}
return;
}
