diff options
author | Richard Sharpe <sharpe@ns.aus.com> | 2002-09-04 21:34:38 +0000 |
---|---|---|
committer | Richard Sharpe <sharpe@ns.aus.com> | 2002-09-04 21:34:38 +0000 |
commit | 174fb4985418bb48d069e86335eb78a5a37980a7 (patch) | |
tree | 86db91187ff4f713cdfadce24cc4ab658f485646 | |
parent | 070a9a3b1192e8ce6b144b9f645d6be2692f158f (diff) | |
download | wireshark-174fb4985418bb48d069e86335eb78a5a37980a7.tar.gz wireshark-174fb4985418bb48d069e86335eb78a5a37980a7.tar.bz2 wireshark-174fb4985418bb48d069e86335eb78a5a37980a7.zip |
Add some level of OID naming etc ...
svn path=/trunk/; revision=6180
-rw-r--r-- | packet-gssapi.c | 39 | ||||
-rw-r--r-- | packet-gssapi.h | 4 | ||||
-rw-r--r-- | packet-kerberos.c | 9 | ||||
-rw-r--r-- | packet-ntlmssp.c | 4 | ||||
-rw-r--r-- | packet-spnego.c | 26 |
5 files changed, 51 insertions, 31 deletions
diff --git a/packet-gssapi.c b/packet-gssapi.c index f6f2ec4f9d..b580d4fd83 100644 --- a/packet-gssapi.c +++ b/packet-gssapi.c @@ -2,7 +2,7 @@ * Dissector for GSS-API tokens as described in rfc2078, section 3.1 * Copyright 2002, Tim Potter <tpot@samba.org> * - * $Id: packet-gssapi.c,v 1.14 2002/08/31 22:22:29 guy Exp $ + * $Id: packet-gssapi.c,v 1.15 2002/09/04 21:34:38 sharpe Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -73,7 +73,8 @@ gssapi_oid_hash(gconstpointer k) } void -gssapi_init_oid(char *oid, int proto, int ett, dissector_handle_t handle) +gssapi_init_oid(char *oid, int proto, int ett, dissector_handle_t handle, + gchar *comment) { char *key = g_strdup(oid); gssapi_oid_value *value = g_malloc(sizeof(*value)); @@ -81,6 +82,7 @@ gssapi_init_oid(char *oid, int proto, int ett, dissector_handle_t handle) value->proto = proto; value->ett = ett; value->handle = handle; + value->comment = comment; g_hash_table_insert(gssapi_oids, key, value); } @@ -166,14 +168,13 @@ dissect_gssapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (!(cls == ASN1_APL && con == ASN1_CON && tag == 0)) { /* - * If we do not recognise an Application class, then + * If we do not recognise an Application class, * then we are probably dealing with an inner context * token, and we should retrieve the dissector from * the conversation that exists or we created from pinfo * * Note! We cheat. Since we only need the dissector handle, - * We store that as the conversation data ... after type - * casting. + * We store that as the conversation data ... */ if (conversation && @@ -214,20 +215,14 @@ dissect_gssapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) oid_string = format_oid(oid, oid_len); - proto_tree_add_text(subtree, tvb, offset, nbytes, "OID: %s", - oid_string); - - offset += nbytes; - - g_free(oid_string); - /* * Hand off to subdissector. * We can't use "oid_string", as it might contain an * interpretation of the OID after the raw string, so * we generate our own string for it. */ - oid_string = g_malloc(oid_len * 22 + 1); + + /*oid_string = g_malloc(oid_len * 22 + 1); p = oid_string; len = sprintf(p, "%lu", (unsigned long)oid[0]); p += len; @@ -235,10 +230,16 @@ dissect_gssapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) len = sprintf(p, ".%lu", (unsigned long)oid[i]); p += len; } - + */ if (((value = g_hash_table_lookup(gssapi_oids, oid_string)) == NULL) || !proto_is_protocol_enabled(value->proto)) { + proto_tree_add_text(subtree, tvb, offset, nbytes, + "OID: %s", + oid_string); + + offset += nbytes; + g_free(oid_string); /* No dissector for this oid */ @@ -249,6 +250,16 @@ dissect_gssapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) goto done; } + if (value) + proto_tree_add_text(subtree, tvb, offset, nbytes, + "OID: %s (%s)", + oid_string, value->comment); + else + proto_tree_add_text(subtree, tvb, offset, nbytes, "OID: %s", + oid_string); + + offset += nbytes; + g_free(oid_string); /* diff --git a/packet-gssapi.h b/packet-gssapi.h index 602aea9bb8..ca00987d90 100644 --- a/packet-gssapi.h +++ b/packet-gssapi.h @@ -2,7 +2,7 @@ * Dissector for GSS-API tokens as described in rfc2078, section 3.1 * Copyright 2002, Tim Potter <tpot@samba.org> * - * $Id: packet-gssapi.h,v 1.5 2002/08/31 22:22:29 guy Exp $ + * $Id: packet-gssapi.h,v 1.6 2002/09/04 21:34:38 sharpe Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -42,6 +42,6 @@ extern GHashTable *gssapi_oids; /* Function prototypes */ void -gssapi_init_oid(char *oid, int proto, int ett, dissector_handle_t handle); +gssapi_init_oid(char *oid, int proto, int ett, dissector_handle_t handle, gchar *comment); #endif /* __PACKET_GSSAPI_H */ diff --git a/packet-kerberos.c b/packet-kerberos.c index 063629e9f0..f4348a0d62 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.29 2002/09/01 01:31:55 sharpe Exp $ + * $Id: packet-kerberos.c,v 1.30 2002/09/04 21:34:38 sharpe Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1380,12 +1380,11 @@ proto_reg_handoff_kerberos(void) dissector_add("udp.port", UDP_PORT_KERBEROS, kerberos_handle); dissector_add("tcp.port", TCP_PORT_KERBEROS, kerberos_handle); + /* Register both the one MS created and the real one */ gssapi_init_oid("1.2.840.48018.1.2.2", proto_kerberos, ett_kerberos, - kerberos_handle); - /* Also register the stupidly incorrect one MS created for Kerberos */ - /* If you look at the binary, you will see they added one extra bit */ + kerberos_handle, "MS KRB5 (Microsoft Kerberos 5)"); gssapi_init_oid("1.2.840.113554.1.2.2", proto_kerberos, ett_kerberos, - kerberos_handle); + kerberos_handle, "KRB5 (Kerberos 5)"); } /* diff --git a/packet-ntlmssp.c b/packet-ntlmssp.c index c602dc6a98..10ea36fa10 100644 --- a/packet-ntlmssp.c +++ b/packet-ntlmssp.c @@ -2,7 +2,7 @@ * Routines for NTLM Secure Service Provider * Devin Heitmueller <dheitmueller@netilla.com> * - * $Id: packet-ntlmssp.c,v 1.14 2002/09/03 16:45:31 sharpe Exp $ + * $Id: packet-ntlmssp.c,v 1.15 2002/09/04 21:34:38 sharpe Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -814,5 +814,5 @@ proto_reg_handoff_ntlmssp(void) ntlmssp_handle = find_dissector("ntlmssp"); gssapi_init_oid("1.3.6.1.4.1.311.2.2.10", proto_ntlmssp, ett_ntlmssp, - ntlmssp_handle); + ntlmssp_handle, "NTLMSSP (Microsoft NTLM Security Support Providor)"); } diff --git a/packet-spnego.c b/packet-spnego.c index 4579854b4e..eb0431e88d 100644 --- a/packet-spnego.c +++ b/packet-spnego.c @@ -4,7 +4,7 @@ * Copyright 2002, Tim Potter <tpot@samba.org> * Copyright 2002, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-spnego.c,v 1.25 2002/09/04 06:54:45 sharpe Exp $ + * $Id: packet-spnego.c,v 1.26 2002/09/04 21:34:38 sharpe Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -153,6 +153,7 @@ dissect_spnego_mechTypes(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, */ while (len1) { + gssapi_oid_value *value; ret = asn1_oid_decode(hnd, &oid, &len, &nbytes); @@ -163,9 +164,13 @@ dissect_spnego_mechTypes(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, } oid_string = format_oid(oid, len); - - proto_tree_add_text(subtree, tvb, offset, nbytes, "OID: %s", - oid_string); + value = g_hash_table_lookup(gssapi_oids, oid_string); + if (value) + proto_tree_add_text(subtree, tvb, offset, nbytes, "OID: %s (%s)", + oid_string, value->comment); + else + proto_tree_add_text(subtree, tvb, offset, nbytes, "OID: %s", + oid_string); offset += nbytes; len1 -= nbytes; @@ -527,9 +532,6 @@ dissect_spnego_supportedMech(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, oid_string = format_oid(oid, oid_len); - proto_tree_add_text(tree, tvb, offset, nbytes, "supportedMech: %s", - oid_string); - offset += nbytes; g_free(oid_string); @@ -544,6 +546,14 @@ dissect_spnego_supportedMech(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, } value = g_hash_table_lookup(gssapi_oids, oid_string); + printf("OID Value : %0X\n", value); + if (value) + proto_tree_add_text(tree, tvb, offset, nbytes, + "supportedMech: %s (%s)", + oid_string, value->comment); + else + proto_tree_add_text(tree, tvb, offset, nbytes, "supportedMech: %s", + oid_string); /* Should check for an unrecognized OID ... */ @@ -913,5 +923,5 @@ proto_reg_handoff_spnego(void) spnego_handle = create_dissector_handle(dissect_spnego, proto_spnego); gssapi_init_oid("1.3.6.1.5.5.2", proto_spnego, ett_spnego, - spnego_handle); + spnego_handle, "SPNEGO (Simple Protected Negotiation)"); } |