diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-12-25 06:59:33 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-12-25 06:59:33 +0000 |
commit | 6de8fb2070fd7fd4c599bfde73697bf4f0a75cea (patch) | |
tree | 09a916a68b98b10b6ad3967fae4f4a8b82ba46c5 /packet-kerberos.c | |
parent | b56e34d396edd0e3f328e246af49933bd3bcd213 (diff) |
If a PrincipalName has at least one name-string, put the first of the
name strings into the top-level tree item for the PrincipalName, along
the lines of what was done earlier.
svn path=/trunk/; revision=2781
Diffstat (limited to 'packet-kerberos.c')
-rw-r--r-- | packet-kerberos.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/packet-kerberos.c b/packet-kerberos.c index a077244c4e..40a40be507 100644 --- a/packet-kerberos.c +++ b/packet-kerberos.c @@ -3,7 +3,7 @@ * Wes Hardaker (c) 2000 * wjhardaker@ucdavis.edu * - * $Id: packet-kerberos.c,v 1.9 2000/12/24 22:00:55 nneul Exp $ + * $Id: packet-kerberos.c,v 1.10 2000/12/25 06:59:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -788,6 +788,24 @@ dissect_PrincipalName(char *title, ASN1_SCK *asn1p, frame_data *fd, KRB_DECODE_CONTEXT_HEAD_OR_DIE("principal name-string", 1); KRB_SEQ_HEAD_DECODE_OR_DIE("principal name-string sequence-of"); total_len = item_len; + if (total_len == 0) { + /* There are no name strings in this PrincipalName, so we can't + put any in the top-level item. */ + return offset - start_offset; + } + + /* Put the first name string in the top-level item. */ + KRB_DECODE_GENERAL_STRING_OR_DIE("principal name", name, name_len, item_len); + if (princ_tree) { + proto_item_set_text(item, "%s: %.*s", title, (int) name_len, name); + proto_tree_add_text(princ_tree, NullTVB, offset, item_len, + "Name: %.*s", (int) name_len, name); + } + total_len -= item_len; + offset += item_len; + + /* Now process the rest of the strings. + XXX - put them in the item as well? */ while (total_len > 0) { KRB_DECODE_GENERAL_STRING_OR_DIE("principal name", name, name_len, item_len); if (princ_tree) { |