Dissect LDAP strings as UTF-8.

This requires some special hackery, including a new packet-ber.c
routine, as those strings are just OCTET STRINGs, not UTF8Strings.

Change-Id: I776ed47f7400eba366a630b60b94be3397f7b45f
Reviewed-on: https://code.wireshark.org/review/33403
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2019-05-27 20:15:38 -07:00
parent c79145cffe
commit f72e504817
6 changed files with 143 additions and 128 deletions

View File

@ -287,6 +287,7 @@ libwireshark.so.0 libwireshark0 #MINVER#
dissect_ber_object_identifier@Base 1.9.1
dissect_ber_object_identifier_str@Base 1.9.1
dissect_ber_octet_string@Base 1.9.1
dissect_ber_octet_string_with_encoding@Base 3.1.0
dissect_ber_real@Base 1.99.2
dissect_ber_relative_oid@Base 1.12.0~rc1
dissect_ber_relative_oid_str@Base 1.12.0~rc1

View File

@ -25,7 +25,7 @@ BindResponse/_untag/matchedDN bindResponse_matchedDN
IntermediateResponse/_untag/responseValue intermediateResponse_responseValue
#.TYPE_ATTR
LDAPString TYPE = FT_STRING DISPLAY = BASE_NONE STRINGS = NULL
LDAPString TYPE = FT_STRING DISPLAY = STR_UNICODE STRINGS = NULL
LDAPURL TYPE = FT_STRING DISPLAY = BASE_NONE STRINGS = NULL
LDAPOID TYPE = FT_STRING DISPLAY = BASE_NONE STRINGS = NULL
Mechanism TYPE = FT_STRING DISPLAY = BASE_NONE STRINGS = NULL
@ -302,7 +302,8 @@ ldap_conv_info_t *ldap_info;
const char *ldapstring = NULL;
gchar *sc = NULL; /* semi-colon pointer */
%(DEFAULT_BODY)s
offset = dissect_ber_octet_string_with_encoding(implicit_tag, actx, tree, tvb, offset, hf_index,
&parameter_tvb, ENC_UTF_8|ENC_NA);
if (parameter_tvb || (hf_index == hf_ldap_baseObject)) {
@ -470,7 +471,7 @@ ldap_conv_info_t *ldap_info;
%(DEFAULT_BODY)s
if(tvb_ascii_isprint(next_tvb, 0, tvb_reported_length(next_tvb))) {
string = tvb_get_string_enc(wmem_packet_scope(), next_tvb, 0, tvb_reported_length_remaining(next_tvb, 0), ENC_ASCII|ENC_NA);
string = tvb_get_string_enc(wmem_packet_scope(), next_tvb, 0, tvb_reported_length_remaining(next_tvb, 0), ENC_UTF_8|ENC_NA);
proto_item_set_text(actx->created_item, "AttributeValue: %%s", string);
}
}

View File

@ -714,7 +714,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, as
/* convert the string into a printable string */
if(is_ascii){
ldapvalue_string= tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_ASCII);
ldapvalue_string= tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_UTF_8|ENC_NA);
} else {
ldapvalue_string= tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, offset, len, ':');
}

View File

