From 232db679b51a1c2c5f85ea146606e56635b9aa42 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Fri, 6 Sep 2002 05:41:17 +0000 Subject: Properly dissect the innerContextToken for Kerberos in GSSAPI. Now, all I have to do is to modularize the Kerberos dissector :-) svn path=/trunk/; revision=6192 --- packet-spnego.c | 47 +++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) (limited to 'packet-spnego.c') diff --git a/packet-spnego.c b/packet-spnego.c index 2cc13df70b..eb6d4405aa 100644 --- a/packet-spnego.c +++ b/packet-spnego.c @@ -4,7 +4,7 @@ * Copyright 2002, Tim Potter * Copyright 2002, Richard Sharpe * - * $Id: packet-spnego.c,v 1.28 2002/09/05 03:49:03 sharpe Exp $ + * $Id: packet-spnego.c,v 1.29 2002/09/06 05:41:17 sharpe Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -67,6 +67,7 @@ static int hf_spnego_mechlistmic = -1; static int hf_spnego_responsetoken = -1; static int hf_spnego_reqflags = -1; static int hf_spnego_krb5 = -1; +static int hf_spnego_krb5_tok_id = -1; static gint ett_spnego = -1; static gint ett_spnego_negtokeninit = -1; @@ -110,6 +111,17 @@ dissect_parse_error(tvbuff_t *tvb, int offset, packet_info *pinfo, * by the looks of it. */ +#define KRB_TOKEN_AP_REQ 0x0001 +#define KRB_TOKEN_AP_REP 0x0002 +#define KRB_TOKEN_AP_ERR 0x0003 + +static const value_string spnego_krb5_tok_id_vals[] = { + { KRB_TOKEN_AP_REQ, "KRB5_AP_REQ"}, + { KRB_TOKEN_AP_REP, "KRB5_AP_REP"}, + { KRB_TOKEN_AP_ERR, "KRB5_ERROR"}, + { 0, NULL} +}; + static void dissect_spnego_krb5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { @@ -185,35 +197,15 @@ dissect_spnego_krb5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) offset += nbytes; - /* Next, the 0 length boolean ... */ + /* Next, the token ID ... */ - ret = asn1_header_decode(&hnd, &cls, &con, &tag, &def, &len1); + proto_tree_add_item(subtree, hf_spnego_krb5_tok_id, tvb, offset, 2, + TRUE); - if (ret != ASN1_ERR_NOERROR) { - dissect_parse_error(tvb, offset, pinfo, subtree, - "SPNEGO KRB5 Header", ret); - goto done; - } - if (!(cls == ASN1_UNI && con == ASN1_PRI && tag == ASN1_BOL)) { - proto_tree_add_text( - subtree, tvb, offset, 0, - "Unknown header (cls=%d, con=%d, tag=%d)", - cls, con, tag); - goto done; - } - - if (len1 != 0) { /* Bail, it is an error */ + hnd.offset += 2; - proto_tree_add_text( - subtree, tvb, offset, 0, - "Non-zero length boolean encountered (len=%d)", - len1); - goto done; - - } - - offset = hnd.offset; + offset += 2; offset = dissect_Ticket(&hnd, pinfo, subtree, offset); @@ -1020,6 +1012,9 @@ proto_register_spnego(void) { &hf_spnego_krb5, { "krb5_blob", "spnego.krb5.blob", FT_BYTES, BASE_HEX, NULL, 0, "krb5_blob", HFILL }}, + { &hf_spnego_krb5_tok_id, + { "krb5_tok_id", "spnego.krb5.tok_id", FT_UINT16, BASE_HEX, + VALS(spnego_krb5_tok_id_vals), 0, "KRB5 Token Ids", HFILL}}, }; static gint *ett[] = { -- cgit v1.2.1