aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-l2tp.c
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2013-01-26 22:36:54 +0000
committerJaap Keuter <jaap.keuter@xs4all.nl>2013-01-26 22:36:54 +0000
commit38dbf79f14b15214fc62e1258f12453363be84b0 (patch)
tree94179d39bcadc75c821c489d67bdd7e3ca15987a /epan/dissectors/packet-l2tp.c
parent329f6e8cc02dd7b2dfa82837e7f43fb74442491f (diff)
Fix for CID 718640:
Make sure the AVPs length are right before we go into hash calculation. svn path=/trunk/; revision=47311
Diffstat (limited to 'epan/dissectors/packet-l2tp.c')
-rw-r--r--epan/dissectors/packet-l2tp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/dissectors/packet-l2tp.c b/epan/dissectors/packet-l2tp.c
index 8e785decff..aeb5c64cd0 100644
--- a/epan/dissectors/packet-l2tp.c
+++ b/epan/dissectors/packet-l2tp.c
@@ -806,9 +806,13 @@ static int check_control_digest(l2tpv3_tunnel_t *tunnel,
switch (tvb_get_guint8(tvb, idx)) {
case L2TP_HMAC_MD5:
+ if ((avp_len - 1) != L2TP_HMAC_MD5_DIGEST_LEN)
+ return -1;
md5_hmac_digest(tunnel, tvb, length, idx, avp_len, msg_type, pinfo, digest);
break;
case L2TP_HMAC_SHA1:
+ if ((avp_len - 1) != L2TP_HMAC_SHA1_DIGEST_LEN)
+ return -1;
sha1_hmac_digest(tunnel, tvb, length, idx, avp_len, msg_type, pinfo, digest);
break;
default: