From 9b08d4af0fd92691779f3d624f2e071cdee914ca Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 21 Feb 2017 20:07:18 +0100 Subject: [PATCH] Update hccapx format to version 4 --- OpenCL/inc_types.cl | 2 +- include/interface.h | 5 +++-- src/interface.c | 8 ++++---- tools/test.pl | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/OpenCL/inc_types.cl b/OpenCL/inc_types.cl index 22a04ac23..3911c3d75 100644 --- a/OpenCL/inc_types.cl +++ b/OpenCL/inc_types.cl @@ -789,7 +789,7 @@ typedef struct wpa u32 pke[25]; u32 eapol[64 + 16]; u16 eapol_len; - u8 authenticated; + u8 message_pair; u8 keyver; u8 orig_mac_ap[6]; u8 orig_mac_sta[6]; diff --git a/include/interface.h b/include/interface.h index 2700c9236..8ad75b20c 100644 --- a/include/interface.h +++ b/include/interface.h @@ -177,7 +177,7 @@ typedef struct wpa u32 pke[25]; u32 eapol[64 + 16]; u16 eapol_len; - u8 authenticated; + u8 message_pair; u8 keyver; u8 orig_mac_ap[6]; u8 orig_mac_sta[6]; @@ -812,6 +812,7 @@ typedef struct struct_psafe2_hdr } psafe2_hdr; +#define HCCAPX_VERSION 4 #define HCCAPX_SIGNATURE 0x58504348 // HCPX // this is required to force mingw to accept the packed attribute @@ -821,7 +822,7 @@ struct hccapx { u32 signature; u32 version; - u8 authenticated; + u8 message_pair; u8 essid_len; u8 essid[32]; u8 keyver; diff --git a/src/interface.c b/src/interface.c index 5c5efc955..939a34b57 100644 --- a/src/interface.c +++ b/src/interface.c @@ -2715,7 +2715,7 @@ int wpa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED if (in.signature != HCCAPX_SIGNATURE) return (PARSER_HCCAPX_SIGNATURE); - if (in.version != 3) return (PARSER_HCCAPX_VERSION); + if (in.version != HCCAPX_VERSION) return (PARSER_HCCAPX_VERSION); if (in.eapol_len < 1 || in.eapol_len > 255) return (PARSER_HCCAPX_EAPOL_LEN); @@ -2780,7 +2780,7 @@ int wpa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED memcpy (wpa->orig_nonce_ap, in.nonce_ap, 32); memcpy (wpa->orig_nonce_sta, in.nonce_sta, 32); - wpa->authenticated = in.authenticated; + wpa->message_pair = in.message_pair; wpa->keyver = in.keyver; @@ -14857,7 +14857,7 @@ void to_hccapx_t (hashcat_ctx_t *hashcat_ctx, hccapx_t *hccapx, const u32 salt_p memset (hccapx, 0, sizeof (hccapx_t)); hccapx->signature = HCCAPX_SIGNATURE; - hccapx->version = 3; + hccapx->version = HCCAPX_VERSION; const salt_t *salt = &salts_buf[salt_pos]; @@ -14868,7 +14868,7 @@ void to_hccapx_t (hashcat_ctx_t *hashcat_ctx, hccapx_t *hccapx, const u32 salt_p wpa_t *wpas = (wpa_t *) esalts_buf; wpa_t *wpa = &wpas[salt_pos]; - hccapx->authenticated = wpa->authenticated; + hccapx->message_pair = wpa->message_pair; hccapx->keyver = wpa->keyver; hccapx->eapol_len = wpa->eapol_len; diff --git a/tools/test.pl b/tools/test.pl index 262bd6a14..2d8379f10 100755 --- a/tools/test.pl +++ b/tools/test.pl @@ -4930,7 +4930,7 @@ sub gen_hash # format the binary output (.hccapx version 3) # - my $HCCAPX_VERSION = 3; + my $HCCAPX_VERSION = 4; # signature $hash_buf = "HCPX"; @@ -4939,7 +4939,7 @@ sub gen_hash $hash_buf .= pack ("L<", $HCCAPX_VERSION); # authenticated - $hash_buf .= pack ("C", 1); + $hash_buf .= pack ("C", 0); # essid length $essid_len = length ($salt_buf);