added detection of 802.11w (AES-128-CMAC MIC) write hrecords toseparate file filename.hccapx.aes128
@@ -597,6 +597,7 @@ hcx_t hcxrecord;
eap_t *eap1;
eap_t *eap2;
FILE *fhhcx = NULL;
+char hcxaes128outname[PATH_MAX+1];
unsigned long long int r;
int wldflagint = FALSE;
@@ -640,7 +641,19 @@ if((r == MYREPLAYCOUNT) && (memcmp(&mynonce, eap1->nonce, 32) == 0))
wldflagint = TRUE;
}
-if(hcxoutname != NULL)
+if((hcxoutname != NULL) && (hcxrecord.keyver == 3))
+ {
+ snprintf(hcxaes128outname, PATH_MAX, "%s.eas128", hcxoutname);
+ if((fhhcx = fopen(hcxaes128outname, "ab")) == NULL)
+ {
+ fprintf(stderr, "error opening hccapx file %s\n", hcxaes128outname);
+ exit(EXIT_FAILURE);
+ }
+ fwrite(&hcxrecord, 1 * HCX_SIZE, 1, fhhcx);
+ fclose(fhhcx);
+ }
+
+if((hcxoutname != NULL) && (hcxrecord.keyver != 3))
{
if((fhhcx = fopen(hcxoutname, "ab")) == NULL)
{
@@ -651,7 +664,7 @@ if(hcxoutname != NULL)
fclose(fhhcx);
}
-if((wdfhcxoutname != NULL) && (wldflagint == TRUE))
+if((wdfhcxoutname != NULL) && (wldflagint == TRUE) && (hcxrecord.keyver != 3))
{
if((fhhcx = fopen(wdfhcxoutname, "ab")) == NULL)
{
@@ -662,7 +675,7 @@ if((wdfhcxoutname != NULL) && (wldflagint == TRUE))
fclose(fhhcx);
}
-if((nonwdfhcxoutname != NULL) && (wldflagint == FALSE))
+if((nonwdfhcxoutname != NULL) && (wldflagint == FALSE) && (hcxrecord.keyver != 3))
{
if((fhhcx = fopen(nonwdfhcxoutname, "ab")) == NULL)
{
