summaryrefslogtreecommitdiff
path: root/epan/crypt
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2016-07-28 12:26:19 -0700
committerGerald Combs <gerald@wireshark.org>2016-07-29 00:12:09 +0000
commit0b9f2fca533b9330dff9a99c999017c0e6ee8bfa (patch)
tree1eea9974318f0b28b95e247ab5bf3d9960d921d7 /epan/crypt
parent3aedb1e256060e361739c10c9ef919a4f4794fe1 (diff)
downloadwireshark-0b9f2fca533b9330dff9a99c999017c0e6ee8bfa.tar.gz
Enable airpdcap debugging explicitly.
Enable airpdcap debugging with explicitly with AIRPDCAP_DEBUG instead of _DEBUG. _DEBUG might be defined automatically by Visual C++ depending on your build type and the extra output breaks the decryption tests. Change-Id: If6d918beb4d91233b07a3bc7b6f2f7e1849171f0 Reviewed-on: https://code.wireshark.org/review/16755 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'epan/crypt')
-rw-r--r--epan/crypt/airpdcap.c14
-rw-r--r--epan/crypt/airpdcap_debug.h10
2 files changed, 13 insertions, 11 deletions
diff --git a/epan/crypt/airpdcap.c b/epan/crypt/airpdcap.c
index 1212cdde7c..a0a04688c3 100644
--- a/epan/crypt/airpdcap.c
+++ b/epan/crypt/airpdcap.c
@@ -546,7 +546,7 @@ static INT AirPDcapScanForKeys(
};
const EAPOL_RSN_KEY *pEAPKey;
-#ifdef _DEBUG
+#ifdef AIRPDCAP_DEBUG
#define MSGBUF_LEN 255
CHAR msgbuf[MSGBUF_LEN];
#endif
@@ -633,7 +633,7 @@ static INT AirPDcapScanForKeys(
/* get STA address */
if ( (addr=AirPDcapGetStaAddress((const AIRPDCAP_MAC_FRAME_ADDR4 *)(data))) != NULL) {
memcpy(id.sta, addr, AIRPDCAP_MAC_LEN);
-#ifdef _DEBUG
+#ifdef AIRPDCAP_DEBUG
g_snprintf(msgbuf, MSGBUF_LEN, "ST_MAC: %2X.%2X.%2X.%2X.%2X.%2X\t", id.sta[0],id.sta[1],id.sta[2],id.sta[3],id.sta[4],id.sta[5]);
#endif
AIRPDCAP_DEBUG_PRINT_LINE("AirPDcapScanForKeys", msgbuf, AIRPDCAP_DEBUG_LEVEL_3);
@@ -763,7 +763,7 @@ INT AirPDcapPacketProcess(
UCHAR tmp_data[AIRPDCAP_MAX_CAPLEN];
guint tmp_len;
-#ifdef _DEBUG
+#ifdef AIRPDCAP_DEBUG
#define MSGBUF_LEN 255
CHAR msgbuf[MSGBUF_LEN];
#endif
@@ -864,7 +864,7 @@ INT AirPDcapPacketProcess(
/* force STA address to broadcast MAC so we load the SA for the groupkey */
memcpy(id.sta, broadcast_mac, AIRPDCAP_MAC_LEN);
-#ifdef _DEBUG
+#ifdef AIRPDCAP_DEBUG
g_snprintf(msgbuf, MSGBUF_LEN, "ST_MAC: %2X.%2X.%2X.%2X.%2X.%2X\t", id.sta[0],id.sta[1],id.sta[2],id.sta[3],id.sta[4],id.sta[5]);
AIRPDCAP_DEBUG_PRINT_LINE("AirPDcapPacketProcess", msgbuf, AIRPDCAP_DEBUG_LEVEL_3);
#endif
@@ -922,7 +922,7 @@ INT AirPDcapSetKeys(
AIRPDCAP_DEBUG_PRINT_LINE("AirPDcapSetKeys", "Set a WPA-PWD key", AIRPDCAP_DEBUG_LEVEL_4);
AirPDcapRsnaPwd2Psk(keys[i].UserPwd.Passphrase, keys[i].UserPwd.Ssid, keys[i].UserPwd.SsidLen, keys[i].KeyData.Wpa.Psk);
}
-#ifdef _DEBUG
+#ifdef AIRPDCAP_DEBUG
else if (keys[i].KeyType==AIRPDCAP_KEY_TYPE_WPA_PMK) {
AIRPDCAP_DEBUG_PRINT_LINE("AirPDcapSetKeys", "Set a WPA-PMK key", AIRPDCAP_DEBUG_LEVEL_4);
} else if (keys[i].KeyType==AIRPDCAP_KEY_TYPE_WEP) {
@@ -1700,7 +1700,7 @@ AirPDcapGetSaAddress(
const AIRPDCAP_MAC_FRAME_ADDR4 *frame,
AIRPDCAP_SEC_ASSOCIATION_ID *id)
{
-#ifdef _DEBUG
+#ifdef AIRPDCAP_DEBUG
#define MSGBUF_LEN 255
CHAR msgbuf[MSGBUF_LEN];
#endif
@@ -1735,7 +1735,7 @@ AirPDcapGetSaAddress(
}
}
-#ifdef _DEBUG
+#ifdef AIRPDCAP_DEBUG
g_snprintf(msgbuf, MSGBUF_LEN, "BSSID_MAC: %02X.%02X.%02X.%02X.%02X.%02X\t",
id->bssid[0],id->bssid[1],id->bssid[2],id->bssid[3],id->bssid[4],id->bssid[5]);
AIRPDCAP_DEBUG_PRINT_LINE("AirPDcapGetSaAddress", msgbuf, AIRPDCAP_DEBUG_LEVEL_3);
diff --git a/epan/crypt/airpdcap_debug.h b/epan/crypt/airpdcap_debug.h
index 149384e8ed..118552260a 100644
--- a/epan/crypt/airpdcap_debug.h
+++ b/epan/crypt/airpdcap_debug.h
@@ -37,7 +37,9 @@
#include "airpdcap_interop.h"
-#ifdef _DEBUG
+/* #define AIRPDCAP_DEBUG 1 */
+
+#ifdef AIRPDCAP_DEBUG
#ifdef __FUNCTION__
#define AIRPDCAP_DEBUG_PRINT_LINE(notdefined, msg, level) print_debug_line(__FUNCTION__, msg, level);
#else
@@ -54,7 +56,7 @@
/******************************************************************************/
/* Debug section: internal function to print debug information */
/* */
-#ifdef _DEBUG
+#ifdef AIRPDCAP_DEBUG
#include <stdio.h>
#include <time.h>
@@ -100,7 +102,7 @@ static inline void DEBUG_DUMP(const char* x, const guint8* y, int z)
wmem_free(NULL, tmp_str);
}
-#else /* !defined _DEBUG */
+#else /* !defined AIRPDCAP_DEBUG */
#define AIRPDCAP_DEBUG_LEVEL_1
#define AIRPDCAP_DEBUG_LEVEL_2
@@ -113,7 +115,7 @@ static inline void DEBUG_DUMP(const char* x, const guint8* y, int z)
#define DEBUG_DUMP(x,y,z)
-#endif /* ?defined _DEBUG */
+#endif /* ?defined AIRPDCAP_DEBUG */
#endif /* ?defined _AIRPDCAP_DEBUG_H */