@ -1434,7 +1434,7 @@ proto_tree_add_debug_text("dissect BER length %d, offset %d (remaining %d)\n", t
static reassembly_table octet_segment_reassembly_table;
static int
dissect_ber_constrained_octet_string_impl(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint32 min_len, gint32 max_len, gint hf_id, tvbuff_t **out_tvb, guint nest_level);
dissect_ber_constrained_octet_string_impl(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint32 min_len, gint32 max_len, gint hf_id, tvbuff_t **out_tvb, guint nest_level, guint encoding);
static int
reassemble_octet_string(asn1_ctx_t *actx, proto_tree *tree, gint hf_id, tvbuff_t *tvb, int offset, guint32 con_len, gboolean ind, tvbuff_t **out_tvb, guint nest_level)
@ -1466,7 +1466,7 @@ reassemble_octet_string(asn1_ctx_t *actx, proto_tree *tree, gint hf_id, tvbuff_t
while(!fd_head) {
offset = dissect_ber_constrained_octet_string_impl(FALSE, actx, NULL,
tvb, offset, NO_BOUND, NO_BOUND, hf_id, &next_tvb, nest_level + 1);
tvb, offset, NO_BOUND, NO_BOUND, hf_id, &next_tvb, nest_level + 1, 0);
if (next_tvb == NULL) {
/* Assume that we have a malformed packet. */
@ -1542,11 +1542,11 @@ reassemble_octet_string(asn1_ctx_t *actx, proto_tree *tree, gint hf_id, tvbuff_t
/* 8.7 Encoding of an octetstring value */
int
dissect_ber_constrained_octet_string(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint32 min_len, gint32 max_len, gint hf_id, tvbuff_t **out_tvb) {
return dissect_ber_constrained_octet_string_impl(implicit_tag, actx, tree, tvb, offset, min_len, max_len, hf_id, out_tvb, 0);
return dissect_ber_constrained_octet_string_impl(implicit_tag, actx, tree, tvb, offset, min_len, max_len, hf_id, out_tvb, 0, 0);
}
static int
dissect_ber_constrained_octet_string_impl(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint32 min_len, gint32 max_len, gint hf_id, tvbuff_t **out_tvb, guint nest_level) {
dissect_ber_constrained_octet_string_impl(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint32 min_len, gint32 max_len, gint hf_id, tvbuff_t **out_tvb, guint nest_level, guint encoding) {
gint8 ber_class;
gboolean pc, ind;
gint32 tag;
@ -1556,7 +1556,6 @@ dissect_ber_constrained_octet_string_impl(gboolean implicit_tag, asn1_ctx_t *act
tvbuff_t *len_tvb;
int len_offset;
int len_len;
guint encoding;
int hoffset;
int end_offset;
proto_item *it, *cause;
@ -1696,73 +1695,82 @@ proto_tree_add_debug_text(tree, "OCTET STRING dissect_ber_octet_string(%s) enter
* http://kikaku.itscj.ipsj.or.jp/ISO-IR/overview.htm
*
* for that registry.
*
* If we've been provided with a non-zero encoding, use
* that; otherwise, calculate it based on the tag. (A
* zero encoding is ENC_ASCII|ENC_NA/ENC_BIG_ENDIAN, which
* is the default, so it's OK to use here; this is for
* protcols such as LDAP that use OCTET STRING for UTF-8
* strings.)
*/
switch (tag) {
if (encoding == 0) {
switch (tag) {
case BER_UNI_TAG_UTF8String:
/*
* UTF-8, obviously.
*/
encoding = ENC_UTF_8|ENC_NA;
break;
case BER_UNI_TAG_UTF8String:
/*
* UTF-8, obviously.
*/
encoding = ENC_UTF_8|ENC_NA;
break;
case BER_UNI_TAG_NumericString:
case BER_UNI_TAG_PrintableString:
case BER_UNI_TAG_VisibleString:
case BER_UNI_TAG_IA5String:
/*
* (Subsets of) Boring Old ASCII, with no(?) ISO 2022
* escape sequences.
*/
encoding = ENC_ASCII|ENC_NA;
break;
case BER_UNI_TAG_NumericString:
case BER_UNI_TAG_PrintableString:
case BER_UNI_TAG_VisibleString:
case BER_UNI_TAG_IA5String:
/*
* (Subsets of) Boring Old ASCII, with no(?) ISO 2022
* escape sequences.
*/
encoding = ENC_ASCII|ENC_NA;
break;
case BER_UNI_TAG_TeletexString:
encoding = ENC_T61|ENC_NA;
break;
case BER_UNI_TAG_TeletexString:
encoding = ENC_T61|ENC_NA;
break;
case BER_UNI_TAG_VideotexString:
encoding = ENC_T61|ENC_NA;
break;
case BER_UNI_TAG_VideotexString:
encoding = ENC_T61|ENC_NA;
break;
case BER_UNI_TAG_GraphicString:
case BER_UNI_TAG_GeneralString:
/*
* One of the types defined in terms of character sets
* in the ISO International Register of Character Sets,
* with the BER encoding being ISO 2022-based.
*
* XXX - treat as ASCII for now.
*/
encoding = ENC_ASCII|ENC_NA;
break;
case BER_UNI_TAG_GraphicString:
case BER_UNI_TAG_GeneralString:
/*
* One of the types defined in terms of character sets
* in the ISO International Register of Character Sets,
* with the BER encoding being ISO 2022-based.
*
* XXX - treat as ASCII for now.
*/
encoding = ENC_ASCII|ENC_NA;
break;
case BER_UNI_TAG_UniversalString:
/*
* UCS-4.
*/
encoding = ENC_UCS_4|ENC_BIG_ENDIAN;
break;
case BER_UNI_TAG_UniversalString:
/*
* UCS-4.
*/
encoding = ENC_UCS_4|ENC_BIG_ENDIAN;
break;
case BER_UNI_TAG_CHARACTERSTRING:
/*
* XXX - what's the transfer syntax?
* Treat as ASCII for now.
*/
encoding = ENC_ASCII|ENC_NA;
break;
case BER_UNI_TAG_CHARACTERSTRING:
/*
* XXX - what's the transfer syntax?
* Treat as ASCII for now.
*/
encoding = ENC_ASCII|ENC_NA;
break;
case BER_UNI_TAG_BMPString:
/*
* UCS-2, not UTF-16; as it says, BMP, as in Basic
* Multilingual Plane.
*/
encoding = ENC_UCS_2|ENC_BIG_ENDIAN;
break;
case BER_UNI_TAG_BMPString:
/*
* UCS-2, not UTF-16; as it says, BMP, as in Basic
* Multilingual Plane.
*/
encoding = ENC_UCS_2|ENC_BIG_ENDIAN;
break;
default:
encoding = ENC_BIG_ENDIAN;
break;
default:
encoding = ENC_BIG_ENDIAN;
break;
}
}
it = ber_proto_tree_add_item(actx->pinfo, tree, hf_id, tvb, offset, length_remaining, encoding);
actx->created_item = it;
@ -1781,7 +1789,12 @@ proto_tree_add_debug_text(tree, "OCTET STRING dissect_ber_octet_string(%s) enter
int
dissect_ber_octet_string(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **out_tvb) {
return dissect_ber_constrained_octet_string(implicit_tag, actx, tree, tvb, offset, NO_BOUND, NO_BOUND, hf_id, out_tvb);
return dissect_ber_constrained_octet_string_impl(implicit_tag, actx, tree, tvb, offset, NO_BOUND, NO_BOUND, hf_id, out_tvb, 0, 0);
}
int
dissect_ber_octet_string_with_encoding(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **out_tvb, guint encoding) {
return dissect_ber_constrained_octet_string_impl(implicit_tag, actx, tree, tvb, offset, NO_BOUND, NO_BOUND, hf_id, out_tvb, 0, encoding);
}
int

View File

@ -89,6 +89,7 @@ WS_DLL_PUBLIC int dissect_ber_tagged_type(gboolean implicit_tag, asn1_ctx_t *act
extern int dissect_ber_constrained_octet_string(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint32 min_len, gint32 max_len, gint hf_id, tvbuff_t **out_tvb);
WS_DLL_PUBLIC int dissect_ber_octet_string(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **out_tvb);
WS_DLL_PUBLIC int dissect_ber_octet_string_with_encoding(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **out_tvb, guint encoding);
extern int dissect_ber_octet_string_wcb(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, ber_callback func);
WS_DLL_PUBLIC int dissect_ber_integer64(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, gint64 *value);

View File

@ -928,7 +928,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, as
/* convert the string into a printable string */
if(is_ascii){
ldapvalue_string= tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_ASCII);
ldapvalue_string= tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_UTF_8|ENC_NA);
} else {
ldapvalue_string= tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, offset, len, ':');
}
@ -1163,9 +1163,8 @@ dissect_ldap_LDAPString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
const char *ldapstring = NULL;
gchar *sc = NULL; /* semi-colon pointer */
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
&parameter_tvb);
offset = dissect_ber_octet_string_with_encoding(implicit_tag, actx, tree, tvb, offset, hf_index,
&parameter_tvb, ENC_UTF_8|ENC_NA);
if (parameter_tvb || (hf_index == hf_ldap_baseObject)) {
@ -1396,7 +1395,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 682 "./asn1/ldap/ldap.cnf"
#line 683 "./asn1/ldap/ldap.cnf"
/* make sure the protocol op comes first */
ldap_do_protocolop(actx->pinfo);
@ -1412,7 +1411,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 689 "./asn1/ldap/ldap.cnf"
#line 690 "./asn1/ldap/ldap.cnf"
/* make sure the protocol op comes first */
ldap_do_protocolop(actx->pinfo);
@ -1443,7 +1442,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 479 "./asn1/ldap/ldap.cnf"
#line 480 "./asn1/ldap/ldap.cnf"
gint branch = -1;
gint auth = -1;
const gchar *valstr;
@ -1550,7 +1549,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 420 "./asn1/ldap/ldap.cnf"
#line 421 "./asn1/ldap/ldap.cnf"
const gchar *valstr;
@ -1576,7 +1575,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 696 "./asn1/ldap/ldap.cnf"
#line 697 "./asn1/ldap/ldap.cnf"
tvbuff_t *new_tvb=NULL;
offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_ldap_matchedDN, &new_tvb);
@ -1754,7 +1753,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 501 "./asn1/ldap/ldap.cnf"
#line 502 "./asn1/ldap/ldap.cnf"
implicit_tag = TRUE; /* correct problem with asn2wrs */
@ -1784,7 +1783,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 388 "./asn1/ldap/ldap.cnf"
#line 389 "./asn1/ldap/ldap.cnf"
guint32 scope = 0xffff;
const gchar *valstr;
@ -1850,7 +1849,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 547 "./asn1/ldap/ldap.cnf"
#line 548 "./asn1/ldap/ldap.cnf"
if(and_filter_string){
and_filter_string=wmem_strdup_printf(wmem_packet_scope(), "(&%s%s)",and_filter_string,Filter_string);
} else {
@ -1868,7 +1867,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 554 "./asn1/ldap/ldap.cnf"
#line 555 "./asn1/ldap/ldap.cnf"
proto_tree *tr=NULL;
proto_item *it=NULL;
const char *old_and_filter_string=and_filter_string;
@ -1899,7 +1898,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 572 "./asn1/ldap/ldap.cnf"
#line 573 "./asn1/ldap/ldap.cnf"
if(or_filter_string){
or_filter_string=wmem_strdup_printf(wmem_packet_scope(), "(|%s%s)",or_filter_string,Filter_string);
} else {
@ -1918,7 +1917,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 580 "./asn1/ldap/ldap.cnf"
#line 581 "./asn1/ldap/ldap.cnf"
proto_tree *tr;
proto_item *it;
const char *old_or_filter_string=or_filter_string;
@ -1947,7 +1946,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 599 "./asn1/ldap/ldap.cnf"
#line 600 "./asn1/ldap/ldap.cnf"
Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(!%s)",string_or_null(Filter_string));
@ -1985,7 +1984,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 524 "./asn1/ldap/ldap.cnf"
#line 525 "./asn1/ldap/ldap.cnf"
Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s=%s)",
string_or_null(attributedesc_string),
string_or_null(ldapvalue_string));
@ -2016,7 +2015,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 625 "./asn1/ldap/ldap.cnf"
#line 626 "./asn1/ldap/ldap.cnf"
if (substring_item_final) {
substring_value=wmem_strdup_printf(wmem_packet_scope(), "%s%s",
(substring_value?substring_value:"*"),
@ -2056,7 +2055,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 639 "./asn1/ldap/ldap.cnf"
#line 640 "./asn1/ldap/ldap.cnf"
proto_tree *tr;
proto_item *it;
const char *old_substring_value=substring_value;
@ -2090,7 +2089,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 530 "./asn1/ldap/ldap.cnf"
#line 531 "./asn1/ldap/ldap.cnf"
Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s>=%s)",
string_or_null(attributedesc_string),
string_or_null(ldapvalue_string));
@ -2106,7 +2105,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 536 "./asn1/ldap/ldap.cnf"
#line 537 "./asn1/ldap/ldap.cnf"
Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s<=%s)",
string_or_null(attributedesc_string),
string_or_null(ldapvalue_string));
@ -2122,7 +2121,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 596 "./asn1/ldap/ldap.cnf"
#line 597 "./asn1/ldap/ldap.cnf"
Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s=*)",string_or_null(Filter_string));
@ -2135,7 +2134,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 542 "./asn1/ldap/ldap.cnf"
#line 543 "./asn1/ldap/ldap.cnf"
Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s~=%s)",
string_or_null(attributedesc_string),
string_or_null(ldapvalue_string));
@ -2157,7 +2156,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 602 "./asn1/ldap/ldap.cnf"
#line 603 "./asn1/ldap/ldap.cnf"
gboolean val;
offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, &val);
@ -2192,7 +2191,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 611 "./asn1/ldap/ldap.cnf"
#line 612 "./asn1/ldap/ldap.cnf"
attr_type=NULL;
matching_rule_string=NULL;
ldapvalue_string=NULL;
@ -2201,7 +2200,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 617 "./asn1/ldap/ldap.cnf"
#line 618 "./asn1/ldap/ldap.cnf"
Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s:%s%s%s=%s)",
(attr_type?attr_type:""),
(matching_rule_dnattr?"dn:":""),
@ -2244,7 +2243,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 660 "./asn1/ldap/ldap.cnf"
#line 661 "./asn1/ldap/ldap.cnf"
proto_tree *tr;
proto_item *it;
attributedesc_string=NULL;
@ -2278,7 +2277,7 @@ 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 513 "./asn1/ldap/ldap.cnf"
#line 514 "./asn1/ldap/ldap.cnf"
Filter_string=NULL;
Filter_elements = 0;
Filter_length = 0;
@ -2286,7 +2285,7 @@ dissect_ldap_T_filter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _
offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index);
#line 518 "./asn1/ldap/ldap.cnf"
#line 519 "./asn1/ldap/ldap.cnf"
Filter_string=NULL;
and_filter_string=NULL;
Filter_elements = 0;
@ -2344,7 +2343,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 450 "./asn1/ldap/ldap.cnf"
#line 451 "./asn1/ldap/ldap.cnf"
tvbuff_t *next_tvb = NULL;
gchar *string;
@ -2370,7 +2369,7 @@ dissect_ldap_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
if(tvb_ascii_isprint(next_tvb, 0, tvb_reported_length(next_tvb))) {
string = tvb_get_string_enc(wmem_packet_scope(), next_tvb, 0, tvb_reported_length_remaining(next_tvb, 0), ENC_ASCII|ENC_NA);
string = tvb_get_string_enc(wmem_packet_scope(), next_tvb, 0, tvb_reported_length_remaining(next_tvb, 0), ENC_UTF_8|ENC_NA);
proto_item_set_text(actx->created_item, "AttributeValue: %s", string);
}
}
@ -2497,7 +2496,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 404 "./asn1/ldap/ldap.cnf"
#line 405 "./asn1/ldap/ldap.cnf"
const gchar *valstr;
@ -2564,7 +2563,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 788 "./asn1/ldap/ldap.cnf"
#line 789 "./asn1/ldap/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);
@ -2842,7 +2841,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 795 "./asn1/ldap/ldap.cnf"
#line 796 "./asn1/ldap/ldap.cnf"
offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
hf_index, BER_CLASS_APP, 16, TRUE, dissect_ldap_MessageID);
@ -2903,7 +2902,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 730 "./asn1/ldap/ldap.cnf"
#line 731 "./asn1/ldap/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, NULL);
@ -2994,7 +2993,7 @@ static const value_string ldap_ExtendedResponse_resultCode_vals[] = {
static int
dissect_ldap_ExtendedResponse_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 435 "./asn1/ldap/ldap.cnf"
#line 436 "./asn1/ldap/ldap.cnf"
guint32 resultCode;
ldap_conv_info_t *ldap_info = (ldap_conv_info_t *)actx->private_data;
@ -3066,12 +3065,12 @@ 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 738 "./asn1/ldap/ldap.cnf"
#line 739 "./asn1/ldap/ldap.cnf"
const gchar *name;
#line 742 "./asn1/ldap/ldap.cnf"
#line 743 "./asn1/ldap/ldap.cnf"
if(ldm_tree && object_identifier_id) {
proto_item_set_text(ldm_tree, "%s %s", "IntermediateResponse", object_identifier_id);
name = oid_resolved_from_string(wmem_packet_scope(), object_identifier_id);
@ -3240,7 +3239,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 711 "./asn1/ldap/ldap.cnf"
#line 712 "./asn1/ldap/ldap.cnf"
gint8 ber_class;
gboolean pc, ind;
gint32 tag;
@ -3411,7 +3410,7 @@ dissect_ldap_SortResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
static int
dissect_ldap_DirSyncFlags(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 755 "./asn1/ldap/ldap.cnf"
#line 756 "./asn1/ldap/ldap.cnf"
gint8 ber_class;
gboolean pc;
gint32 tag;
@ -5159,7 +5158,7 @@ void proto_register_ldap(void) {
NULL, HFILL }},
{ &hf_ldap_delRequest,
{ "delRequest", "ldap.delRequest",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_ldap_delResponse,
{ "delResponse", "ldap.delResponse_element",
@ -5199,11 +5198,11 @@ void proto_register_ldap(void) {
NULL, HFILL }},
{ &hf_ldap_AttributeDescriptionList_item,
{ "AttributeDescription", "ldap.AttributeDescription",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_ldap_attributeDesc,
{ "attributeDesc", "ldap.attributeDesc",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"AttributeDescription", HFILL }},
{ &hf_ldap_assertionValue,
{ "assertionValue", "ldap.assertionValue",
@ -5211,7 +5210,7 @@ void proto_register_ldap(void) {
NULL, HFILL }},
{ &hf_ldap_type,
{ "type", "ldap.type",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"AttributeDescription", HFILL }},
{ &hf_ldap_vals,
{ "vals", "ldap.vals",
@ -5227,11 +5226,11 @@ void proto_register_ldap(void) {
NULL, HFILL }},
{ &hf_ldap_matchedDN,
{ "matchedDN", "ldap.matchedDN",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"LDAPDN", HFILL }},
{ &hf_ldap_errorMessage,
{ "errorMessage", "ldap.errorMessage",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_ldap_referral,
{ "referral", "ldap.referral",
@ -5263,7 +5262,7 @@ void proto_register_ldap(void) {
"INTEGER_1_127", HFILL }},
{ &hf_ldap_name,
{ "name", "ldap.name",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"LDAPDN", HFILL }},
{ &hf_ldap_authentication,
{ "authentication", "ldap.authentication",
@ -5299,7 +5298,7 @@ void proto_register_ldap(void) {
"BindResponse_resultCode", HFILL }},
{ &hf_ldap_bindResponse_matchedDN,
{ "matchedDN", "ldap.matchedDN",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"T_bindResponse_matchedDN", HFILL }},
{ &hf_ldap_serverSaslCreds,
{ "serverSaslCreds", "ldap.serverSaslCreds",
@ -5307,7 +5306,7 @@ void proto_register_ldap(void) {
NULL, HFILL }},
{ &hf_ldap_baseObject,
{ "baseObject", "ldap.baseObject",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"LDAPDN", HFILL }},
{ &hf_ldap_scope,
{ "scope", "ldap.scope",
@ -5375,7 +5374,7 @@ void proto_register_ldap(void) {
NULL, HFILL }},
{ &hf_ldap_present,
{ "present", "ldap.present",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_ldap_approxMatch,
{ "approxMatch", "ldap.approxMatch_element",
@ -5395,19 +5394,19 @@ void proto_register_ldap(void) {
"T_substringFilter_substrings_item", HFILL }},
{ &hf_ldap_initial,
{ "initial", "ldap.initial",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"LDAPString", HFILL }},
{ &hf_ldap_any,
{ "any", "ldap.any",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"LDAPString", HFILL }},
{ &hf_ldap_final,
{ "final", "ldap.final",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"LDAPString", HFILL }},
{ &hf_ldap_matchingRule,
{ "matchingRule", "ldap.matchingRule",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"MatchingRuleId", HFILL }},
{ &hf_ldap_matchValue,
{ "matchValue", "ldap.matchValue",
@ -5419,7 +5418,7 @@ void proto_register_ldap(void) {
NULL, HFILL }},
{ &hf_ldap_objectName,
{ "objectName", "ldap.objectName",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"LDAPDN", HFILL }},
{ &hf_ldap_searchResultEntry_attributes,
{ "attributes", "ldap.attributes",
@ -5435,7 +5434,7 @@ void proto_register_ldap(void) {
NULL, HFILL }},
{ &hf_ldap_object,
{ "object", "ldap.object",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"LDAPDN", HFILL }},
{ &hf_ldap_modifyRequest_modification,
{ "modification", "ldap.modification",
@ -5455,7 +5454,7 @@ void proto_register_ldap(void) {
"AttributeTypeAndValues", HFILL }},
{ &hf_ldap_entry,
{ "entry", "ldap.entry",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"LDAPDN", HFILL }},
{ &hf_ldap_attributes,
{ "attributes", "ldap.attributes",
@ -5467,7 +5466,7 @@ void proto_register_ldap(void) {
NULL, HFILL }},
{ &hf_ldap_newrdn,
{ "newrdn", "ldap.newrdn",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"RelativeLDAPDN", HFILL }},
{ &hf_ldap_deleteoldrdn,
{ "deleteoldrdn", "ldap.deleteoldrdn",
@ -5475,7 +5474,7 @@ void proto_register_ldap(void) {
"BOOLEAN", HFILL }},
{ &hf_ldap_newSuperior,
{ "newSuperior", "ldap.newSuperior",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"LDAPDN", HFILL }},
{ &hf_ldap_ava,
{ "ava", "ldap.ava_element",
@ -5519,11 +5518,11 @@ void proto_register_ldap(void) {
NULL, HFILL }},
{ &hf_ldap_attributeType,
{ "attributeType", "ldap.attributeType",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"AttributeDescription", HFILL }},
{ &hf_ldap_orderingRule,
{ "orderingRule", "ldap.orderingRule",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"MatchingRuleId", HFILL }},
{ &hf_ldap_reverseOrder,
{ "reverseOrder", "ldap.reverseOrder",