aboutsummaryrefslogtreecommitdiffstats
path: root/epan/crypt
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2008-08-25 15:26:15 +0000
committerGerald Combs <gerald@wireshark.org>2008-08-25 15:26:15 +0000
commitab689cc3341496f70b810904f2a61014b9a8b1a5 (patch)
tree1f57d05f4516c88ab79392ea37e592f63c053b8c /epan/crypt
parentf31f3f6d14c7045d074ded5cc4716e0dd7be3d82 (diff)
Add another buffer length check to group key decryption.
svn path=/trunk/; revision=26071
Diffstat (limited to 'epan/crypt')
-rw-r--r--epan/crypt/airpdcap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/epan/crypt/airpdcap.c b/epan/crypt/airpdcap.c
index 0ea6b6ce12..241ab4c9d7 100644
--- a/epan/crypt/airpdcap.c
+++ b/epan/crypt/airpdcap.c
@@ -459,6 +459,7 @@ AirPDcapGetSaPtr(
return &ctx->sa[sa_index];
}
+#define GROUP_KEY_PAYLOAD_LEN (8+4+sizeof(EAPOL_RSN_KEY))
INT AirPDcapScanForGroupKey(
PAIRPDCAP_CONTEXT ctx,
const guint8 *data,
@@ -487,6 +488,11 @@ INT AirPDcapScanForGroupKey(
AIRPDCAP_DEBUG_TRACE_START("AirPDcapScanForGroupKey");
+ if (mac_header_len + GROUP_KEY_PAYLOAD_LEN < tot_len) {
+ AIRPDCAP_DEBUG_PRINT_LINE("AirPDcapScanForGroupKey", "Message too short", AIRPDCAP_DEBUG_LEVEL_3);
+ return AIRPDCAP_RET_NO_VALID_HANDSHAKE;
+ }
+
/* cache offset in the packet data */
offset = mac_header_len;