From 54117349d4cf47f2c8da2cc4404fe1275a94dc0f Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 26 Oct 2002 06:13:33 +0000 Subject: [PATCH] Show the elements of authentication triplets as byte strings (as that's what they are - well, bit strings, really, but...). Doing so also fixes a bug, as "decode_gtp_auth_tri()" was copying 16 bytes to an array that was 8 bytes long.... Do the same for byte-string elements of a quintuplet - and show as byte strings some elements that weren't being shown at all. svn path=/trunk/; revision=6511 --- packet-gtp.c | 50 ++++++++++++++++---------------------------------- 1 file changed, 16 insertions(+), 34 deletions(-) diff --git a/packet-gtp.c b/packet-gtp.c index 8aa6f7fcd1..e30956cab0 100644 --- a/packet-gtp.c +++ b/packet-gtp.c @@ -4,7 +4,7 @@ * Copyright 2001, Michal Melerowicz * Nicolas Balkota * - * $Id: packet-gtp.c,v 1.38 2002/08/30 10:14:03 guy Exp $ + * $Id: packet-gtp.c,v 1.39 2002/10/26 06:13:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -2640,18 +2640,13 @@ decode_gtp_auth_tri(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tre proto_tree *ext_tree_auth_tri; proto_item *te; - guint32 rand[4], sres, kc[2]; - - tvb_memcpy(tvb, (guint8 *)&rand, offset+1, 16); - sres = tvb_get_ntohl(tvb, offset+17); - tvb_memcpy(tvb, (guint8 *)&kc, offset+21, 16); te = proto_tree_add_text(tree, tvb, offset, 29, val_to_str(GTP_EXT_AUTH_TRI, gtp_val, "Unknown message")); ext_tree_auth_tri = proto_item_add_subtree(tree, ett_gtp_auth_tri); - proto_tree_add_text(ext_tree_auth_tri, tvb, offset+1, 16, "RAND: %x%x%x%x", rand[0], rand[1], rand[2], rand[3]); - proto_tree_add_text(ext_tree_auth_tri, tvb, offset+17, 4, "SRES: %x", sres); - proto_tree_add_text(ext_tree_auth_tri, tvb, offset+21, 8, "Kc: %x%x", kc[0], kc[1]); + proto_tree_add_text(ext_tree_auth_tri, tvb, offset+1, 16, "RAND: %s", tvb_bytes_to_str(tvb, offset+1, 16)); + proto_tree_add_text(ext_tree_auth_tri, tvb, offset+17, 4, "SRES: %s", tvb_bytes_to_str(tvb, offset+17, 4)); + proto_tree_add_text(ext_tree_auth_tri, tvb, offset+21, 8, "Kc: %s", tvb_bytes_to_str(tvb, offset+21, 8)); return 1+16+4+8; } @@ -3144,21 +3139,15 @@ decode_triplet(tvbuff_t *tvb, int offset, proto_tree *tree, guint16 count) { proto_tree *ext_tree_trip; proto_item *te_trip; - guint32 rand[4], sres, kc[2]; guint16 i; for (i=0;i