aboutsummaryrefslogtreecommitdiffstats
path: root/epan/crypt
diff options
context:
space:
mode:
authorMikael Kanstrup <mikael.kanstrup@sony.com>2020-05-23 14:02:19 +0200
committerAnders Broman <a.broman58@gmail.com>2020-05-25 10:33:34 +0000
commit499a49fd844b133e5feaf195dbfe8b538d061d97 (patch)
tree1ce9ea6069004b1bd7f6ac591893a2ddcb8beb9d /epan/crypt
parent685a125729db74be3921426731ebfad30268d956 (diff)
dot11decrypt: Remove DEBUG_TRACE_START/END macros
The function tracing functions DEBUG_TRACE_START/END are only used in a few functions and START/END often don't match making them unreliable. Remove these macros and their usage as it clutters code without adding any useful debug capabilities. Change-Id: I7ea214c07ba1f35cc546942b5d4737f5752d20a7 Reviewed-on: https://code.wireshark.org/review/37306 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/crypt')
-rw-r--r--epan/crypt/dot11decrypt.c29
-rw-r--r--epan/crypt/dot11decrypt_debug.h10
2 files changed, 0 insertions, 39 deletions
diff --git a/epan/crypt/dot11decrypt.c b/epan/crypt/dot11decrypt.c
index 4866adf196..ac97d40ef6 100644
--- a/epan/crypt/dot11decrypt.c
+++ b/epan/crypt/dot11decrypt.c
@@ -783,7 +783,6 @@ INT Dot11DecryptScanTdlsForKeys(
}
if (Dot11DecryptTDLSDeriveKey(sa, data, offset_rsne, offset_fte, offset_timeout, offset_link, action)
== DOT11DECRYPT_RET_SUCCESS) {
- DEBUG_TRACE_END();
return DOT11DECRYPT_RET_SUCCESS_HANDSHAKE;
}
return DOT11DECRYPT_RET_NO_VALID_HANDSHAKE;
@@ -930,19 +929,15 @@ INT Dot11DecryptDecryptPacket(
CHAR msgbuf[MSGBUF_LEN];
#endif
- DEBUG_TRACE_START();
-
if (decrypt_len) {
*decrypt_len = 0;
}
if (ctx==NULL) {
DEBUG_PRINT_LINE("NULL context", DEBUG_LEVEL_5);
- DEBUG_TRACE_END();
return DOT11DECRYPT_RET_REQ_DATA;
}
if (data==NULL || tot_len==0) {
DEBUG_PRINT_LINE("NULL data or length=0", DEBUG_LEVEL_5);
- DEBUG_TRACE_END();
return DOT11DECRYPT_RET_REQ_DATA;
}
@@ -1028,17 +1023,14 @@ INT Dot11DecryptSetKeys(
{
INT i;
INT success;
- DEBUG_TRACE_START();
if (ctx==NULL || keys==NULL) {
DEBUG_PRINT_LINE("NULL context or NULL keys array", DEBUG_LEVEL_3);
- DEBUG_TRACE_END();
return 0;
}
if (keys_nr>DOT11DECRYPT_MAX_KEYS_NR) {
DEBUG_PRINT_LINE("Keys number greater than maximum", DEBUG_LEVEL_3);
- DEBUG_TRACE_END();
return 0;
}
@@ -1068,8 +1060,6 @@ INT Dot11DecryptSetKeys(
}
ctx->keys_nr=success;
-
- DEBUG_TRACE_END();
return success;
}
@@ -1077,11 +1067,8 @@ static void
Dot11DecryptCleanKeys(
PDOT11DECRYPT_CONTEXT ctx)
{
- DEBUG_TRACE_START();
-
if (ctx==NULL) {
DEBUG_PRINT_LINE("NULL context", DEBUG_LEVEL_5);
- DEBUG_TRACE_END();
return;
}
@@ -1090,7 +1077,6 @@ Dot11DecryptCleanKeys(
ctx->keys_nr=0;
DEBUG_PRINT_LINE("Keys collection cleaned!", DEBUG_LEVEL_5);
- DEBUG_TRACE_END();
}
static void
@@ -1140,11 +1126,8 @@ INT Dot11DecryptSetLastSSID(
INT Dot11DecryptInitContext(
PDOT11DECRYPT_CONTEXT ctx)
{
- DEBUG_TRACE_START();
-
if (ctx==NULL) {
DEBUG_PRINT_LINE("NULL context", DEBUG_LEVEL_5);
- DEBUG_TRACE_END();
return DOT11DECRYPT_RET_UNSUCCESS;
}
@@ -1158,18 +1141,14 @@ INT Dot11DecryptInitContext(
memset(ctx->sa, 0, DOT11DECRYPT_MAX_SEC_ASSOCIATIONS_NR * sizeof(DOT11DECRYPT_SEC_ASSOCIATION));
DEBUG_PRINT_LINE("Context initialized!", DEBUG_LEVEL_5);
- DEBUG_TRACE_END();
return DOT11DECRYPT_RET_SUCCESS;
}
INT Dot11DecryptDestroyContext(
PDOT11DECRYPT_CONTEXT ctx)
{
- DEBUG_TRACE_START();
-
if (ctx==NULL) {
DEBUG_PRINT_LINE("NULL context", DEBUG_LEVEL_5);
- DEBUG_TRACE_END();
return DOT11DECRYPT_RET_UNSUCCESS;
}
@@ -1181,7 +1160,6 @@ INT Dot11DecryptDestroyContext(
ctx->sa_index=-1;
DEBUG_PRINT_LINE("Context destroyed!", DEBUG_LEVEL_5);
- DEBUG_TRACE_END();
return DOT11DECRYPT_RET_SUCCESS;
}
@@ -1769,20 +1747,17 @@ Dot11DecryptRsnaMicCheck(
/* Mic check algoritm determined by AKM type */
if (Dot11DecryptGetIntegrityAlgoFromAkm(akm, &algo, &hmac)) {
DEBUG_PRINT_LINE("Unknown Mic check algo", DEBUG_LEVEL_3);
- DEBUG_TRACE_END();
return DOT11DECRYPT_RET_UNSUCCESS;
};
}
if (hmac) {
if (ws_hmac_buffer(algo, c_mic, eapol, eapol_len, KCK, kck_len)) {
DEBUG_PRINT_LINE("HMAC_BUFFER", DEBUG_LEVEL_3);
- DEBUG_TRACE_END();
return DOT11DECRYPT_RET_UNSUCCESS;
}
} else {
if (ws_cmac_buffer(algo, c_mic, eapol, eapol_len, KCK, kck_len)) {
DEBUG_PRINT_LINE("HMAC_BUFFER", DEBUG_LEVEL_3);
- DEBUG_TRACE_END();
return DOT11DECRYPT_RET_UNSUCCESS;
}
}
@@ -1799,11 +1774,9 @@ Dot11DecryptValidateKey(
{
size_t len;
UCHAR ret=TRUE;
- DEBUG_TRACE_START();
if (key==NULL) {
DEBUG_PRINT_LINE("NULL key", DEBUG_LEVEL_5);
- DEBUG_TRACE_START();
return FALSE;
}
@@ -1854,8 +1827,6 @@ Dot11DecryptValidateKey(
default:
ret=FALSE;
}
-
- DEBUG_TRACE_END();
return ret;
}
diff --git a/epan/crypt/dot11decrypt_debug.h b/epan/crypt/dot11decrypt_debug.h
index 1b8a5938ff..d95335dc50 100644
--- a/epan/crypt/dot11decrypt_debug.h
+++ b/epan/crypt/dot11decrypt_debug.h
@@ -39,14 +39,6 @@ static inline void print_debug_line(const CHAR *function, const CHAR *msg, const
#define DEBUG_PRINT_LINE(msg, level) print_debug_line(G_STRFUNC , msg, level)
-#ifdef _TRACE
-#define DEBUG_TRACE_START() print_debug_line(G_STRFUNC, "Start!", DEBUG_USED_LEVEL)
-#define DEBUG_TRACE_END() print_debug_line(G_STRFUNC, "End!", DEBUG_USED_LEVEL)
-#else
-#define DEBUG_TRACE_START()
-#define DEBUG_TRACE_END()
-#endif
-
static inline void DEBUG_DUMP(const char* x, const guint8* y, int z)
{
char* tmp_str = bytes_to_str(NULL, y, (z));
@@ -56,8 +48,6 @@ static inline void DEBUG_DUMP(const char* x, const guint8* y, int z)
#else /* !defined DOT11DECRYPT_DEBUG */
-#define DEBUG_TRACE_START()
-#define DEBUG_TRACE_END()
#define DEBUG_PRINT_LINE(msg, level)
#define DEBUG_DUMP(x,y,z)