diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2006-08-06 13:13:42 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2006-08-06 13:13:42 +0000 |
commit | 3ef9bcfa26408a45ca3a5312e4a5c1f0d11f469e (patch) | |
tree | 4fa0508c6b7a3820c148eb238dbb0a0739fbe776 /asn1 | |
parent | 84fd6a1f3d6ca226462ceac457f654cac376cd05 (diff) | |
download | wireshark-3ef9bcfa26408a45ca3a5312e4a5c1f0d11f469e.tar.gz wireshark-3ef9bcfa26408a45ca3a5312e4a5c1f0d11f469e.tar.bz2 wireshark-3ef9bcfa26408a45ca3a5312e4a5c1f0d11f469e.zip |
"objectGUID" should be dissected as a GUID
also change the name of one of the strings we keep around since it is more generic than just used for attributeassertions
svn path=/trunk/; revision=18841
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/ldap/ldap.cnf | 12 | ||||
-rw-r--r-- | asn1/ldap/packet-ldap-template.c | 44 |
2 files changed, 36 insertions, 20 deletions
diff --git a/asn1/ldap/ldap.cnf b/asn1/ldap/ldap.cnf index 004d012526..6d899c3f14 100644 --- a/asn1/ldap/ldap.cnf +++ b/asn1/ldap/ldap.cnf @@ -452,19 +452,19 @@ ldap_conv_info_t *ldap_info; and_filter_string=NULL; #.FN_FTR Filter/equalityMatch - Filter_string=ep_strdup_printf("(%s=%s)",attributedesc_string,assertionvalue_string); + Filter_string=ep_strdup_printf("(%s=%s)",attributedesc_string,ldapvalue_string); #.FN_FTR Filter/greaterOrEqual - Filter_string=ep_strdup_printf("(%s>=%s)",attributedesc_string,assertionvalue_string); + Filter_string=ep_strdup_printf("(%s>=%s)",attributedesc_string,ldapvalue_string); #.FN_FTR Filter/lessOrEqual - Filter_string=ep_strdup_printf("(%s<=%s)",attributedesc_string,assertionvalue_string); + Filter_string=ep_strdup_printf("(%s<=%s)",attributedesc_string,ldapvalue_string); #.FN_FTR Filter/approxMatch - Filter_string=ep_strdup_printf("(%s~=%s)",attributedesc_string,assertionvalue_string); + Filter_string=ep_strdup_printf("(%s~=%s)",attributedesc_string,ldapvalue_string); #.FN_FTR Filter/and/_item if(and_filter_string){ @@ -537,7 +537,7 @@ ldap_conv_info_t *ldap_info; #.FN_HDR Filter/extensibleMatch attr_type=NULL; matching_rule_string=NULL; - assertionvalue_string=NULL; + ldapvalue_string=NULL; matching_rule_dnattr=FALSE; #.FN_FTR Filter/extensibleMatch @@ -546,7 +546,7 @@ ldap_conv_info_t *ldap_info; (matching_rule_dnattr?"dn:":""), (matching_rule_string?matching_rule_string:""), (matching_rule_string?":":""), - assertionvalue_string); + ldapvalue_string); #.FN_FTR SubstringFilter/substrings/_item if (substring_item_final) { diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c index a5f262a59b..3d2beec608 100644 --- a/asn1/ldap/packet-ldap-template.c +++ b/asn1/ldap/packet-ldap-template.c @@ -255,7 +255,7 @@ ldap_info_equal_unmatched(gconstpointer k1, gconstpointer k2) static char *attributedesc_string=NULL; /* This string contains the last AssertionValue that was decoded */ -static char *assertionvalue_string=NULL; +static char *ldapvalue_string=NULL; /* if the octet string contain all printable ASCII characters, then * display it as a string, othervise just display it in hex. @@ -296,7 +296,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, pa /* this octet string contains an NT SID */ sid_tvb=tvb_new_subset(tvb, offset, len, len); dissect_nt_sid(sid_tvb, 0, tree, "SID", &tmpstr, hf_index); - assertionvalue_string=ep_strdup(tmpstr); + ldapvalue_string=ep_strdup(tmpstr); g_free(tmpstr); goto finished; @@ -308,8 +308,8 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, pa /* This octet string contained a GUID */ dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep, hf_ldap_guid, &uuid); - assertionvalue_string=ep_alloc(1024); - g_snprintf(assertionvalue_string, 1023, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + ldapvalue_string=ep_alloc(1024); + g_snprintf(ldapvalue_string, 1023, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", uuid.Data1, uuid.Data2, uuid.Data3, uuid.Data4[0], uuid.Data4[1], uuid.Data4[2], uuid.Data4[3], @@ -342,19 +342,19 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, pa /* convert the string into a printable string */ if(is_ascii){ - assertionvalue_string=ep_alloc(len+1); - memcpy(assertionvalue_string,str,len); - assertionvalue_string[i]=0; + ldapvalue_string=ep_alloc(len+1); + memcpy(ldapvalue_string,str,len); + ldapvalue_string[i]=0; } else { - assertionvalue_string=ep_alloc(3*len); + ldapvalue_string=ep_alloc(3*len); for(i=0;i<len;i++){ - g_snprintf(assertionvalue_string+i*3,3,"%02x",str[i]&0xff); - assertionvalue_string[3*i+2]=':'; + g_snprintf(ldapvalue_string+i*3,3,"%02x",str[i]&0xff); + ldapvalue_string[3*i+2]=':'; } - assertionvalue_string[3*len-1]=0; + ldapvalue_string[3*len-1]=0; } - proto_tree_add_string(tree, hf_index, tvb, offset, len, assertionvalue_string); + proto_tree_add_string(tree, hf_index, tvb, offset, len, ldapvalue_string); finished: @@ -1171,6 +1171,23 @@ dissect_normal_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) return; } +static void +dissect_ldap_guid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + guint8 drep[4] = { 0x10, 0x00, 0x00, 0x00}; /* fake DREP struct */ + e_uuid_t uuid; + + /* This octet string contained a GUID */ + dissect_dcerpc_uuid_t(tvb, 0, pinfo, tree, drep, hf_ldap_guid, &uuid); + + ldapvalue_string=ep_alloc(1024); + g_snprintf(ldapvalue_string, 1023, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + uuid.Data1, uuid.Data2, uuid.Data3, + uuid.Data4[0], uuid.Data4[1], + uuid.Data4[2], uuid.Data4[3], + uuid.Data4[4], uuid.Data4[5], + uuid.Data4[6], uuid.Data4[7]); +} static void dissect_ldap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -1469,7 +1486,6 @@ void proto_register_ldap(void) { ldap_name_dissector_table = register_dissector_table("ldap.name", "LDAP Attribute Type Dissectors", FT_STRING, BASE_NONE); - } @@ -1512,7 +1528,7 @@ proto_reg_handoff_ldap(void) add_oid_str_name("2.16.840.1.113730.3.4.9","LDAP_CONTROL_VLVREQUEST VLV"); register_ldap_name_dissector("netlogon", dissect_NetLogon_PDU, proto_cldap); - + register_ldap_name_dissector("objectGUID", dissect_ldap_guid, proto_ldap); } |