diff options
-rw-r--r-- | asn1/ldap/Lightweight-Directory-Access-Protocol-V3.asn | 8 | ||||
-rw-r--r-- | asn1/ldap/ldap.cnf | 18 | ||||
-rw-r--r-- | asn1/ldap/packet-ldap-template.c | 10 | ||||
-rw-r--r-- | asn1/ldap/packet-ldap-template.h | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-ldap.c | 174 | ||||
-rw-r--r-- | epan/dissectors/packet-ldap.h | 1 |
6 files changed, 163 insertions, 49 deletions
diff --git a/asn1/ldap/Lightweight-Directory-Access-Protocol-V3.asn b/asn1/ldap/Lightweight-Directory-Access-Protocol-V3.asn index 05fd763dd8..8f05823e9b 100644 --- a/asn1/ldap/Lightweight-Directory-Access-Protocol-V3.asn +++ b/asn1/ldap/Lightweight-Directory-Access-Protocol-V3.asn @@ -39,7 +39,8 @@ ProtocolOp ::= CHOICE { compareResponse CompareResponse, abandonRequest AbandonRequest, extendedReq ExtendedRequest, - extendedResp ExtendedResponse + extendedResp ExtendedResponse, + intermediateResponse IntermediateResponse } @@ -372,6 +373,11 @@ ExtendedResponse ::= [APPLICATION 24] SEQUENCE { response [11] OCTET STRING OPTIONAL } +IntermediateResponse ::= [APPLICATION 25] SEQUENCE { + responseName [0] ResponseName OPTIONAL, + responseValue [1] OCTET STRING OPTIONAL +} + ResponseName ::= LDAPOID -- RFC 2696 - Simple Paged Results Manipulation diff --git a/asn1/ldap/ldap.cnf b/asn1/ldap/ldap.cnf index f80ff3a238..59cb3d5624 100644 --- a/asn1/ldap/ldap.cnf +++ b/asn1/ldap/ldap.cnf @@ -21,6 +21,7 @@ SearchResultEntry/_untag/attributes searchResultEntry_attributes ModifyRequest/_untag/modification modifyRequest_modification SubstringFilter/substrings substringFilter_substrings BindResponse/_untag/matchedDN bindResponse_matchedDN +IntermediateResponse/_untag/responseValue intermediateResponse_responseValue #.TYPE_ATTR LDAPString TYPE = FT_STRING DISPLAY = BASE_NONE STRINGS = NULL @@ -748,6 +749,23 @@ offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, &v %(DEFAULT_BODY)s } +#.FN_HDR IntermediateResponse/_untag/responseValue + + const gchar *name; + +#.FN_BODY IntermediateResponse/_untag/responseValue + if(ldm_tree) { + proto_item_set_text(ldm_tree, "%%s %%s", "IntermediateResponse", object_identifier_id); + name = oid_resolved_from_string(object_identifier_id); + if(name) + proto_item_append_text(ldm_tree, " (%%s)", name); + } + if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) { + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + } else { + %(DEFAULT_BODY)s + } + #.FN_BODY SearchResultReference %(DEFAULT_BODY)s diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c index 28f1eaad55..cd3d010343 100644 --- a/asn1/ldap/packet-ldap-template.c +++ b/asn1/ldap/packet-ldap-template.c @@ -75,6 +75,13 @@ * Gary Reynolds <gazzadownunder@yahoo.co.uk> */ +/* + * 09-DEC-2009 - Added support for RFC4533 + * Content Synchronization Operation (aka syncrepl) + * 11-DEC-2009 - Added support for IntermediateResponse (LDAP v3 from RFC 4511) + * Mathieu Parent <math.parent@gmail.com> + */ + #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -244,6 +251,7 @@ static const value_string ldap_ProtocolOp_choice_vals[] = { { 17, "abandonRequest" }, { 18, "extendedReq" }, { 19, "extendedResp" }, + { 20, "intermediateResponse" }, { 0, NULL } }; /* @@ -601,6 +609,7 @@ ldap_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu case LDAP_RES_MODRDN: case LDAP_RES_COMPARE: case LDAP_RES_EXTENDED: + case LDAP_RES_INTERMEDIATE: lcr.is_request=FALSE; lcr.req_frame=0; lcr.rep_frame=pinfo->fd->num; @@ -659,6 +668,7 @@ ldap_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu case LDAP_RES_MODRDN: case LDAP_RES_COMPARE: case LDAP_RES_EXTENDED: + case LDAP_RES_INTERMEDIATE: /* this is a result - it should be in our unmatched list */ diff --git a/asn1/ldap/packet-ldap-template.h b/asn1/ldap/packet-ldap-template.h index 8b4b6748d1..9d7941dbe7 100644 --- a/asn1/ldap/packet-ldap-template.h +++ b/asn1/ldap/packet-ldap-template.h @@ -52,6 +52,7 @@ #define LDAP_RES_MODRDN 13 #define LDAP_RES_COMPARE 15 #define LDAP_RES_EXTENDED 24 /* LDAP V3 only */ +#define LDAP_RES_INTERMEDIATE 25 /* LDAP V3 only */ /* * These are all CONTEXT types; the value is the type tag. diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c index ff714ba79b..b8c58ef7dd 100644 --- a/epan/dissectors/packet-ldap.c +++ b/epan/dissectors/packet-ldap.c @@ -83,6 +83,13 @@ * Gary Reynolds <gazzadownunder@yahoo.co.uk> */ +/* + * 09-DEC-2009 - Added support for RFC4533 + * Content Synchronization Operation (aka syncrepl) + * 11-DEC-2009 - Added support for IntermediateResponse (LDAP v3 from RFC 4511) + * Mathieu Parent <math.parent@gmail.com> + */ + #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -222,6 +229,7 @@ static int hf_ldap_compareResponse = -1; /* CompareResponse */ static int hf_ldap_abandonRequest = -1; /* AbandonRequest */ static int hf_ldap_extendedReq = -1; /* ExtendedRequest */ static int hf_ldap_extendedResp = -1; /* ExtendedResponse */ +static int hf_ldap_intermediateResponse = -1; /* IntermediateResponse */ static int hf_ldap_AttributeDescriptionList_item = -1; /* AttributeDescription */ static int hf_ldap_attributeDesc = -1; /* AttributeDescription */ static int hf_ldap_assertionValue = -1; /* AssertionValue */ @@ -298,6 +306,7 @@ static int hf_ldap_requestValue = -1; /* T_requestValue */ static int hf_ldap_extendedResponse_resultCode = -1; /* ExtendedResponse_resultCode */ static int hf_ldap_responseName = -1; /* ResponseName */ static int hf_ldap_response = -1; /* OCTET_STRING */ +static int hf_ldap_intermediateResponse_responseValue = -1; /* T_intermediateResponse_responseValue */ static int hf_ldap_size = -1; /* INTEGER */ static int hf_ldap_cookie = -1; /* OCTET_STRING */ static int hf_ldap_SortKeyList_item = -1; /* SortKeyList_item */ @@ -330,7 +339,7 @@ static int hf_ldap_graceAuthNsRemaining = -1; /* INTEGER_0_maxInt */ static int hf_ldap_error = -1; /* T_error */ /*--- End of included file: packet-ldap-hf.c ---*/ -#line 180 "packet-ldap-template.c" +#line 187 "packet-ldap-template.c" /* Initialize the subtree pointers */ static gint ett_ldap = -1; @@ -381,6 +390,7 @@ static gint ett_ldap_ModifyDNRequest_U = -1; static gint ett_ldap_CompareRequest_U = -1; static gint ett_ldap_ExtendedRequest_U = -1; static gint ett_ldap_ExtendedResponse_U = -1; +static gint ett_ldap_IntermediateResponse_U = -1; static gint ett_ldap_SearchControlValue = -1; static gint ett_ldap_SortKeyList = -1; static gint ett_ldap_SortKeyList_item = -1; @@ -401,7 +411,7 @@ static gint ett_ldap_PasswordPolicyResponseValue = -1; static gint ett_ldap_T_warning = -1; /*--- End of included file: packet-ldap-ett.c ---*/ -#line 191 "packet-ldap-template.c" +#line 198 "packet-ldap-template.c" static dissector_table_t ldap_name_dissector_table=NULL; static const char *object_identifier_id = NULL; /* LDAP OID */ @@ -458,6 +468,7 @@ static const value_string ldap_ProtocolOp_choice_vals[] = { { 17, "abandonRequest" }, { 18, "extendedReq" }, { 19, "extendedResp" }, + { 20, "intermediateResponse" }, { 0, NULL } }; /* @@ -815,6 +826,7 @@ ldap_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu case LDAP_RES_MODRDN: case LDAP_RES_COMPARE: case LDAP_RES_EXTENDED: + case LDAP_RES_INTERMEDIATE: lcr.is_request=FALSE; lcr.req_frame=0; lcr.rep_frame=pinfo->fd->num; @@ -873,6 +885,7 @@ ldap_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu case LDAP_RES_MODRDN: case LDAP_RES_COMPARE: case LDAP_RES_EXTENDED: + case LDAP_RES_INTERMEDIATE: /* this is a result - it should be in our unmatched list */ @@ -929,7 +942,7 @@ static int dissect_ldap_Filter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_ldap_MessageID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 99 "ldap.cnf" +#line 100 "ldap.cnf" offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, &MessageID); @@ -956,7 +969,7 @@ dissect_ldap_INTEGER_1_127(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_ldap_LDAPString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 326 "ldap.cnf" +#line 327 "ldap.cnf" tvbuff_t *parameter_tvb = NULL; char *ldapstring = NULL; gchar *sc = NULL; /* semi-colon pointer */ @@ -1067,7 +1080,7 @@ dissect_ldap_LDAPDN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_ static int dissect_ldap_Simple(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 169 "ldap.cnf" +#line 170 "ldap.cnf" ldap_conv_info_t *ldap_info; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, @@ -1088,7 +1101,7 @@ ldap_conv_info_t *ldap_info; static int dissect_ldap_Mechanism(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 179 "ldap.cnf" +#line 180 "ldap.cnf" ldap_conv_info_t *ldap_info; tvbuff_t *parameter_tvb; @@ -1136,7 +1149,7 @@ char *mechanism = NULL; static int dissect_ldap_Credentials(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 216 "ldap.cnf" +#line 217 "ldap.cnf" tvbuff_t *parameter_tvb; ldap_conv_info_t *ldap_info; @@ -1202,7 +1215,7 @@ dissect_ldap_SaslCredentials(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_ldap_T_ntlmsspNegotiate(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 695 "ldap.cnf" +#line 696 "ldap.cnf" /* make sure the protocol op comes first */ ldap_do_protocolop(actx->pinfo); @@ -1218,7 +1231,7 @@ dissect_ldap_T_ntlmsspNegotiate(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in static int dissect_ldap_T_ntlmsspAuth(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 702 "ldap.cnf" +#line 703 "ldap.cnf" /* make sure the protocol op comes first */ ldap_do_protocolop(actx->pinfo); @@ -1249,7 +1262,7 @@ static const ber_choice_t AuthenticationChoice_choice[] = { static int dissect_ldap_AuthenticationChoice(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 501 "ldap.cnf" +#line 502 "ldap.cnf" gint branch = -1; gint auth = -1; const gchar *valstr; @@ -1356,7 +1369,7 @@ static const value_string ldap_BindResponse_resultCode_vals[] = { static int dissect_ldap_BindResponse_resultCode(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 451 "ldap.cnf" +#line 452 "ldap.cnf" const gchar *valstr; @@ -1384,7 +1397,7 @@ dissect_ldap_BindResponse_resultCode(gboolean implicit_tag _U_, tvbuff_t *tvb _U static int dissect_ldap_T_bindResponse_matchedDN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 709 "ldap.cnf" +#line 710 "ldap.cnf" tvbuff_t *new_tvb=NULL; offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_ldap_matchedDN, &new_tvb); @@ -1421,7 +1434,7 @@ dissect_ldap_LDAPURL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); -#line 50 "ldap.cnf" +#line 51 "ldap.cnf" PROTO_ITEM_SET_URL(actx->created_item); @@ -1445,7 +1458,7 @@ dissect_ldap_Referral(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _ static int dissect_ldap_ServerSaslCreds(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 256 "ldap.cnf" +#line 257 "ldap.cnf" tvbuff_t *parameter_tvb; ldap_conv_info_t *ldap_info; @@ -1563,7 +1576,7 @@ dissect_ldap_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, static int dissect_ldap_UnbindRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 523 "ldap.cnf" +#line 524 "ldap.cnf" implicit_tag = TRUE; /* correct problem with asn2wrs */ @@ -1593,7 +1606,7 @@ static const value_string ldap_T_scope_vals[] = { static int dissect_ldap_T_scope(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 417 "ldap.cnf" +#line 418 "ldap.cnf" gint scope; const gchar *valstr; @@ -1660,7 +1673,7 @@ static int dissect_ldap_T_and_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 565 "ldap.cnf" +#line 566 "ldap.cnf" if(and_filter_string){ and_filter_string=ep_strdup_printf("(&%s%s)",and_filter_string,Filter_string); } else { @@ -1678,7 +1691,7 @@ static const ber_sequence_t T_and_set_of[1] = { static int dissect_ldap_T_and(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 572 "ldap.cnf" +#line 573 "ldap.cnf" proto_tree *tr=NULL; proto_item *it=NULL; char *old_and_filter_string=and_filter_string; @@ -1711,7 +1724,7 @@ static int dissect_ldap_T_or_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 592 "ldap.cnf" +#line 593 "ldap.cnf" if(or_filter_string){ or_filter_string=ep_strdup_printf("(|%s%s)",or_filter_string,Filter_string); } else { @@ -1730,7 +1743,7 @@ static const ber_sequence_t T_or_set_of[1] = { static int dissect_ldap_T_or(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 600 "ldap.cnf" +#line 601 "ldap.cnf" proto_tree *tr=NULL; proto_item *it=NULL; char *old_or_filter_string=or_filter_string; @@ -1761,7 +1774,7 @@ static int dissect_ldap_T_not(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 621 "ldap.cnf" +#line 622 "ldap.cnf" Filter_string=ep_strdup_printf("(!%s)",string_or_null(Filter_string)); @@ -1799,7 +1812,7 @@ static int dissect_ldap_T_equalityMatch(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ldap_AttributeValueAssertion(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 542 "ldap.cnf" +#line 543 "ldap.cnf" Filter_string=ep_strdup_printf("(%s=%s)", string_or_null(attributedesc_string), string_or_null(ldapvalue_string)); @@ -1830,7 +1843,7 @@ dissect_ldap_T_substringFilter_substrings_item(gboolean implicit_tag _U_, tvbuff T_substringFilter_substrings_item_choice, hf_index, ett_ldap_T_substringFilter_substrings_item, NULL); -#line 647 "ldap.cnf" +#line 648 "ldap.cnf" if (substring_item_final) { substring_value=ep_strdup_printf("%s%s", (substring_value?substring_value:"*"), @@ -1870,7 +1883,7 @@ static const ber_sequence_t SubstringFilter_sequence[] = { static int dissect_ldap_SubstringFilter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 661 "ldap.cnf" +#line 662 "ldap.cnf" proto_tree *tr=NULL; proto_item *it=NULL; char *old_substring_value=substring_value; @@ -1904,7 +1917,7 @@ static int dissect_ldap_T_greaterOrEqual(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ldap_AttributeValueAssertion(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 548 "ldap.cnf" +#line 549 "ldap.cnf" Filter_string=ep_strdup_printf("(%s>=%s)", string_or_null(attributedesc_string), string_or_null(ldapvalue_string)); @@ -1920,7 +1933,7 @@ static int dissect_ldap_T_lessOrEqual(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ldap_AttributeValueAssertion(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 554 "ldap.cnf" +#line 555 "ldap.cnf" Filter_string=ep_strdup_printf("(%s<=%s)", string_or_null(attributedesc_string), string_or_null(ldapvalue_string)); @@ -1936,7 +1949,7 @@ static int dissect_ldap_T_present(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ldap_AttributeDescription(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 618 "ldap.cnf" +#line 619 "ldap.cnf" Filter_string=ep_strdup_printf("(%s=*)",string_or_null(Filter_string)); @@ -1949,7 +1962,7 @@ static int dissect_ldap_T_approxMatch(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ldap_AttributeValueAssertion(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 560 "ldap.cnf" +#line 561 "ldap.cnf" Filter_string=ep_strdup_printf("(%s~=%s)", string_or_null(attributedesc_string), string_or_null(ldapvalue_string)); @@ -1971,7 +1984,7 @@ dissect_ldap_MatchingRuleId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of static int dissect_ldap_T_dnAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 624 "ldap.cnf" +#line 625 "ldap.cnf" gboolean val; offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, &val); @@ -2006,7 +2019,7 @@ dissect_ldap_MatchingRuleAssertion(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, static int dissect_ldap_T_extensibleMatch(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 633 "ldap.cnf" +#line 634 "ldap.cnf" attr_type=NULL; matching_rule_string=NULL; ldapvalue_string=NULL; @@ -2015,7 +2028,7 @@ dissect_ldap_T_extensibleMatch(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset = dissect_ldap_MatchingRuleAssertion(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 639 "ldap.cnf" +#line 640 "ldap.cnf" Filter_string=ep_strdup_printf("(%s:%s%s%s=%s)", (attr_type?attr_type:""), (matching_rule_dnattr?"dn:":""), @@ -2058,7 +2071,7 @@ static const ber_choice_t Filter_choice[] = { static int dissect_ldap_Filter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 682 "ldap.cnf" +#line 683 "ldap.cnf" proto_tree *tr=NULL; proto_item *it=NULL; @@ -2083,13 +2096,13 @@ dissect_ldap_Filter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_ static int dissect_ldap_T_filter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 535 "ldap.cnf" +#line 536 "ldap.cnf" Filter_string=NULL; offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 538 "ldap.cnf" +#line 539 "ldap.cnf" Filter_string=NULL; and_filter_string=NULL; @@ -2145,7 +2158,7 @@ dissect_ldap_SearchRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_ldap_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 468 "ldap.cnf" +#line 469 "ldap.cnf" tvbuff_t *next_tvb; gchar *string; @@ -2302,7 +2315,7 @@ static const value_string ldap_T_resultCode_vals[] = { static int dissect_ldap_T_resultCode(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 434 "ldap.cnf" +#line 435 "ldap.cnf" const gchar *valstr; @@ -2370,7 +2383,7 @@ dissect_ldap_SEQUENCE_OF_LDAPURL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i static int dissect_ldap_SearchResultReference(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 752 "ldap.cnf" +#line 770 "ldap.cnf" offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, hf_index, BER_CLASS_APP, 19, TRUE, dissect_ldap_SEQUENCE_OF_LDAPURL); @@ -2647,7 +2660,7 @@ dissect_ldap_CompareResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_ldap_AbandonRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 759 "ldap.cnf" +#line 777 "ldap.cnf" offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, hf_index, BER_CLASS_APP, 16, TRUE, dissect_ldap_MessageID); @@ -2665,7 +2678,7 @@ dissect_ldap_AbandonRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of static int dissect_ldap_LDAPOID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 53 "ldap.cnf" +#line 54 "ldap.cnf" tvbuff_t *parameter_tvb; const gchar *name; @@ -2674,7 +2687,7 @@ dissect_ldap_LDAPOID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, ¶meter_tvb); -#line 60 "ldap.cnf" +#line 61 "ldap.cnf" object_identifier_id = NULL; @@ -2721,7 +2734,7 @@ dissect_ldap_LDAPOID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U static int dissect_ldap_T_requestValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 744 "ldap.cnf" +#line 745 "ldap.cnf" if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) { offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); @@ -2867,6 +2880,60 @@ dissect_ldap_ExtendedResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int } + +static int +dissect_ldap_T_intermediateResponse_responseValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { +#line 753 "ldap.cnf" + + const gchar *name; + + +#line 757 "ldap.cnf" + if(ldm_tree) { + proto_item_set_text(ldm_tree, "%s %s", "IntermediateResponse", object_identifier_id); + name = oid_resolved_from_string(object_identifier_id); + if(name) + proto_item_append_text(ldm_tree, " (%s)", name); + } + if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) { + offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + } else { + offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, + NULL); + + } + + + + return offset; +} + + +static const ber_sequence_t IntermediateResponse_U_sequence[] = { + { &hf_ldap_responseName , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_ResponseName }, + { &hf_ldap_intermediateResponse_responseValue, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_T_intermediateResponse_responseValue }, + { NULL, 0, 0, 0, NULL } +}; + +static int +dissect_ldap_IntermediateResponse_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, + IntermediateResponse_U_sequence, hf_index, ett_ldap_IntermediateResponse_U); + + return offset; +} + + + +static int +dissect_ldap_IntermediateResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, + hf_index, BER_CLASS_APP, 25, TRUE, dissect_ldap_IntermediateResponse_U); + + return offset; +} + + static const value_string ldap_ProtocolOp_vals[] = { { 0, "bindRequest" }, { 1, "bindResponse" }, @@ -2888,6 +2955,7 @@ static const value_string ldap_ProtocolOp_vals[] = { { 16, "abandonRequest" }, { 23, "extendedReq" }, { 24, "extendedResp" }, + { 25, "intermediateResponse" }, { 0, NULL } }; @@ -2912,12 +2980,13 @@ static const ber_choice_t ProtocolOp_choice[] = { { 16, &hf_ldap_abandonRequest , BER_CLASS_APP, 16, BER_FLAGS_NOOWNTAG, dissect_ldap_AbandonRequest }, { 23, &hf_ldap_extendedReq , BER_CLASS_APP, 23, BER_FLAGS_NOOWNTAG, dissect_ldap_ExtendedRequest }, { 24, &hf_ldap_extendedResp , BER_CLASS_APP, 24, BER_FLAGS_NOOWNTAG, dissect_ldap_ExtendedResponse }, + { 25, &hf_ldap_intermediateResponse, BER_CLASS_APP, 25, BER_FLAGS_NOOWNTAG, dissect_ldap_IntermediateResponse }, { 0, NULL, 0, 0, 0, NULL } }; static int dissect_ldap_ProtocolOp(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 107 "ldap.cnf" +#line 108 "ldap.cnf" ldap_call_response_t *lcrp; ldap_conv_info_t *ldap_info = (ldap_conv_info_t *)actx->pinfo->private_data; @@ -2928,7 +2997,7 @@ dissect_ldap_ProtocolOp(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset ProtocolOp_choice, hf_index, ett_ldap_ProtocolOp, &ProtocolOp); -#line 113 "ldap.cnf" +#line 114 "ldap.cnf" if (ProtocolOp == -1) { return offset; @@ -3001,7 +3070,7 @@ dissect_ldap_ControlType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse static int dissect_ldap_T_controlValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 725 "ldap.cnf" +#line 726 "ldap.cnf" gint8 class; gboolean pc, ind; gint32 tag; @@ -3529,7 +3598,7 @@ static void dissect_PasswordPolicyResponseValue_PDU(tvbuff_t *tvb _U_, packet_in /*--- End of included file: packet-ldap-fn.c ---*/ -#line 704 "packet-ldap-template.c" +#line 714 "packet-ldap-template.c" static void dissect_ldap_payload(tvbuff_t *tvb, packet_info *pinfo, @@ -5045,6 +5114,10 @@ void proto_register_ldap(void) { { "extendedResp", "ldap.extendedResp", FT_NONE, BASE_NONE, NULL, 0, "ldap.ExtendedResponse", HFILL }}, + { &hf_ldap_intermediateResponse, + { "intermediateResponse", "ldap.intermediateResponse", + FT_NONE, BASE_NONE, NULL, 0, + "ldap.IntermediateResponse", HFILL }}, { &hf_ldap_AttributeDescriptionList_item, { "AttributeDescription", "ldap.AttributeDescription", FT_STRING, BASE_NONE, NULL, 0, @@ -5349,6 +5422,10 @@ void proto_register_ldap(void) { { "response", "ldap.response", FT_BYTES, BASE_NONE, NULL, 0, "ldap.OCTET_STRING", HFILL }}, + { &hf_ldap_intermediateResponse_responseValue, + { "responseValue", "ldap.responseValue", + FT_BYTES, BASE_NONE, NULL, 0, + "ldap.T_intermediateResponse_responseValue", HFILL }}, { &hf_ldap_size, { "size", "ldap.size", FT_INT32, BASE_DEC, NULL, 0, @@ -5471,7 +5548,7 @@ void proto_register_ldap(void) { "ldap.T_error", HFILL }}, /*--- End of included file: packet-ldap-hfarr.c ---*/ -#line 2077 "packet-ldap-template.c" +#line 2087 "packet-ldap-template.c" }; /* List of subtrees */ @@ -5524,6 +5601,7 @@ void proto_register_ldap(void) { &ett_ldap_CompareRequest_U, &ett_ldap_ExtendedRequest_U, &ett_ldap_ExtendedResponse_U, + &ett_ldap_IntermediateResponse_U, &ett_ldap_SearchControlValue, &ett_ldap_SortKeyList, &ett_ldap_SortKeyList_item, @@ -5544,7 +5622,7 @@ void proto_register_ldap(void) { &ett_ldap_T_warning, /*--- End of included file: packet-ldap-ettarr.c ---*/ -#line 2090 "packet-ldap-template.c" +#line 2100 "packet-ldap-template.c" }; module_t *ldap_module; @@ -5675,7 +5753,7 @@ proto_reg_handoff_ldap(void) /*--- End of included file: packet-ldap-dis-tab.c ---*/ -#line 2204 "packet-ldap-template.c" +#line 2214 "packet-ldap-template.c" } diff --git a/epan/dissectors/packet-ldap.h b/epan/dissectors/packet-ldap.h index b73fc99ccb..b7f924b72b 100644 --- a/epan/dissectors/packet-ldap.h +++ b/epan/dissectors/packet-ldap.h @@ -60,6 +60,7 @@ #define LDAP_RES_MODRDN 13 #define LDAP_RES_COMPARE 15 #define LDAP_RES_EXTENDED 24 /* LDAP V3 only */ +#define LDAP_RES_INTERMEDIATE 25 /* LDAP V3 only */ /* * These are all CONTEXT types; the value is the type tag. |