1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
4 /* asn2wrs.py -b -p ldap -c ./ldap.cnf -s ./packet-ldap-template -D . -O ../.. Lightweight-Directory-Access-Protocol-V3.asn */
6 /* Input file: packet-ldap-template.c */
8 #line 1 "./asn1/ldap/packet-ldap-template.c"
9 /* packet-ldap-template.c
10 * Routines for ldap packet dissection
12 * See RFC 1777 (LDtAP v2), RFC 4511 (LDAP v3), and RFC 2222 (SASL).
14 * Wireshark - Network traffic analyzer
15 * By Gerald Combs <gerald@wireshark.org>
16 * Copyright 1998 Gerald Combs
18 * SPDX-License-Identifier: GPL-2.0-or-later
22 * This is not a complete implementation. It doesn't handle the full version 3, more specifically,
23 * it handles only the commands of version 2, but any additional characteristics of the ver3 command are supported.
24 * It's also missing extensible search filters.
26 * There should probably be a lot more error checking, I simply assume that if we have a full packet, it will be a complete
29 * AFAIK, it will handle all messages used by the OpenLDAP 1.2.9 server and libraries which was my goal. I do plan to add
30 * the remaining commands as time permits but this is not a priority to me. Send me an email if you need it and I'll see what
34 * nazard@dragoninc.on.ca
38 * 11/11/2002 - Fixed problem when decoding LDAP with desegmentation enabled and the
39 * ASN.1 BER Universal Class Tag: "Sequence Of" header is encapsulated across 2
43 * ronald.henderson@cognicaseusa.com
47 * 20-JAN-2004 - added decoding of MS-CLDAP netlogon RPC
48 * using information from the SNIA 2003 conference paper :
49 * Active Directory Domain Controller Location Service
55 * 17-DEC-2004 - added basic decoding for LDAP Controls
56 * 20-DEC-2004 - added handling for GSS-API encrypted blobs
58 * Stefan Metzmacher <metze@samba.org>
60 * 15-NOV-2005 - Changed to use the asn2wrs compiler
61 * Anders Broman <anders.broman@ericsson.com>
65 * 3-AUG-2008 - Extended the cldap support to include all netlogon data types.
66 * Updated cldap_netlogon_flags to include Windows 2008 flags
67 * Expanded the ntver ldap option with bit field
69 * Gary Reynolds <gazzadownunder@yahoo.co.uk>
73 * 09-DEC-2009 - Added support for RFC4533
74 * Content Synchronization Operation (aka syncrepl)
75 * 11-DEC-2009 - Added support for IntermediateResponse (LDAP v3 from RFC 4511)
76 * Mathieu Parent <math.parent@gmail.com>
81 #include <epan/packet.h>
82 #include <epan/exceptions.h>
83 #include <epan/conversation.h>
84 #include <epan/prefs.h>
86 #include <epan/srt_table.h>
87 #include <epan/oids.h>
88 #include <epan/strutil.h>
89 #include <epan/show_exception.h>
90 #include <epan/asn1.h>
91 #include <epan/expert.h>
93 #include <wsutil/str_util.h>
94 #include "packet-frame.h"
95 #include "packet-tcp.h"
96 #include "packet-windows-common.h"
97 #include "packet-dcerpc.h"
99 #include "packet-ldap.h"
100 #include "packet-ntlmssp.h"
101 #include "packet-ssl.h"
102 #include "packet-ssl-utils.h"
103 #include "packet-smb-common.h"
104 #include "packet-gssapi.h"
106 #include "packet-ber.h"
107 #include "packet-per.h"
108 #include "packet-dns.h"
110 #define PNAME "Lightweight Directory Access Protocol"
111 #define PSNAME "LDAP"
112 #define PFNAME "ldap"
114 void proto_register_ldap(void);
115 void proto_reg_handoff_ldap(void);
117 /* Initialize the protocol and registered fields */
118 static int ldap_tap = -1;
119 static int proto_ldap = -1;
120 static int proto_cldap = -1;
122 static int hf_ldap_sasl_buffer_length = -1;
123 static int hf_ldap_response_in = -1;
124 static int hf_ldap_response_to = -1;
125 static int hf_ldap_time = -1;
126 static int hf_ldap_guid = -1;
128 static int hf_mscldap_ntver_flags = -1;
129 static int hf_mscldap_ntver_flags_v1 = -1;
130 static int hf_mscldap_ntver_flags_v5 = -1;
131 static int hf_mscldap_ntver_flags_v5ex = -1;
132 static int hf_mscldap_ntver_flags_v5ep = -1;
133 static int hf_mscldap_ntver_flags_vcs = -1;
134 static int hf_mscldap_ntver_flags_vnt4 = -1;
135 static int hf_mscldap_ntver_flags_vpdc = -1;
136 static int hf_mscldap_ntver_flags_vip = -1;
137 static int hf_mscldap_ntver_flags_vl = -1;
138 static int hf_mscldap_ntver_flags_vgc = -1;
140 static int hf_mscldap_netlogon_ipaddress_family = -1;
141 static int hf_mscldap_netlogon_ipaddress_port = -1;
142 static int hf_mscldap_netlogon_ipaddress = -1;
143 static int hf_mscldap_netlogon_ipaddress_ipv4 = -1;
144 static int hf_mscldap_netlogon_opcode = -1;
145 static int hf_mscldap_netlogon_flags = -1;
146 static int hf_mscldap_netlogon_flags_pdc = -1;
147 static int hf_mscldap_netlogon_flags_gc = -1;
148 static int hf_mscldap_netlogon_flags_ldap = -1;
149 static int hf_mscldap_netlogon_flags_ds = -1;
150 static int hf_mscldap_netlogon_flags_kdc = -1;
151 static int hf_mscldap_netlogon_flags_timeserv = -1;
152 static int hf_mscldap_netlogon_flags_closest = -1;
153 static int hf_mscldap_netlogon_flags_writable = -1;
154 static int hf_mscldap_netlogon_flags_good_timeserv = -1;
155 static int hf_mscldap_netlogon_flags_ndnc = -1;
156 static int hf_mscldap_netlogon_flags_fnc = -1;
157 static int hf_mscldap_netlogon_flags_dnc = -1;
158 static int hf_mscldap_netlogon_flags_dns = -1;
159 static int hf_mscldap_netlogon_flags_wdc = -1;
160 static int hf_mscldap_netlogon_flags_rodc = -1;
161 static int hf_mscldap_domain_guid = -1;
162 static int hf_mscldap_forest = -1;
163 static int hf_mscldap_domain = -1;
164 static int hf_mscldap_hostname = -1;
165 static int hf_mscldap_nb_domain = -1;
166 static int hf_mscldap_nb_hostname = -1;
167 static int hf_mscldap_username = -1;
168 static int hf_mscldap_sitename = -1;
169 static int hf_mscldap_clientsitename = -1;
170 static int hf_mscldap_netlogon_lm_token = -1;
171 static int hf_mscldap_netlogon_nt_token = -1;
172 static int hf_ldap_sid = -1;
173 static int hf_ldap_AccessMask_ADS_CREATE_CHILD = -1;
174 static int hf_ldap_AccessMask_ADS_DELETE_CHILD = -1;
175 static int hf_ldap_AccessMask_ADS_LIST = -1;
176 static int hf_ldap_AccessMask_ADS_SELF_WRITE = -1;
177 static int hf_ldap_AccessMask_ADS_READ_PROP = -1;
178 static int hf_ldap_AccessMask_ADS_WRITE_PROP = -1;
179 static int hf_ldap_AccessMask_ADS_DELETE_TREE = -1;
180 static int hf_ldap_AccessMask_ADS_LIST_OBJECT = -1;
181 static int hf_ldap_AccessMask_ADS_CONTROL_ACCESS = -1;
182 static int hf_ldap_LDAPMessage_PDU = -1;
183 static int hf_ldap_object_security_flag = -1;
184 static int hf_ldap_ancestor_first_flag = -1;
185 static int hf_ldap_public_data_only_flag = -1;
186 static int hf_ldap_incremental_value_flag = -1;
187 static int hf_ldap_oid = -1;
188 static int hf_ldap_gssapi_encrypted_payload = -1;
191 /*--- Included file: packet-ldap-hf.c ---*/
192 #line 1 "./asn1/ldap/packet-ldap-hf.c"
193 static int hf_ldap_SearchControlValue_PDU = -1; /* SearchControlValue */
194 static int hf_ldap_SortKeyList_PDU = -1; /* SortKeyList */
195 static int hf_ldap_SortResult_PDU = -1; /* SortResult */
196 static int hf_ldap_DirSyncControlValue_PDU = -1; /* DirSyncControlValue */
197 static int hf_ldap_PasswdModifyRequestValue_PDU = -1; /* PasswdModifyRequestValue */
198 static int hf_ldap_CancelRequestValue_PDU = -1; /* CancelRequestValue */
199 static int hf_ldap_SyncRequestValue_PDU = -1; /* SyncRequestValue */
200 static int hf_ldap_SyncStateValue_PDU = -1; /* SyncStateValue */
201 static int hf_ldap_SyncDoneValue_PDU = -1; /* SyncDoneValue */
202 static int hf_ldap_SyncInfoValue_PDU = -1; /* SyncInfoValue */
203 static int hf_ldap_PasswordPolicyResponseValue_PDU = -1; /* PasswordPolicyResponseValue */
204 static int hf_ldap_messageID = -1; /* MessageID */
205 static int hf_ldap_protocolOp = -1; /* ProtocolOp */
206 static int hf_ldap_controls = -1; /* Controls */
207 static int hf_ldap_bindRequest = -1; /* BindRequest */
208 static int hf_ldap_bindResponse = -1; /* BindResponse */
209 static int hf_ldap_unbindRequest = -1; /* UnbindRequest */
210 static int hf_ldap_searchRequest = -1; /* SearchRequest */
211 static int hf_ldap_searchResEntry = -1; /* SearchResultEntry */
212 static int hf_ldap_searchResDone = -1; /* SearchResultDone */
213 static int hf_ldap_searchResRef = -1; /* SearchResultReference */
214 static int hf_ldap_modifyRequest = -1; /* ModifyRequest */
215 static int hf_ldap_modifyResponse = -1; /* ModifyResponse */
216 static int hf_ldap_addRequest = -1; /* AddRequest */
217 static int hf_ldap_addResponse = -1; /* AddResponse */
218 static int hf_ldap_delRequest = -1; /* DelRequest */
219 static int hf_ldap_delResponse = -1; /* DelResponse */
220 static int hf_ldap_modDNRequest = -1; /* ModifyDNRequest */
221 static int hf_ldap_modDNResponse = -1; /* ModifyDNResponse */
222 static int hf_ldap_compareRequest = -1; /* CompareRequest */
223 static int hf_ldap_compareResponse = -1; /* CompareResponse */
224 static int hf_ldap_abandonRequest = -1; /* AbandonRequest */
225 static int hf_ldap_extendedReq = -1; /* ExtendedRequest */
226 static int hf_ldap_extendedResp = -1; /* ExtendedResponse */
227 static int hf_ldap_intermediateResponse = -1; /* IntermediateResponse */
228 static int hf_ldap_AttributeDescriptionList_item = -1; /* AttributeDescription */
229 static int hf_ldap_attributeDesc = -1; /* AttributeDescription */
230 static int hf_ldap_assertionValue = -1; /* AssertionValue */
231 static int hf_ldap_type = -1; /* AttributeDescription */
232 static int hf_ldap_vals = -1; /* SET_OF_AttributeValue */
233 static int hf_ldap_vals_item = -1; /* AttributeValue */
234 static int hf_ldap_resultCode = -1; /* T_resultCode */
235 static int hf_ldap_matchedDN = -1; /* LDAPDN */
236 static int hf_ldap_errorMessage = -1; /* ErrorMessage */
237 static int hf_ldap_referral = -1; /* Referral */
238 static int hf_ldap_Referral_item = -1; /* LDAPURL */
239 static int hf_ldap_Controls_item = -1; /* Control */
240 static int hf_ldap_controlType = -1; /* ControlType */
241 static int hf_ldap_criticality = -1; /* BOOLEAN */
242 static int hf_ldap_controlValue = -1; /* T_controlValue */
243 static int hf_ldap_version = -1; /* INTEGER_1_127 */
244 static int hf_ldap_name = -1; /* LDAPDN */
245 static int hf_ldap_authentication = -1; /* AuthenticationChoice */
246 static int hf_ldap_simple = -1; /* Simple */
247 static int hf_ldap_sasl = -1; /* SaslCredentials */
248 static int hf_ldap_ntlmsspNegotiate = -1; /* T_ntlmsspNegotiate */
249 static int hf_ldap_ntlmsspAuth = -1; /* T_ntlmsspAuth */
250 static int hf_ldap_mechanism = -1; /* Mechanism */
251 static int hf_ldap_credentials = -1; /* Credentials */
252 static int hf_ldap_bindResponse_resultCode = -1; /* BindResponse_resultCode */
253 static int hf_ldap_bindResponse_matchedDN = -1; /* T_bindResponse_matchedDN */
254 static int hf_ldap_serverSaslCreds = -1; /* ServerSaslCreds */
255 static int hf_ldap_baseObject = -1; /* LDAPDN */
256 static int hf_ldap_scope = -1; /* T_scope */
257 static int hf_ldap_derefAliases = -1; /* T_derefAliases */
258 static int hf_ldap_sizeLimit = -1; /* INTEGER_0_maxInt */
259 static int hf_ldap_timeLimit = -1; /* INTEGER_0_maxInt */
260 static int hf_ldap_typesOnly = -1; /* BOOLEAN */
261 static int hf_ldap_filter = -1; /* T_filter */
262 static int hf_ldap_searchRequest_attributes = -1; /* AttributeDescriptionList */
263 static int hf_ldap_and = -1; /* T_and */
264 static int hf_ldap_and_item = -1; /* T_and_item */
265 static int hf_ldap_or = -1; /* T_or */
266 static int hf_ldap_or_item = -1; /* T_or_item */
267 static int hf_ldap_not = -1; /* T_not */
268 static int hf_ldap_equalityMatch = -1; /* T_equalityMatch */
269 static int hf_ldap_substrings = -1; /* SubstringFilter */
270 static int hf_ldap_greaterOrEqual = -1; /* T_greaterOrEqual */
271 static int hf_ldap_lessOrEqual = -1; /* T_lessOrEqual */
272 static int hf_ldap_present = -1; /* T_present */
273 static int hf_ldap_approxMatch = -1; /* T_approxMatch */
274 static int hf_ldap_extensibleMatch = -1; /* T_extensibleMatch */
275 static int hf_ldap_substringFilter_substrings = -1; /* T_substringFilter_substrings */
276 static int hf_ldap_substringFilter_substrings_item = -1; /* T_substringFilter_substrings_item */
277 static int hf_ldap_initial = -1; /* LDAPString */
278 static int hf_ldap_any = -1; /* LDAPString */
279 static int hf_ldap_final = -1; /* LDAPString */
280 static int hf_ldap_matchingRule = -1; /* MatchingRuleId */
281 static int hf_ldap_matchValue = -1; /* AssertionValue */
282 static int hf_ldap_dnAttributes = -1; /* T_dnAttributes */
283 static int hf_ldap_objectName = -1; /* LDAPDN */
284 static int hf_ldap_searchResultEntry_attributes = -1; /* PartialAttributeList */
285 static int hf_ldap_PartialAttributeList_item = -1; /* PartialAttributeList_item */
286 static int hf_ldap__untag_item = -1; /* LDAPURL */
287 static int hf_ldap_object = -1; /* LDAPDN */
288 static int hf_ldap_modifyRequest_modification = -1; /* ModifyRequest_modification */
289 static int hf_ldap_modifyRequest_modification_item = -1; /* T_modifyRequest_modification_item */
290 static int hf_ldap_operation = -1; /* T_operation */
291 static int hf_ldap_modification = -1; /* AttributeTypeAndValues */
292 static int hf_ldap_entry = -1; /* LDAPDN */
293 static int hf_ldap_attributes = -1; /* AttributeList */
294 static int hf_ldap_AttributeList_item = -1; /* AttributeList_item */
295 static int hf_ldap_newrdn = -1; /* RelativeLDAPDN */
296 static int hf_ldap_deleteoldrdn = -1; /* BOOLEAN */
297 static int hf_ldap_newSuperior = -1; /* LDAPDN */
298 static int hf_ldap_ava = -1; /* AttributeValueAssertion */
299 static int hf_ldap_requestName = -1; /* LDAPOID */
300 static int hf_ldap_requestValue = -1; /* T_requestValue */
301 static int hf_ldap_extendedResponse_resultCode = -1; /* ExtendedResponse_resultCode */
302 static int hf_ldap_responseName = -1; /* ResponseName */
303 static int hf_ldap_response = -1; /* OCTET_STRING */
304 static int hf_ldap_intermediateResponse_responseValue = -1; /* T_intermediateResponse_responseValue */
305 static int hf_ldap_size = -1; /* INTEGER */
306 static int hf_ldap_cookie = -1; /* OCTET_STRING */
307 static int hf_ldap_SortKeyList_item = -1; /* SortKeyList_item */
308 static int hf_ldap_attributeType = -1; /* AttributeDescription */
309 static int hf_ldap_orderingRule = -1; /* MatchingRuleId */
310 static int hf_ldap_reverseOrder = -1; /* BOOLEAN */
311 static int hf_ldap_sortResult = -1; /* T_sortResult */
312 static int hf_ldap_flags = -1; /* DirSyncFlags */
313 static int hf_ldap_maxBytes = -1; /* INTEGER */
314 static int hf_ldap_userIdentity = -1; /* OCTET_STRING */
315 static int hf_ldap_oldPasswd = -1; /* OCTET_STRING */
316 static int hf_ldap_newPasswd = -1; /* OCTET_STRING */
317 static int hf_ldap_cancelID = -1; /* MessageID */
318 static int hf_ldap_mode = -1; /* T_mode */
319 static int hf_ldap_reloadHint = -1; /* BOOLEAN */
320 static int hf_ldap_state = -1; /* T_state */
321 static int hf_ldap_entryUUID = -1; /* SyncUUID */
322 static int hf_ldap_refreshDeletes = -1; /* BOOLEAN */
323 static int hf_ldap_newcookie = -1; /* OCTET_STRING */
324 static int hf_ldap_refreshDelete = -1; /* T_refreshDelete */
325 static int hf_ldap_refreshDone = -1; /* BOOLEAN */
326 static int hf_ldap_refreshPresent = -1; /* T_refreshPresent */
327 static int hf_ldap_syncIdSet = -1; /* T_syncIdSet */
328 static int hf_ldap_syncUUIDs = -1; /* SET_OF_SyncUUID */
329 static int hf_ldap_syncUUIDs_item = -1; /* SyncUUID */
330 static int hf_ldap_warning = -1; /* T_warning */
331 static int hf_ldap_timeBeforeExpiration = -1; /* INTEGER_0_maxInt */
332 static int hf_ldap_graceAuthNsRemaining = -1; /* INTEGER_0_maxInt */
333 static int hf_ldap_error = -1; /* T_error */
335 /*--- End of included file: packet-ldap-hf.c ---*/
336 #line 183 "./asn1/ldap/packet-ldap-template.c"
338 /* Initialize the subtree pointers */
339 static gint ett_ldap = -1;
340 static gint ett_ldap_msg = -1;
341 static gint ett_ldap_sasl_blob = -1;
342 static gint ett_ldap_payload = -1;
343 static gint ett_mscldap_netlogon_flags = -1;
344 static gint ett_mscldap_ntver_flags = -1;
345 static gint ett_mscldap_ipdetails = -1;
346 static gint ett_ldap_DirSyncFlagsSubEntry = -1;
349 /*--- Included file: packet-ldap-ett.c ---*/
350 #line 1 "./asn1/ldap/packet-ldap-ett.c"
351 static gint ett_ldap_LDAPMessage = -1;
352 static gint ett_ldap_ProtocolOp = -1;
353 static gint ett_ldap_AttributeDescriptionList = -1;
354 static gint ett_ldap_AttributeValueAssertion = -1;
355 static gint ett_ldap_Attribute = -1;
356 static gint ett_ldap_SET_OF_AttributeValue = -1;
357 static gint ett_ldap_LDAPResult = -1;
358 static gint ett_ldap_Referral = -1;
359 static gint ett_ldap_Controls = -1;
360 static gint ett_ldap_Control = -1;
361 static gint ett_ldap_BindRequest_U = -1;
362 static gint ett_ldap_AuthenticationChoice = -1;
363 static gint ett_ldap_SaslCredentials = -1;
364 static gint ett_ldap_BindResponse_U = -1;
365 static gint ett_ldap_SearchRequest_U = -1;
366 static gint ett_ldap_Filter = -1;
367 static gint ett_ldap_T_and = -1;
368 static gint ett_ldap_T_or = -1;
369 static gint ett_ldap_SubstringFilter = -1;
370 static gint ett_ldap_T_substringFilter_substrings = -1;
371 static gint ett_ldap_T_substringFilter_substrings_item = -1;
372 static gint ett_ldap_MatchingRuleAssertion = -1;
373 static gint ett_ldap_SearchResultEntry_U = -1;
374 static gint ett_ldap_PartialAttributeList = -1;
375 static gint ett_ldap_PartialAttributeList_item = -1;
376 static gint ett_ldap_SEQUENCE_OF_LDAPURL = -1;
377 static gint ett_ldap_ModifyRequest_U = -1;
378 static gint ett_ldap_ModifyRequest_modification = -1;
379 static gint ett_ldap_T_modifyRequest_modification_item = -1;
380 static gint ett_ldap_AttributeTypeAndValues = -1;
381 static gint ett_ldap_AddRequest_U = -1;
382 static gint ett_ldap_AttributeList = -1;
383 static gint ett_ldap_AttributeList_item = -1;
384 static gint ett_ldap_ModifyDNRequest_U = -1;
385 static gint ett_ldap_CompareRequest_U = -1;
386 static gint ett_ldap_ExtendedRequest_U = -1;
387 static gint ett_ldap_ExtendedResponse_U = -1;
388 static gint ett_ldap_IntermediateResponse_U = -1;
389 static gint ett_ldap_SearchControlValue = -1;
390 static gint ett_ldap_SortKeyList = -1;
391 static gint ett_ldap_SortKeyList_item = -1;
392 static gint ett_ldap_SortResult = -1;
393 static gint ett_ldap_DirSyncControlValue = -1;
394 static gint ett_ldap_PasswdModifyRequestValue = -1;
395 static gint ett_ldap_CancelRequestValue = -1;
396 static gint ett_ldap_SyncRequestValue = -1;
397 static gint ett_ldap_SyncStateValue = -1;
398 static gint ett_ldap_SyncDoneValue = -1;
399 static gint ett_ldap_SyncInfoValue = -1;
400 static gint ett_ldap_T_refreshDelete = -1;
401 static gint ett_ldap_T_refreshPresent = -1;
402 static gint ett_ldap_T_syncIdSet = -1;
403 static gint ett_ldap_SET_OF_SyncUUID = -1;
404 static gint ett_ldap_PasswordPolicyResponseValue = -1;
405 static gint ett_ldap_T_warning = -1;
407 /*--- End of included file: packet-ldap-ett.c ---*/
408 #line 195 "./asn1/ldap/packet-ldap-template.c"
410 static expert_field ei_ldap_exceeded_filter_length = EI_INIT;
411 static expert_field ei_ldap_too_many_filter_elements = EI_INIT;
413 static dissector_table_t ldap_name_dissector_table=NULL;
414 static const char *object_identifier_id = NULL; /* LDAP OID */
416 static gboolean do_protocolop = FALSE;
417 static gchar *attr_type = NULL;
418 static gboolean is_binary_attr_type = FALSE;
419 static gboolean ldap_found_in_frame = FALSE;
421 #define TCP_PORT_RANGE_LDAP "389,3268" /* 3268 is Windows 2000 Global Catalog */
422 #define TCP_PORT_LDAPS 636
423 #define UDP_PORT_CLDAP 389
425 /* desegmentation of LDAP */
426 static gboolean ldap_desegment = TRUE;
427 static guint global_ldaps_tcp_port = TCP_PORT_LDAPS;
428 static guint ssl_port = 0;
430 static dissector_handle_t gssapi_handle;
431 static dissector_handle_t gssapi_wrap_handle;
432 static dissector_handle_t ntlmssp_handle;
433 static dissector_handle_t spnego_handle;
434 static dissector_handle_t ssl_handle;
435 static dissector_handle_t ldap_handle ;
437 static void prefs_register_ldap(void); /* forward declaration for use in preferences registration */
440 /* different types of rpc calls ontop of ms cldap */
441 #define MSCLDAP_RPC_NETLOGON 1
443 /* Message type Choice values */
444 static const value_string ldap_ProtocolOp_choice_vals[] = {
445 { 0, "bindRequest" },
446 { 1, "bindResponse" },
447 { 2, "unbindRequest" },
448 { 3, "searchRequest" },
449 { 4, "searchResEntry" },
450 { 5, "searchResDone" },
451 { 6, "searchResRef" },
452 { 7, "modifyRequest" },
453 { 8, "modifyResponse" },
455 { 10, "addResponse" },
456 { 11, "delRequest" },
457 { 12, "delResponse" },
458 { 13, "modDNRequest" },
459 { 14, "modDNResponse" },
460 { 15, "compareRequest" },
461 { 16, "compareResponse" },
462 { 17, "abandonRequest" },
463 { 18, "extendedReq" },
464 { 19, "extendedResp" },
465 { 20, "intermediateResponse" },
469 /* Procedure names (used in Service Response Time */
470 const value_string ldap_procedure_names[] = {
482 #define LOGON_PRIMARY_QUERY 7
483 #define LOGON_PRIMARY_RESPONSE 12
484 #define LOGON_SAM_LOGON_REQUEST 18
485 #define LOGON_SAM_LOGON_RESPONSE 19
486 #define LOGON_SAM_PAUSE_RESPONSE 20
487 #define LOGON_SAM_USER_UNKNOWN 21
488 #define LOGON_SAM_LOGON_RESPONSE_EX 23
489 #define LOGON_SAM_PAUSE_RESPONSE_EX 24
490 #define LOGON_SAM_USER_UNKNOWN_EX 25
492 static const value_string netlogon_opcode_vals[] = {
493 { LOGON_PRIMARY_QUERY, "LOGON_PRIMARY_QUERY" },
494 { LOGON_PRIMARY_RESPONSE, "LOGON_PRIMARY_RESPONSE" },
495 { LOGON_SAM_LOGON_REQUEST, "LOGON_SAM_LOGON_REQUEST" },
496 { LOGON_SAM_LOGON_RESPONSE, "LOGON_SAM_LOGON_RESPONSE" },
497 { LOGON_SAM_PAUSE_RESPONSE, "LOGON_SAM_PAUSE_RESPONSE" },
498 { LOGON_SAM_LOGON_RESPONSE_EX, "LOGON_SAM_LOGON_RESPONSE_EX" },
499 { LOGON_SAM_PAUSE_RESPONSE_EX, "LOGON_SAM_PAUSE_RESPONSE_EX" },
500 { LOGON_SAM_USER_UNKNOWN_EX, "LOGON_SAM_USER_UNKNOWN_EX" },
504 #define LDAP_NUM_PROCEDURES 24
507 ldapstat_init(struct register_srt* srt _U_, GArray* srt_array)
509 srt_stat_table *ldap_srt_table;
512 ldap_srt_table = init_srt_table("LDAP Commands", NULL, srt_array, LDAP_NUM_PROCEDURES, NULL, "ldap.protocolOp", NULL);
513 for (i = 0; i < LDAP_NUM_PROCEDURES; i++)
515 init_srt_table_row(ldap_srt_table, i, val_to_str_const(i, ldap_procedure_names, "<unknown>"));
520 ldapstat_packet(void *pldap, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi)
523 srt_stat_table *ldap_srt_table;
524 const ldap_call_response_t *ldap=(const ldap_call_response_t *)psi;
525 srt_data_t *data = (srt_data_t *)pldap;
527 /* we are only interested in reply packets */
528 if(ldap->is_request){
531 /* if we havnt seen the request, just ignore it */
532 if(!ldap->req_frame){
536 /* only use the commands we know how to handle */
537 switch(ldap->protocolOpTag){
539 case LDAP_REQ_SEARCH:
540 case LDAP_REQ_MODIFY:
542 case LDAP_REQ_DELETE:
543 case LDAP_REQ_MODRDN:
544 case LDAP_REQ_COMPARE:
545 case LDAP_REQ_EXTENDED:
551 ldap_srt_table = g_array_index(data->srt_array, srt_stat_table*, i);
553 add_srt_table_data(ldap_srt_table, ldap->protocolOpTag, &ldap->req_time, pinfo);
558 * Data structure attached to a conversation, giving authentication
559 * information from a bind request.
561 typedef struct ldap_conv_info_t {
562 guint auth_type; /* authentication type */
563 char *auth_mech; /* authentication mechanism */
564 guint32 first_auth_frame; /* first frame that would use a security layer */
565 wmem_map_t *unmatched;
569 gboolean start_tls_pending;
570 guint32 start_tls_frame;
574 ldap_info_hash_matched(gconstpointer k)
576 const ldap_call_response_t *key = (const ldap_call_response_t *)k;
578 return key->messageId;
582 ldap_info_equal_matched(gconstpointer k1, gconstpointer k2)
584 const ldap_call_response_t *key1 = (const ldap_call_response_t*)k1;
585 const ldap_call_response_t *key2 = (const ldap_call_response_t*)k2;
587 if( key1->req_frame && key2->req_frame && (key1->req_frame!=key2->req_frame) ){
590 /* a response may span multiple frames
591 if( key1->rep_frame && key2->rep_frame && (key1->rep_frame!=key2->rep_frame) ){
596 return key1->messageId==key2->messageId;
600 ldap_info_hash_unmatched(gconstpointer k)
602 const ldap_call_response_t *key = (const ldap_call_response_t*)k;
604 return key->messageId;
608 ldap_info_equal_unmatched(gconstpointer k1, gconstpointer k2)
610 const ldap_call_response_t *key1 = (const ldap_call_response_t*)k1;
611 const ldap_call_response_t *key2 = (const ldap_call_response_t*)k2;
613 return key1->messageId==key2->messageId;
617 /* These are the NtVer flags
618 http://msdn.microsoft.com/en-us/library/cc201035.aspx
621 static const true_false_string tfs_ntver_v1 = {
622 "Client requested version 1 netlogon response",
623 "Version 1 netlogon response not requested"
626 static const true_false_string tfs_ntver_v5 = {
627 "Client requested version 5 netlogon response",
628 "Version 5 netlogon response not requested"
630 static const true_false_string tfs_ntver_v5ex = {
631 "Client requested version 5 extended netlogon response",
632 "Version 5 extended response not requested"
634 static const true_false_string tfs_ntver_v5ep = {
635 "Client has requested IP address of the server",
636 "IP address of server not requested"
638 static const true_false_string tfs_ntver_vcs = {
639 "Client has asked for the closest site information",
640 "Closest site information not requested"
642 static const true_false_string tfs_ntver_vnt4 = {
643 "Client is requesting server to avoid NT4 emulation",
644 "Only full AD DS requested"
646 static const true_false_string tfs_ntver_vpdc = {
647 "Client has requested the Primary Domain Controller",
648 "Primary Domain Controller not requested"
650 static const true_false_string tfs_ntver_vip = {
651 "Client has requested IP details (obsolete)",
652 "IP details not requested (obsolete)"
654 static const true_false_string tfs_ntver_vl = {
655 "Client indicated that it is the local machine",
656 "Client is not the local machine"
657 };static const true_false_string tfs_ntver_vgc = {
658 "Client has requested a Global Catalog server",
659 "Global Catalog not requested"
662 /* Stuff for generation/handling of fields for custom AttributeValues */
663 typedef struct _attribute_type_t {
664 gchar* attribute_type;
665 gchar* attribute_desc;
668 static attribute_type_t* attribute_types = NULL;
669 static guint num_attribute_types = 0;
671 static GHashTable* attribute_types_hash = NULL;
674 attribute_types_update_cb(void *r, char **err)
676 attribute_type_t *rec = (attribute_type_t *)r;
679 if (rec->attribute_type == NULL) {
680 *err = g_strdup("Attribute type can't be empty");
684 g_strstrip(rec->attribute_type);
685 if (rec->attribute_type[0] == 0) {
686 *err = g_strdup("Attribute type can't be empty");
690 /* Check for invalid characters (to avoid asserting out when
691 * registering the field).
693 c = proto_check_field_name(rec->attribute_type);
695 *err = g_strdup_printf("Attribute type can't contain '%c'", c);
704 attribute_types_copy_cb(void* n, const void* o, size_t siz _U_)
706 attribute_type_t* new_rec = (attribute_type_t*)n;
707 const attribute_type_t* old_rec = (const attribute_type_t*)o;
709 new_rec->attribute_type = g_strdup(old_rec->attribute_type);
710 new_rec->attribute_desc = g_strdup(old_rec->attribute_desc);
716 attribute_types_free_cb(void*r)
718 attribute_type_t* rec = (attribute_type_t*)r;
720 g_free(rec->attribute_type);
721 g_free(rec->attribute_desc);
724 UAT_CSTRING_CB_DEF(attribute_types, attribute_type, attribute_type_t)
725 UAT_CSTRING_CB_DEF(attribute_types, attribute_desc, attribute_type_t)
731 get_hf_for_header(char* attribute_type)
735 if (attribute_types_hash) {
736 hf_id = (gint*) g_hash_table_lookup(attribute_types_hash, attribute_type);
748 attribute_types_initialize_cb(void)
750 static hf_register_info* hf;
753 gchar* attribute_type;
755 if (attribute_types_hash && hf) {
756 guint hf_size = g_hash_table_size (attribute_types_hash);
757 /* Deregister all fields */
758 for (i = 0; i < hf_size; i++) {
759 proto_deregister_field (proto_ldap, *(hf[i].p_id));
762 g_hash_table_destroy (attribute_types_hash);
763 proto_add_deregistered_data (hf);
764 attribute_types_hash = NULL;
767 if (num_attribute_types) {
768 attribute_types_hash = g_hash_table_new(g_str_hash, g_str_equal);
769 hf = g_new0(hf_register_info,num_attribute_types);
771 for (i = 0; i < num_attribute_types; i++) {
772 hf_id = g_new(gint,1);
774 attribute_type = g_strdup(attribute_types[i].attribute_type);
777 hf[i].hfinfo.name = attribute_type;
778 hf[i].hfinfo.abbrev = g_strdup_printf("ldap.AttributeValue.%s", attribute_type);
779 hf[i].hfinfo.type = FT_STRING;
780 hf[i].hfinfo.display = BASE_NONE;
781 hf[i].hfinfo.strings = NULL;
782 hf[i].hfinfo.bitmask = 0;
783 hf[i].hfinfo.blurb = g_strdup(attribute_types[i].attribute_desc);
786 g_hash_table_insert(attribute_types_hash, attribute_type, hf_id);
789 proto_register_field_array(proto_ldap, hf, num_attribute_types);
793 /* MS-ADTS specification, section 7.3.1.1, NETLOGON_NT_VERSION Options Bits */
794 static int dissect_mscldap_ntver_flags(proto_tree *parent_tree, tvbuff_t *tvb, int offset)
796 static const int * flags[] = {
797 &hf_mscldap_ntver_flags_v1,
798 &hf_mscldap_ntver_flags_v5,
799 &hf_mscldap_ntver_flags_v5ex,
800 &hf_mscldap_ntver_flags_v5ep,
801 &hf_mscldap_ntver_flags_vcs,
802 &hf_mscldap_ntver_flags_vnt4,
803 &hf_mscldap_ntver_flags_vpdc,
804 &hf_mscldap_ntver_flags_vip,
805 &hf_mscldap_ntver_flags_vl,
806 &hf_mscldap_ntver_flags_vgc,
810 proto_tree_add_bitmask_with_flags(parent_tree, tvb, offset, hf_mscldap_ntver_flags,
811 ett_mscldap_ntver_flags, flags, ENC_LITTLE_ENDIAN, BMT_NO_FALSE);
817 /* This string contains the last LDAPString that was decoded */
818 static const char *attributedesc_string=NULL;
820 /* This string contains the last AssertionValue that was decoded */
821 static char *ldapvalue_string=NULL;
823 /* if the octet string contain all printable ASCII characters, then
824 * display it as a string, othervise just display it in hex.
827 dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index)
830 gboolean pc, ind, is_ascii;
836 offset=get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
837 offset=get_ber_length(tvb, offset, &len, &ind);
839 len=tvb_reported_length_remaining(tvb,offset);
848 * Some special/wellknown attributes in common LDAP (read AD)
849 * are neither ascii strings nor blobs of hex data.
850 * Special case these attributes and decode them more nicely.
852 * Add more special cases as required to prettify further
853 * (there can't be that many ones that are truly interesting)
855 if(attributedesc_string && !strncmp("DomainSid", attributedesc_string, 9)){
859 /* this octet string contains an NT SID */
860 sid_tvb=tvb_new_subset_length(tvb, offset, len);
861 dissect_nt_sid(sid_tvb, 0, tree, "SID", &tmpstr, hf_index);
862 ldapvalue_string=tmpstr;
865 } else if ( (len==16) /* GUIDs are always 16 bytes */
866 && (attributedesc_string && !strncmp("DomainGuid", attributedesc_string, 10))) {
867 guint8 drep[4] = { 0x10, 0x00, 0x00, 0x00}; /* fake DREP struct */
870 /* This octet string contained a GUID */
871 dissect_dcerpc_uuid_t(tvb, offset, actx->pinfo, tree, drep, hf_ldap_guid, &uuid);
873 ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 1024);
874 g_snprintf(ldapvalue_string, 1023, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
875 uuid.data1, uuid.data2, uuid.data3, uuid.data4[0], uuid.data4[1],
876 uuid.data4[2], uuid.data4[3], uuid.data4[4], uuid.data4[5],
877 uuid.data4[6], uuid.data4[7]);
880 } else if (attributedesc_string && !strncmp("NtVer", attributedesc_string, 5)){
884 /* get flag value to populate ldapvalue_string */
885 flags=tvb_get_letohl(tvb, offset);
887 ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 1024);
888 g_snprintf(ldapvalue_string, 1023, "0x%08x",flags);
890 /* populate bitmask subtree */
891 offset = dissect_mscldap_ntver_flags(tree, tvb, offset);
899 * It was not one of our "wellknown" attributes so make the best
900 * we can and just try to see if it is an ascii string or if it
903 * XXX - should we support reading RFC 2252-style schemas
904 * for LDAP, and using that to determine how to display
905 * attribute values and assertion values?
907 * -- I don't think there are full schemas available that describe the
908 * interesting cases i.e. AD -- ronnie
910 str=tvb_get_ptr(tvb, offset, len);
913 if(!g_ascii_isprint(str[i])){
919 /* convert the string into a printable string */
921 ldapvalue_string=wmem_strndup(wmem_packet_scope(), str, len);
923 ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 3*len);
925 g_snprintf(ldapvalue_string+i*3,3,"%02x",str[i]&0xff);
926 ldapvalue_string[3*i+2]=':';
928 ldapvalue_string[3*len-1]=0;
931 proto_tree_add_string(tree, hf_index, tvb, offset, len, ldapvalue_string);
939 /* This string contains the last Filter item that was decoded */
940 static const char *Filter_string=NULL;
941 static const char *and_filter_string=NULL;
942 static const char *or_filter_string=NULL;
943 static const char *substring_value=NULL;
944 static const char *substring_item_init=NULL;
945 static const char *substring_item_any=NULL;
946 static const char *substring_item_final=NULL;
947 static const char *matching_rule_string=NULL;
948 static gboolean matching_rule_dnattr=FALSE;
950 #define MAX_FILTER_LEN 4096
951 static gint Filter_length;
953 #define MAX_FILTER_ELEMENTS 200
954 static gint Filter_elements;
956 /* Global variables */
957 static gint MessageID =-1;
958 static gint ProtocolOp = -1;
959 static gint result = 0;
960 static proto_item *ldm_tree = NULL; /* item to add text to */
962 static void ldap_do_protocolop(packet_info *pinfo)
968 valstr = val_to_str(ProtocolOp, ldap_ProtocolOp_choice_vals, "Unknown (%%u)");
970 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", valstr, MessageID);
973 proto_item_append_text(ldm_tree, " %s(%d)", valstr, MessageID);
975 do_protocolop = FALSE;
980 static ldap_call_response_t *
981 ldap_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint messageId, guint protocolOpTag, ldap_conv_info_t *ldap_info)
983 ldap_call_response_t lcr, *lcrp=NULL;
985 /* first see if we have already matched this */
987 lcr.messageId=messageId;
988 switch(protocolOpTag){
990 case LDAP_REQ_SEARCH:
991 case LDAP_REQ_MODIFY:
993 case LDAP_REQ_DELETE:
994 case LDAP_REQ_MODRDN:
995 case LDAP_REQ_COMPARE:
996 case LDAP_REQ_EXTENDED:
998 lcr.req_frame=pinfo->num;
1002 case LDAP_RES_SEARCH_ENTRY:
1003 case LDAP_RES_SEARCH_REF:
1004 case LDAP_RES_SEARCH_RESULT:
1005 case LDAP_RES_MODIFY:
1007 case LDAP_RES_DELETE:
1008 case LDAP_RES_MODRDN:
1009 case LDAP_RES_COMPARE:
1010 case LDAP_RES_EXTENDED:
1011 case LDAP_RES_INTERMEDIATE:
1012 lcr.is_request=FALSE;
1014 lcr.rep_frame=pinfo->num;
1019 lcrp=(ldap_call_response_t *)wmem_map_lookup(ldap_info->matched, &lcr);
1023 lcrp->is_request=lcr.is_request;
1027 /* we haven't found a match - try and match it up */
1029 switch(protocolOpTag){
1031 case LDAP_REQ_SEARCH:
1032 case LDAP_REQ_MODIFY:
1034 case LDAP_REQ_DELETE:
1035 case LDAP_REQ_MODRDN:
1036 case LDAP_REQ_COMPARE:
1037 case LDAP_REQ_EXTENDED:
1039 /* this a a request - add it to the unmatched list */
1041 /* check that we don't already have one of those in the
1042 unmatched list and if so remove it */
1044 lcr.messageId=messageId;
1045 lcrp=(ldap_call_response_t *)wmem_map_lookup(ldap_info->unmatched, &lcr);
1047 wmem_map_remove(ldap_info->unmatched, lcrp);
1049 /* if we can't reuse the old one, grab a new chunk */
1051 lcrp=wmem_new0(wmem_file_scope(), ldap_call_response_t);
1053 lcrp->messageId=messageId;
1054 lcrp->req_frame=pinfo->num;
1055 lcrp->req_time=pinfo->abs_ts;
1057 lcrp->protocolOpTag=protocolOpTag;
1058 lcrp->is_request=TRUE;
1059 wmem_map_insert(ldap_info->unmatched, lcrp, lcrp);
1063 case LDAP_RES_SEARCH_ENTRY:
1064 case LDAP_RES_SEARCH_REF:
1065 case LDAP_RES_SEARCH_RESULT:
1066 case LDAP_RES_MODIFY:
1068 case LDAP_RES_DELETE:
1069 case LDAP_RES_MODRDN:
1070 case LDAP_RES_COMPARE:
1071 case LDAP_RES_EXTENDED:
1072 case LDAP_RES_INTERMEDIATE:
1074 /* this is a result - it should be in our unmatched list */
1076 lcr.messageId=messageId;
1077 lcrp=(ldap_call_response_t *)wmem_map_lookup(ldap_info->unmatched, &lcr);
1081 if(!lcrp->rep_frame){
1082 wmem_map_remove(ldap_info->unmatched, lcrp);
1083 lcrp->rep_frame=pinfo->num;
1084 lcrp->is_request=FALSE;
1085 wmem_map_insert(ldap_info->matched, lcrp, lcrp);
1093 /* we have found a match */
1098 if(lcrp->is_request){
1099 it=proto_tree_add_uint(tree, hf_ldap_response_in, tvb, 0, 0, lcrp->rep_frame);
1100 PROTO_ITEM_SET_GENERATED(it);
1103 it=proto_tree_add_uint(tree, hf_ldap_response_to, tvb, 0, 0, lcrp->req_frame);
1104 PROTO_ITEM_SET_GENERATED(it);
1105 nstime_delta(&ns, &pinfo->abs_ts, &lcrp->req_time);
1106 it=proto_tree_add_time(tree, hf_ldap_time, tvb, 0, 0, &ns);
1107 PROTO_ITEM_SET_GENERATED(it);
1115 /*--- Included file: packet-ldap-fn.c ---*/
1116 #line 1 "./asn1/ldap/packet-ldap-fn.c"
1117 /*--- Cyclic dependencies ---*/
1119 /* Filter -> Filter/and -> Filter/and/_item -> Filter */
1120 /* Filter -> Filter/or -> Filter/or/_item -> Filter */
1121 /* Filter -> Filter/not -> Filter */
1122 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_);
1128 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_) {
1129 #line 91 "./asn1/ldap/ldap.cnf"
1131 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1145 dissect_ldap_INTEGER_1_127(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1146 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1155 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_) {
1156 #line 301 "./asn1/ldap/ldap.cnf"
1157 tvbuff_t *parameter_tvb = NULL;
1158 const char *ldapstring = NULL;
1159 gchar *sc = NULL; /* semi-colon pointer */
1161 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1165 if (parameter_tvb || (hf_index == hf_ldap_baseObject)) {
1167 ldap_do_protocolop(actx->pinfo);
1170 ldapstring = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, tvb_reported_length_remaining(parameter_tvb, 0), ENC_UTF_8|ENC_NA);
1172 if(hf_index == hf_ldap_baseObject) {
1173 /* this is search - put it on the scanline */
1174 if(!ldapstring || !*ldapstring)
1175 ldapstring = "<ROOT>";
1177 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "\"%s\" ", format_text(wmem_packet_scope(), ldapstring, strlen(ldapstring)));
1180 proto_item_append_text(ldm_tree, " \"%s\"", ldapstring);
1183 if(!parameter_tvb) {
1185 proto_item_append_text(actx->created_item, " (%s)", ldapstring);
1188 } else if ((hf_index == hf_ldap_errorMessage) && ldapstring && *ldapstring) { /* only show message if not success */
1189 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "(%s) ", format_text(wmem_packet_scope(), ldapstring, strlen(ldapstring)));
1192 proto_item_append_text(ldm_tree, " (%s)", ldapstring);
1194 } else if ((hf_index == hf_ldap_objectName) ||
1195 (hf_index == hf_ldap_name) ||
1196 (hf_index == hf_ldap_entry) ||
1197 (hf_index == hf_ldap_object) ||
1198 (hf_index == hf_ldap_delRequest) ) {
1200 if(!ldapstring || !*ldapstring)
1201 ldapstring = "<ROOT>";
1203 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "\"%s\" ", format_text(wmem_packet_scope(), ldapstring, strlen(ldapstring)));
1206 proto_item_append_text(ldm_tree, " \"%s\"", ldapstring);
1207 } else if (hf_index == hf_ldap_attributeDesc){
1208 /* remember the attribute description */
1209 attributedesc_string=ldapstring;
1210 } else if (hf_index == hf_ldap_initial){
1211 /* remember the substring item */
1212 substring_item_init=ldapstring;
1213 } else if (hf_index == hf_ldap_any){
1214 /* remember the substring item */
1215 substring_item_any=ldapstring;
1216 } else if (hf_index == hf_ldap_final){
1217 /* remember the substring item */
1218 substring_item_final=ldapstring;
1219 } else if (hf_index == hf_ldap_matchingRule){
1220 /* remember the matching rule */
1221 matching_rule_string=ldapstring;
1222 } else if (hf_index == hf_ldap_present){
1223 /* remember the present name */
1224 Filter_string=ldapstring;
1225 } else if (hf_index == hf_ldap_type) {
1226 /* remember attribute type name */
1227 attr_type = wmem_strdup(wmem_packet_scope(), ldapstring);
1229 /* append it to the parent entry */
1230 proto_item_append_text(tree, " %s", attr_type);
1232 /* remove the ";binary" component if present */
1233 if((sc = strchr(attr_type, ';')) != NULL) {
1234 if(!strcmp(sc, ";binary")) {
1235 *sc = '\0'; /* terminate the string */
1236 is_binary_attr_type = TRUE;
1239 is_binary_attr_type = FALSE;
1253 dissect_ldap_LDAPDN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1254 offset = dissect_ldap_LDAPString(implicit_tag, tvb, offset, actx, tree, hf_index);
1262 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_) {
1263 #line 148 "./asn1/ldap/ldap.cnf"
1264 ldap_conv_info_t *ldap_info;
1266 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1270 ldap_info = (ldap_conv_info_t *)actx->private_data;
1271 ldap_info->auth_type = LDAP_AUTH_SIMPLE;
1281 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_) {
1282 #line 156 "./asn1/ldap/ldap.cnf"
1284 ldap_conv_info_t *ldap_info;
1285 tvbuff_t *parameter_tvb;
1286 char *mechanism = NULL;
1287 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1290 ldap_info = (ldap_conv_info_t *)actx->private_data;
1291 ldap_info->auth_type = LDAP_AUTH_SASL;
1297 * We need to remember the authentication type and mechanism for this
1300 * XXX - actually, we might need to remember more than one
1301 * type and mechanism, if you can unbind and rebind with a
1302 * different type and/or mechanism.
1304 if(!actx->pinfo->fd->flags.visited) {
1305 mechanism = tvb_get_string_enc(wmem_file_scope(), parameter_tvb, 0, tvb_reported_length_remaining(parameter_tvb,0), ENC_UTF_8|ENC_NA);
1306 ldap_info->first_auth_frame = 0; /* not known until we see the bind reply */
1308 * If the mechanism in this request is an empty string (which is
1309 * returned as a null pointer), use the saved mechanism instead.
1310 * Otherwise, if the saved mechanism is an empty string (null),
1311 * save this mechanism.
1313 if (mechanism != NULL) {
1314 wmem_free(wmem_file_scope(), ldap_info->auth_mech);
1315 ldap_info->auth_mech = mechanism;
1326 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_) {
1327 #line 190 "./asn1/ldap/ldap.cnf"
1329 tvbuff_t *parameter_tvb;
1330 ldap_conv_info_t *ldap_info;
1335 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1342 ldap_info = (ldap_conv_info_t *)actx->private_data;
1343 get_ber_identifier(parameter_tvb, 0, &ber_class, &pc, &tag);
1345 /*if ((ldap_info->auth_mech != NULL) && (strcmp(ldap_info->auth_mech, "GSS-SPNEGO") == 0) && (ber_class==BER_CLASS_CON)) {*/
1346 if ((ldap_info->auth_mech != NULL) && (ber_class==BER_CLASS_CON)) {
1348 * This is a GSS-API token ancapsulated within GSS-SPNEGO.
1349 * We need to check the first byte to check whether the blob
1350 * contains SPNEGO or GSSAPI.
1351 * All SPNEGO PDUs are of class CONSTRUCTED while
1352 * GSS PDUs are class APPLICATION
1354 if (parameter_tvb && (tvb_reported_length(parameter_tvb) > 0))
1355 call_dissector(spnego_handle, parameter_tvb, actx->pinfo, tree);
1357 /*if ((ldap_info->auth_mech != NULL) && ((strcmp(ldap_info->auth_mech, "GSSAPI") == 0) || (ber_class==BER_CLASS_APP))) {*/
1358 if ((ldap_info->auth_mech != NULL) && (ber_class==BER_CLASS_APP)) {
1360 * This is a raw GSS-API token.
1362 if (parameter_tvb && (tvb_reported_length(parameter_tvb) > 0)) {
1363 call_dissector(gssapi_handle, parameter_tvb, actx->pinfo, tree);
1366 /* Restore private data */
1367 actx->private_data = ldap_info;
1376 static const ber_sequence_t SaslCredentials_sequence[] = {
1377 { &hf_ldap_mechanism , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_Mechanism },
1378 { &hf_ldap_credentials , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_Credentials },
1379 { NULL, 0, 0, 0, NULL }
1383 dissect_ldap_SaslCredentials(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1384 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1385 SaslCredentials_sequence, hf_index, ett_ldap_SaslCredentials);
1393 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_) {
1394 #line 689 "./asn1/ldap/ldap.cnf"
1395 /* make sure the protocol op comes first */
1396 ldap_do_protocolop(actx->pinfo);
1398 call_dissector(ntlmssp_handle, tvb, actx->pinfo, tree);
1399 offset+=tvb_reported_length_remaining(tvb, offset);
1409 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_) {
1410 #line 696 "./asn1/ldap/ldap.cnf"
1411 /* make sure the protocol op comes first */
1412 ldap_do_protocolop(actx->pinfo);
1414 call_dissector(ntlmssp_handle, tvb, actx->pinfo, tree);
1415 offset+=tvb_reported_length_remaining(tvb, offset);
1423 static const value_string ldap_AuthenticationChoice_vals[] = {
1426 { 10, "ntlmsspNegotiate" },
1427 { 11, "ntlmsspAuth" },
1431 static const ber_choice_t AuthenticationChoice_choice[] = {
1432 { 0, &hf_ldap_simple , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ldap_Simple },
1433 { 3, &hf_ldap_sasl , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_ldap_SaslCredentials },
1434 { 10, &hf_ldap_ntlmsspNegotiate, BER_CLASS_CON, 10, BER_FLAGS_IMPLTAG, dissect_ldap_T_ntlmsspNegotiate },
1435 { 11, &hf_ldap_ntlmsspAuth , BER_CLASS_CON, 11, BER_FLAGS_IMPLTAG, dissect_ldap_T_ntlmsspAuth },
1436 { 0, NULL, 0, 0, 0, NULL }
1440 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_) {
1441 #line 486 "./asn1/ldap/ldap.cnf"
1444 const gchar *valstr;
1446 offset = dissect_ber_choice(actx, tree, tvb, offset,
1447 AuthenticationChoice_choice, hf_index, ett_ldap_AuthenticationChoice,
1451 ldap_do_protocolop(actx->pinfo);
1453 if((branch > -1) && (branch < (gint)(sizeof AuthenticationChoice_choice/sizeof AuthenticationChoice_choice[0])))
1454 auth = AuthenticationChoice_choice[branch].value;
1456 valstr = val_to_str(auth, ldap_AuthenticationChoice_vals, "Unknown auth(%u)");
1458 /* If auth is NTLM (10 or 11) don't add to column as the NTLM dissection will do this */
1459 if ((auth != 10) && (auth != 11))
1460 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", valstr);
1463 proto_item_append_text(ldm_tree, " %s", valstr);
1472 static const ber_sequence_t BindRequest_U_sequence[] = {
1473 { &hf_ldap_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_INTEGER_1_127 },
1474 { &hf_ldap_name , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
1475 { &hf_ldap_authentication , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ldap_AuthenticationChoice },
1476 { NULL, 0, 0, 0, NULL }
1480 dissect_ldap_BindRequest_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_) {
1481 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1482 BindRequest_U_sequence, hf_index, ett_ldap_BindRequest_U);
1490 dissect_ldap_BindRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1491 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1492 hf_index, BER_CLASS_APP, 0, TRUE, dissect_ldap_BindRequest_U);
1498 static const value_string ldap_BindResponse_resultCode_vals[] = {
1500 { 1, "operationsError" },
1501 { 2, "protocolError" },
1502 { 3, "timeLimitExceeded" },
1503 { 4, "sizeLimitExceeded" },
1504 { 5, "compareFalse" },
1505 { 6, "compareTrue" },
1506 { 7, "authMethodNotSupported" },
1507 { 8, "strongAuthRequired" },
1509 { 11, "adminLimitExceeded" },
1510 { 12, "unavailableCriticalExtension" },
1511 { 13, "confidentialityRequired" },
1512 { 14, "saslBindInProgress" },
1513 { 16, "noSuchAttribute" },
1514 { 17, "undefinedAttributeType" },
1515 { 18, "inappropriateMatching" },
1516 { 19, "constraintViolation" },
1517 { 20, "attributeOrValueExists" },
1518 { 21, "invalidAttributeSyntax" },
1519 { 32, "noSuchObject" },
1520 { 33, "aliasProblem" },
1521 { 34, "invalidDNSyntax" },
1522 { 36, "aliasDereferencingProblem" },
1523 { 48, "inappropriateAuthentication" },
1524 { 49, "invalidCredentials" },
1525 { 50, "insufficientAccessRights" },
1527 { 52, "unavailable" },
1528 { 53, "unwillingToPerform" },
1529 { 54, "loopDetect" },
1530 { 64, "namingViolation" },
1531 { 65, "objectClassViolation" },
1532 { 66, "notAllowedOnNonLeaf" },
1533 { 67, "notAllowedOnRDN" },
1534 { 68, "entryAlreadyExists" },
1535 { 69, "objectClassModsProhibited" },
1536 { 71, "affectsMultipleDSAs" },
1538 { 118, "canceled" },
1539 { 119, "noSuchOperation" },
1541 { 121, "cannotCancel" },
1547 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_) {
1548 #line 420 "./asn1/ldap/ldap.cnf"
1550 const gchar *valstr;
1552 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1556 ldap_do_protocolop(actx->pinfo);
1558 valstr = val_to_str(result, ldap_BindResponse_resultCode_vals, "Unknown result(%u)");
1560 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", valstr);
1563 proto_item_append_text(ldm_tree, " %s", valstr);
1573 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_) {
1574 #line 703 "./asn1/ldap/ldap.cnf"
1575 tvbuff_t *new_tvb=NULL;
1577 offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_ldap_matchedDN, &new_tvb);
1580 && (tvb_reported_length(new_tvb)>=7)
1581 && (!tvb_memeql(new_tvb, 0, "NTLMSSP", 7))){
1583 /* make sure the protocol op comes first */
1584 ldap_do_protocolop(actx->pinfo);
1586 call_dissector(ntlmssp_handle, new_tvb, actx->pinfo, tree);
1597 dissect_ldap_ErrorMessage(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1598 offset = dissect_ldap_LDAPString(implicit_tag, tvb, offset, actx, tree, hf_index);
1606 dissect_ldap_LDAPURL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1607 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1610 #line 54 "./asn1/ldap/ldap.cnf"
1611 PROTO_ITEM_SET_URL(actx->created_item);
1618 static const ber_sequence_t Referral_sequence_of[1] = {
1619 { &hf_ldap_Referral_item , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPURL },
1623 dissect_ldap_Referral(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1624 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1625 Referral_sequence_of, hf_index, ett_ldap_Referral);
1633 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_) {
1634 #line 231 "./asn1/ldap/ldap.cnf"
1636 tvbuff_t *parameter_tvb = NULL;
1637 ldap_conv_info_t *ldap_info;
1639 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1644 ldap_info = (ldap_conv_info_t *)actx->private_data;
1645 switch (ldap_info->auth_type) {
1647 /* For Kerberos V4, dissect it as a ticket. */
1648 /* XXX - what about LDAP_AUTH_SIMPLE? */
1650 case LDAP_AUTH_SASL:
1652 * All frames after this are assumed to use a security layer.
1654 * XXX - won't work if there's another reply, with the security
1655 * layer, starting in the same TCP segment that ends this
1656 * reply, but as LDAP is a request/response protocol, and
1657 * as the client probably can't start using authentication until
1658 * it gets the bind reply and the server won't send a reply until
1659 * it gets a request, that probably won't happen.
1661 * XXX - that assumption is invalid; it's not clear where the
1662 * hell you find out whether there's any security layer. In
1663 * one capture, we have two GSS-SPNEGO negotiations, both of
1664 * which select MS KRB5, and the only differences in the tokens
1665 * is in the RC4-HMAC ciphertext. The various
1666 * draft-ietf--cat-sasl-gssapi-NN.txt drafts seem to imply
1667 * that the RFC 2222 spoo with the bitmask and maximum
1668 * output message size stuff is done - but where does that
1669 * stuff show up? Is it in the ciphertext, which means it's
1670 * presumably encrypted?
1672 * Grrr. We have to do a gross heuristic, checking whether the
1673 * putative LDAP message begins with 0x00 or not, making the
1674 * assumption that we won't have more than 2^24 bytes of
1675 * encapsulated stuff.
1677 ldap_info->first_auth_frame = actx->pinfo->num + 1;
1678 if (ldap_info->auth_mech != NULL &&
1679 strcmp(ldap_info->auth_mech, "GSS-SPNEGO") == 0) {
1680 /* It could be the second leg of GSS-SPNEGO wrapping NTLMSSP
1681 * which might not be wrapped in GSS-SPNEGO but be a raw
1684 if ( (tvb_reported_length(parameter_tvb)>=7)
1685 && (!tvb_memeql(parameter_tvb, 0, "NTLMSSP", 7))){
1686 call_dissector(ntlmssp_handle, parameter_tvb, actx->pinfo, tree);
1690 * This is a GSS-API token.
1692 if(parameter_tvb && (tvb_reported_length(parameter_tvb) > 0))
1693 call_dissector(spnego_handle, parameter_tvb, actx->pinfo, tree);
1694 } else if (ldap_info->auth_mech != NULL &&
1695 strcmp(ldap_info->auth_mech, "GSSAPI") == 0) {
1697 * This is a GSS-API token.
1699 if(parameter_tvb && (tvb_reported_length(parameter_tvb) > 0))
1700 call_dissector(gssapi_handle, parameter_tvb, actx->pinfo, tree);
1704 actx->private_data = ldap_info;
1712 static const ber_sequence_t BindResponse_U_sequence[] = {
1713 { &hf_ldap_bindResponse_resultCode, BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_BindResponse_resultCode },
1714 { &hf_ldap_bindResponse_matchedDN, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_T_bindResponse_matchedDN },
1715 { &hf_ldap_errorMessage , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_ErrorMessage },
1716 { &hf_ldap_referral , BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_Referral },
1717 { &hf_ldap_serverSaslCreds, BER_CLASS_CON, 7, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_ServerSaslCreds },
1718 { NULL, 0, 0, 0, NULL }
1722 dissect_ldap_BindResponse_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_) {
1723 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1724 BindResponse_U_sequence, hf_index, ett_ldap_BindResponse_U);
1732 dissect_ldap_BindResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1733 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1734 hf_index, BER_CLASS_APP, 1, TRUE, dissect_ldap_BindResponse_U);
1742 dissect_ldap_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1743 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
1751 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_) {
1752 #line 508 "./asn1/ldap/ldap.cnf"
1754 implicit_tag = TRUE; /* correct problem with asn2wrs */
1756 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1757 hf_index, BER_CLASS_APP, 2, TRUE, dissect_ldap_NULL);
1760 ldap_do_protocolop(actx->pinfo);
1772 static const value_string ldap_T_scope_vals[] = {
1773 { 0, "baseObject" },
1774 { 1, "singleLevel" },
1775 { 2, "wholeSubtree" },
1781 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_) {
1782 #line 388 "./asn1/ldap/ldap.cnf"
1784 guint32 scope = 0xffff;
1785 const gchar *valstr;
1787 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1791 ldap_do_protocolop(actx->pinfo);
1793 valstr = val_to_str(scope, ldap_T_scope_vals, "Unknown scope(%u)");
1795 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", valstr);
1798 proto_item_append_text(ldm_tree, " %s", valstr);
1806 static const value_string ldap_T_derefAliases_vals[] = {
1807 { 0, "neverDerefAliases" },
1808 { 1, "derefInSearching" },
1809 { 2, "derefFindingBaseObj" },
1810 { 3, "derefAlways" },
1816 dissect_ldap_T_derefAliases(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1817 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1826 dissect_ldap_INTEGER_0_maxInt(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1827 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1836 dissect_ldap_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1837 offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
1845 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_) {
1846 offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index);
1848 #line 554 "./asn1/ldap/ldap.cnf"
1849 if(and_filter_string){
1850 and_filter_string=wmem_strdup_printf(wmem_packet_scope(), "(&%s%s)",and_filter_string,Filter_string);
1852 and_filter_string=Filter_string;
1860 static const ber_sequence_t T_and_set_of[1] = {
1861 { &hf_ldap_and_item , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ldap_T_and_item },
1865 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_) {
1866 #line 561 "./asn1/ldap/ldap.cnf"
1867 proto_tree *tr=NULL;
1868 proto_item *it=NULL;
1869 const char *old_and_filter_string=and_filter_string;
1871 and_filter_string=NULL;
1873 tr=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ldap_T_and, &it, "and: ");
1876 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
1877 T_and_set_of, hf_index, ett_ldap_T_and);
1880 if(and_filter_string) {
1881 proto_item_append_text(it, "%s", and_filter_string);
1882 Filter_string=wmem_strdup(wmem_packet_scope(), and_filter_string);
1884 and_filter_string=old_and_filter_string;
1894 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_) {
1895 offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index);
1897 #line 579 "./asn1/ldap/ldap.cnf"
1898 if(or_filter_string){
1899 or_filter_string=wmem_strdup_printf(wmem_packet_scope(), "(|%s%s)",or_filter_string,Filter_string);
1901 or_filter_string=Filter_string;
1910 static const ber_sequence_t T_or_set_of[1] = {
1911 { &hf_ldap_or_item , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ldap_T_or_item },
1915 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_) {
1916 #line 587 "./asn1/ldap/ldap.cnf"
1919 const char *old_or_filter_string=or_filter_string;
1921 or_filter_string=NULL;
1922 tr=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ldap_T_or, &it, "or: ");
1925 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
1926 T_or_set_of, hf_index, ett_ldap_T_or);
1928 if(or_filter_string) {
1929 proto_item_append_text(it, "%s", or_filter_string);
1930 Filter_string=wmem_strdup(wmem_packet_scope(), or_filter_string);
1932 or_filter_string=old_or_filter_string;
1942 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_) {
1943 offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index);
1945 #line 606 "./asn1/ldap/ldap.cnf"
1946 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(!%s)",string_or_null(Filter_string));
1955 dissect_ldap_AttributeDescription(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1956 offset = dissect_ldap_LDAPString(implicit_tag, tvb, offset, actx, tree, hf_index);
1963 static const ber_sequence_t AttributeValueAssertion_sequence[] = {
1964 { &hf_ldap_attributeDesc , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
1965 { &hf_ldap_assertionValue , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AssertionValue },
1966 { NULL, 0, 0, 0, NULL }
1970 dissect_ldap_AttributeValueAssertion(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1971 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1972 AttributeValueAssertion_sequence, hf_index, ett_ldap_AttributeValueAssertion);
1980 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_) {
1981 offset = dissect_ldap_AttributeValueAssertion(implicit_tag, tvb, offset, actx, tree, hf_index);
1983 #line 531 "./asn1/ldap/ldap.cnf"
1984 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s=%s)",
1985 string_or_null(attributedesc_string),
1986 string_or_null(ldapvalue_string));
1994 static const value_string ldap_T_substringFilter_substrings_item_vals[] = {
2001 static const ber_choice_t T_substringFilter_substrings_item_choice[] = {
2002 { 0, &hf_ldap_initial , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ldap_LDAPString },
2003 { 1, &hf_ldap_any , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ldap_LDAPString },
2004 { 2, &hf_ldap_final , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_ldap_LDAPString },
2005 { 0, NULL, 0, 0, 0, NULL }
2009 dissect_ldap_T_substringFilter_substrings_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_) {
2010 offset = dissect_ber_choice(actx, tree, tvb, offset,
2011 T_substringFilter_substrings_item_choice, hf_index, ett_ldap_T_substringFilter_substrings_item,
2014 #line 632 "./asn1/ldap/ldap.cnf"
2015 if (substring_item_final) {
2016 substring_value=wmem_strdup_printf(wmem_packet_scope(), "%s%s",
2017 (substring_value?substring_value:"*"),
2018 substring_item_final);
2019 } else if (substring_item_any) {
2020 substring_value=wmem_strdup_printf(wmem_packet_scope(), "%s%s*",
2021 (substring_value?substring_value:"*"),
2022 substring_item_any);
2023 } else if (substring_item_init) {
2024 substring_value=wmem_strdup_printf(wmem_packet_scope(), "%s*",
2025 substring_item_init);
2033 static const ber_sequence_t T_substringFilter_substrings_sequence_of[1] = {
2034 { &hf_ldap_substringFilter_substrings_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ldap_T_substringFilter_substrings_item },
2038 dissect_ldap_T_substringFilter_substrings(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2039 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2040 T_substringFilter_substrings_sequence_of, hf_index, ett_ldap_T_substringFilter_substrings);
2046 static const ber_sequence_t SubstringFilter_sequence[] = {
2047 { &hf_ldap_type , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
2048 { &hf_ldap_substringFilter_substrings, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_T_substringFilter_substrings },
2049 { NULL, 0, 0, 0, NULL }
2053 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_) {
2054 #line 646 "./asn1/ldap/ldap.cnf"
2057 const char *old_substring_value=substring_value;
2060 substring_value=NULL;
2061 substring_item_init=NULL;
2062 substring_item_any=NULL;
2063 substring_item_final=NULL;
2065 tr=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ldap_SubstringFilter, &it, "substring: ");
2068 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2069 SubstringFilter_sequence, hf_index, ett_ldap_SubstringFilter);
2071 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s=%s)",
2072 string_or_null(attr_type),
2073 string_or_null(substring_value));
2074 proto_item_append_text(it, "%s", Filter_string);
2075 substring_value=old_substring_value;
2085 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_) {
2086 offset = dissect_ldap_AttributeValueAssertion(implicit_tag, tvb, offset, actx, tree, hf_index);
2088 #line 537 "./asn1/ldap/ldap.cnf"
2089 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s>=%s)",
2090 string_or_null(attributedesc_string),
2091 string_or_null(ldapvalue_string));
2101 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_) {
2102 offset = dissect_ldap_AttributeValueAssertion(implicit_tag, tvb, offset, actx, tree, hf_index);
2104 #line 543 "./asn1/ldap/ldap.cnf"
2105 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s<=%s)",
2106 string_or_null(attributedesc_string),
2107 string_or_null(ldapvalue_string));
2117 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_) {
2118 offset = dissect_ldap_AttributeDescription(implicit_tag, tvb, offset, actx, tree, hf_index);
2120 #line 603 "./asn1/ldap/ldap.cnf"
2121 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s=*)",string_or_null(Filter_string));
2130 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_) {
2131 offset = dissect_ldap_AttributeValueAssertion(implicit_tag, tvb, offset, actx, tree, hf_index);
2133 #line 549 "./asn1/ldap/ldap.cnf"
2134 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s~=%s)",
2135 string_or_null(attributedesc_string),
2136 string_or_null(ldapvalue_string));
2145 dissect_ldap_MatchingRuleId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2146 offset = dissect_ldap_LDAPString(implicit_tag, tvb, offset, actx, tree, hf_index);
2154 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_) {
2155 #line 609 "./asn1/ldap/ldap.cnf"
2158 offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, &val);
2161 matching_rule_dnattr = val;
2170 static const ber_sequence_t MatchingRuleAssertion_sequence[] = {
2171 { &hf_ldap_matchingRule , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_MatchingRuleId },
2172 { &hf_ldap_type , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_AttributeDescription },
2173 { &hf_ldap_matchValue , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_ldap_AssertionValue },
2174 { &hf_ldap_dnAttributes , BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_T_dnAttributes },
2175 { NULL, 0, 0, 0, NULL }
2179 dissect_ldap_MatchingRuleAssertion(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2180 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2181 MatchingRuleAssertion_sequence, hf_index, ett_ldap_MatchingRuleAssertion);
2189 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_) {
2190 #line 618 "./asn1/ldap/ldap.cnf"
2192 matching_rule_string=NULL;
2193 ldapvalue_string=NULL;
2194 matching_rule_dnattr=FALSE;
2197 offset = dissect_ldap_MatchingRuleAssertion(implicit_tag, tvb, offset, actx, tree, hf_index);
2199 #line 624 "./asn1/ldap/ldap.cnf"
2200 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s:%s%s%s=%s)",
2201 (attr_type?attr_type:""),
2202 (matching_rule_dnattr?"dn:":""),
2203 (matching_rule_string?matching_rule_string:""),
2204 (matching_rule_string?":":""),
2205 string_or_null(ldapvalue_string));
2212 static const value_string ldap_Filter_vals[] = {
2216 { 3, "equalityMatch" },
2217 { 4, "substrings" },
2218 { 5, "greaterOrEqual" },
2219 { 6, "lessOrEqual" },
2221 { 8, "approxMatch" },
2222 { 9, "extensibleMatch" },
2226 static const ber_choice_t Filter_choice[] = {
2227 { 0, &hf_ldap_and , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ldap_T_and },
2228 { 1, &hf_ldap_or , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ldap_T_or },
2229 { 2, &hf_ldap_not , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_ldap_T_not },
2230 { 3, &hf_ldap_equalityMatch , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_ldap_T_equalityMatch },
2231 { 4, &hf_ldap_substrings , BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_ldap_SubstringFilter },
2232 { 5, &hf_ldap_greaterOrEqual , BER_CLASS_CON, 5, BER_FLAGS_IMPLTAG, dissect_ldap_T_greaterOrEqual },
2233 { 6, &hf_ldap_lessOrEqual , BER_CLASS_CON, 6, BER_FLAGS_IMPLTAG, dissect_ldap_T_lessOrEqual },
2234 { 7, &hf_ldap_present , BER_CLASS_CON, 7, BER_FLAGS_IMPLTAG, dissect_ldap_T_present },
2235 { 8, &hf_ldap_approxMatch , BER_CLASS_CON, 8, BER_FLAGS_IMPLTAG, dissect_ldap_T_approxMatch },
2236 { 9, &hf_ldap_extensibleMatch, BER_CLASS_CON, 9, BER_FLAGS_IMPLTAG, dissect_ldap_T_extensibleMatch },
2237 { 0, NULL, 0, 0, 0, NULL }
2241 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_) {
2242 #line 667 "./asn1/ldap/ldap.cnf"
2245 attributedesc_string=NULL;
2247 if (Filter_length++ > MAX_FILTER_LEN) {
2248 expert_add_info_format(actx->pinfo, tree, &ei_ldap_exceeded_filter_length, "Filter length exceeds %u. Giving up.", MAX_FILTER_LEN);
2249 THROW(ReportedBoundsError);
2252 if (Filter_elements++ > MAX_FILTER_ELEMENTS) {
2253 expert_add_info_format(actx->pinfo, tree, &ei_ldap_too_many_filter_elements, "Found more than %u filter elements. Giving up.", MAX_FILTER_ELEMENTS);
2254 THROW(ReportedBoundsError);
2257 tr=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ldap_Filter, &it, "Filter: ");
2260 offset = dissect_ber_choice(actx, tree, tvb, offset,
2261 Filter_choice, hf_index, ett_ldap_Filter,
2265 proto_item_append_text(it, "%s", string_or_null(Filter_string));
2275 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_) {
2276 #line 520 "./asn1/ldap/ldap.cnf"
2278 Filter_elements = 0;
2282 offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index);
2284 #line 525 "./asn1/ldap/ldap.cnf"
2286 and_filter_string=NULL;
2287 Filter_elements = 0;
2295 static const ber_sequence_t AttributeDescriptionList_sequence_of[1] = {
2296 { &hf_ldap_AttributeDescriptionList_item, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
2300 dissect_ldap_AttributeDescriptionList(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2301 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2302 AttributeDescriptionList_sequence_of, hf_index, ett_ldap_AttributeDescriptionList);
2308 static const ber_sequence_t SearchRequest_U_sequence[] = {
2309 { &hf_ldap_baseObject , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2310 { &hf_ldap_scope , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_scope },
2311 { &hf_ldap_derefAliases , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_derefAliases },
2312 { &hf_ldap_sizeLimit , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_INTEGER_0_maxInt },
2313 { &hf_ldap_timeLimit , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_INTEGER_0_maxInt },
2314 { &hf_ldap_typesOnly , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
2315 { &hf_ldap_filter , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ldap_T_filter },
2316 { &hf_ldap_searchRequest_attributes, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescriptionList },
2317 { NULL, 0, 0, 0, NULL }
2321 dissect_ldap_SearchRequest_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_) {
2322 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2323 SearchRequest_U_sequence, hf_index, ett_ldap_SearchRequest_U);
2331 dissect_ldap_SearchRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2332 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2333 hf_index, BER_CLASS_APP, 3, TRUE, dissect_ldap_SearchRequest_U);
2341 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_) {
2342 #line 450 "./asn1/ldap/ldap.cnf"
2344 tvbuff_t *next_tvb = NULL;
2347 int old_offset = offset;
2350 /* attr_type, should be set before calling this function */
2352 /* extract the value of the octetstring */
2353 offset = dissect_ber_octet_string(FALSE, actx, NULL, tvb, offset, hf_index, &next_tvb);
2355 /* first check if we have a custom attribute type configured */
2356 if ((hf_id = get_hf_for_header (attr_type)) != NULL)
2357 proto_tree_add_item (tree, *hf_id, next_tvb, 0, tvb_reported_length_remaining(next_tvb, 0), ENC_UTF_8|ENC_NA);
2359 /* if we have an attribute type that isn't binary see if there is a better dissector */
2360 else if(!attr_type || !next_tvb || !dissector_try_string_new(ldap_name_dissector_table, attr_type, next_tvb, actx->pinfo, tree, FALSE, NULL)) {
2361 offset = old_offset;
2363 /* do the default thing */
2364 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
2368 len = tvb_reported_length_remaining(next_tvb, 0);
2370 for(i = 0; i < len; i++)
2371 if(!g_ascii_isprint(tvb_get_guint8(next_tvb, i)))
2375 string = tvb_get_string_enc(wmem_packet_scope(), next_tvb, 0, tvb_reported_length_remaining(next_tvb, 0), ENC_ASCII|ENC_NA);
2376 proto_item_set_text(actx->created_item, "AttributeValue: %s", string);
2386 static const ber_sequence_t SET_OF_AttributeValue_set_of[1] = {
2387 { &hf_ldap_vals_item , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeValue },
2391 dissect_ldap_SET_OF_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_) {
2392 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
2393 SET_OF_AttributeValue_set_of, hf_index, ett_ldap_SET_OF_AttributeValue);
2399 static const ber_sequence_t PartialAttributeList_item_sequence[] = {
2400 { &hf_ldap_type , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
2401 { &hf_ldap_vals , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_ldap_SET_OF_AttributeValue },
2402 { NULL, 0, 0, 0, NULL }
2406 dissect_ldap_PartialAttributeList_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_) {
2407 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2408 PartialAttributeList_item_sequence, hf_index, ett_ldap_PartialAttributeList_item);
2414 static const ber_sequence_t PartialAttributeList_sequence_of[1] = {
2415 { &hf_ldap_PartialAttributeList_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_PartialAttributeList_item },
2419 dissect_ldap_PartialAttributeList(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2420 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2421 PartialAttributeList_sequence_of, hf_index, ett_ldap_PartialAttributeList);
2427 static const ber_sequence_t SearchResultEntry_U_sequence[] = {
2428 { &hf_ldap_objectName , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2429 { &hf_ldap_searchResultEntry_attributes, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_PartialAttributeList },
2430 { NULL, 0, 0, 0, NULL }
2434 dissect_ldap_SearchResultEntry_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_) {
2435 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2436 SearchResultEntry_U_sequence, hf_index, ett_ldap_SearchResultEntry_U);
2444 dissect_ldap_SearchResultEntry(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2445 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2446 hf_index, BER_CLASS_APP, 4, TRUE, dissect_ldap_SearchResultEntry_U);
2452 static const value_string ldap_T_resultCode_vals[] = {
2454 { 1, "operationsError" },
2455 { 2, "protocolError" },
2456 { 3, "timeLimitExceeded" },
2457 { 4, "sizeLimitExceeded" },
2458 { 5, "compareFalse" },
2459 { 6, "compareTrue" },
2460 { 7, "authMethodNotSupported" },
2461 { 8, "strongAuthRequired" },
2463 { 11, "adminLimitExceeded" },
2464 { 12, "unavailableCriticalExtension" },
2465 { 13, "confidentialityRequired" },
2466 { 14, "saslBindInProgress" },
2467 { 16, "noSuchAttribute" },
2468 { 17, "undefinedAttributeType" },
2469 { 18, "inappropriateMatching" },
2470 { 19, "constraintViolation" },
2471 { 20, "attributeOrValueExists" },
2472 { 21, "invalidAttributeSyntax" },
2473 { 32, "noSuchObject" },
2474 { 33, "aliasProblem" },
2475 { 34, "invalidDNSyntax" },
2476 { 36, "aliasDereferencingProblem" },
2477 { 48, "inappropriateAuthentication" },
2478 { 49, "invalidCredentials" },
2479 { 50, "insufficientAccessRights" },
2481 { 52, "unavailable" },
2482 { 53, "unwillingToPerform" },
2483 { 54, "loopDetect" },
2484 { 64, "namingViolation" },
2485 { 65, "objectClassViolation" },
2486 { 66, "notAllowedOnNonLeaf" },
2487 { 67, "notAllowedOnRDN" },
2488 { 68, "entryAlreadyExists" },
2489 { 69, "objectClassModsProhibited" },
2490 { 71, "affectsMultipleDSAs" },
2492 { 118, "canceled" },
2493 { 119, "noSuchOperation" },
2495 { 121, "cannotCancel" },
2501 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_) {
2502 #line 404 "./asn1/ldap/ldap.cnf"
2504 const gchar *valstr;
2506 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
2510 ldap_do_protocolop(actx->pinfo);
2512 valstr = val_to_str(result, ldap_T_resultCode_vals, "Unknown result(%u)");
2514 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", valstr);
2517 proto_item_append_text(ldm_tree, " %s", valstr);
2526 static const ber_sequence_t LDAPResult_sequence[] = {
2527 { &hf_ldap_resultCode , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_resultCode },
2528 { &hf_ldap_matchedDN , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2529 { &hf_ldap_errorMessage , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_ErrorMessage },
2530 { &hf_ldap_referral , BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_Referral },
2531 { NULL, 0, 0, 0, NULL }
2535 dissect_ldap_LDAPResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2536 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2537 LDAPResult_sequence, hf_index, ett_ldap_LDAPResult);
2545 dissect_ldap_SearchResultDone(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2546 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2547 hf_index, BER_CLASS_APP, 5, TRUE, dissect_ldap_LDAPResult);
2553 static const ber_sequence_t SEQUENCE_OF_LDAPURL_sequence_of[1] = {
2554 { &hf_ldap__untag_item , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPURL },
2558 dissect_ldap_SEQUENCE_OF_LDAPURL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2559 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2560 SEQUENCE_OF_LDAPURL_sequence_of, hf_index, ett_ldap_SEQUENCE_OF_LDAPURL);
2568 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_) {
2569 #line 795 "./asn1/ldap/ldap.cnf"
2571 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2572 hf_index, BER_CLASS_APP, 19, TRUE, dissect_ldap_SEQUENCE_OF_LDAPURL);
2575 ldap_do_protocolop(actx->pinfo);
2584 static const value_string ldap_T_operation_vals[] = {
2594 dissect_ldap_T_operation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2595 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
2602 static const ber_sequence_t AttributeTypeAndValues_sequence[] = {
2603 { &hf_ldap_type , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
2604 { &hf_ldap_vals , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_ldap_SET_OF_AttributeValue },
2605 { NULL, 0, 0, 0, NULL }
2609 dissect_ldap_AttributeTypeAndValues(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2610 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2611 AttributeTypeAndValues_sequence, hf_index, ett_ldap_AttributeTypeAndValues);
2617 static const ber_sequence_t T_modifyRequest_modification_item_sequence[] = {
2618 { &hf_ldap_operation , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_operation },
2619 { &hf_ldap_modification , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeTypeAndValues },
2620 { NULL, 0, 0, 0, NULL }
2624 dissect_ldap_T_modifyRequest_modification_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_) {
2625 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2626 T_modifyRequest_modification_item_sequence, hf_index, ett_ldap_T_modifyRequest_modification_item);
2632 static const ber_sequence_t ModifyRequest_modification_sequence_of[1] = {
2633 { &hf_ldap_modifyRequest_modification_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_T_modifyRequest_modification_item },
2637 dissect_ldap_ModifyRequest_modification(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2638 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2639 ModifyRequest_modification_sequence_of, hf_index, ett_ldap_ModifyRequest_modification);
2645 static const ber_sequence_t ModifyRequest_U_sequence[] = {
2646 { &hf_ldap_object , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2647 { &hf_ldap_modifyRequest_modification, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_ModifyRequest_modification },
2648 { NULL, 0, 0, 0, NULL }
2652 dissect_ldap_ModifyRequest_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_) {
2653 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2654 ModifyRequest_U_sequence, hf_index, ett_ldap_ModifyRequest_U);
2662 dissect_ldap_ModifyRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2663 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2664 hf_index, BER_CLASS_APP, 6, TRUE, dissect_ldap_ModifyRequest_U);
2672 dissect_ldap_ModifyResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2673 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2674 hf_index, BER_CLASS_APP, 7, TRUE, dissect_ldap_LDAPResult);
2680 static const ber_sequence_t AttributeList_item_sequence[] = {
2681 { &hf_ldap_type , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
2682 { &hf_ldap_vals , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_ldap_SET_OF_AttributeValue },
2683 { NULL, 0, 0, 0, NULL }
2687 dissect_ldap_AttributeList_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_) {
2688 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2689 AttributeList_item_sequence, hf_index, ett_ldap_AttributeList_item);
2695 static const ber_sequence_t AttributeList_sequence_of[1] = {
2696 { &hf_ldap_AttributeList_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeList_item },
2700 dissect_ldap_AttributeList(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2701 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2702 AttributeList_sequence_of, hf_index, ett_ldap_AttributeList);
2708 static const ber_sequence_t AddRequest_U_sequence[] = {
2709 { &hf_ldap_entry , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2710 { &hf_ldap_attributes , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeList },
2711 { NULL, 0, 0, 0, NULL }
2715 dissect_ldap_AddRequest_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_) {
2716 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2717 AddRequest_U_sequence, hf_index, ett_ldap_AddRequest_U);
2725 dissect_ldap_AddRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2726 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2727 hf_index, BER_CLASS_APP, 8, TRUE, dissect_ldap_AddRequest_U);
2735 dissect_ldap_AddResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2736 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2737 hf_index, BER_CLASS_APP, 9, TRUE, dissect_ldap_LDAPResult);
2745 dissect_ldap_DelRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2746 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2747 hf_index, BER_CLASS_APP, 10, TRUE, dissect_ldap_LDAPDN);
2755 dissect_ldap_DelResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2756 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2757 hf_index, BER_CLASS_APP, 11, TRUE, dissect_ldap_LDAPResult);
2765 dissect_ldap_RelativeLDAPDN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2766 offset = dissect_ldap_LDAPString(implicit_tag, tvb, offset, actx, tree, hf_index);
2772 static const ber_sequence_t ModifyDNRequest_U_sequence[] = {
2773 { &hf_ldap_entry , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2774 { &hf_ldap_newrdn , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_RelativeLDAPDN },
2775 { &hf_ldap_deleteoldrdn , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
2776 { &hf_ldap_newSuperior , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_LDAPDN },
2777 { NULL, 0, 0, 0, NULL }
2781 dissect_ldap_ModifyDNRequest_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_) {
2782 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2783 ModifyDNRequest_U_sequence, hf_index, ett_ldap_ModifyDNRequest_U);
2791 dissect_ldap_ModifyDNRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2792 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2793 hf_index, BER_CLASS_APP, 12, TRUE, dissect_ldap_ModifyDNRequest_U);
2801 dissect_ldap_ModifyDNResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2802 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2803 hf_index, BER_CLASS_APP, 13, TRUE, dissect_ldap_LDAPResult);
2809 static const ber_sequence_t CompareRequest_U_sequence[] = {
2810 { &hf_ldap_entry , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2811 { &hf_ldap_ava , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeValueAssertion },
2812 { NULL, 0, 0, 0, NULL }
2816 dissect_ldap_CompareRequest_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_) {
2817 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2818 CompareRequest_U_sequence, hf_index, ett_ldap_CompareRequest_U);
2826 dissect_ldap_CompareRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2827 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2828 hf_index, BER_CLASS_APP, 14, TRUE, dissect_ldap_CompareRequest_U);
2836 dissect_ldap_CompareResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2837 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2838 hf_index, BER_CLASS_APP, 15, TRUE, dissect_ldap_LDAPResult);
2846 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_) {
2847 #line 802 "./asn1/ldap/ldap.cnf"
2849 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2850 hf_index, BER_CLASS_APP, 16, TRUE, dissect_ldap_MessageID);
2853 ldap_do_protocolop(actx->pinfo);
2863 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_) {
2864 #line 57 "./asn1/ldap/ldap.cnf"
2866 tvbuff_t *parameter_tvb;
2868 ldap_conv_info_t *ldap_info = (ldap_conv_info_t *)actx->private_data;
2871 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
2874 #line 65 "./asn1/ldap/ldap.cnf"
2876 object_identifier_id = NULL;
2881 object_identifier_id = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, tvb_reported_length_remaining(parameter_tvb,0), ENC_UTF_8|ENC_NA);
2882 name = oid_resolved_from_string(wmem_packet_scope(), object_identifier_id);
2885 proto_item_append_text(actx->created_item, " (%s)", name);
2887 if((hf_index == hf_ldap_requestName) || (hf_index == hf_ldap_responseName)) {
2888 ldap_do_protocolop(actx->pinfo);
2889 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", name);
2893 /* Has the client requested the Start TLS operation? */
2894 if (ldap_info && hf_index == hf_ldap_requestName &&
2895 !strcmp(object_identifier_id, "1.3.6.1.4.1.1466.20037")) {
2896 /* remember we have asked to start_tls */
2897 ldap_info->start_tls_pending = TRUE;
2907 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_) {
2908 #line 737 "./asn1/ldap/ldap.cnf"
2910 if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) {
2911 offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
2913 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
2924 static const ber_sequence_t ExtendedRequest_U_sequence[] = {
2925 { &hf_ldap_requestName , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ldap_LDAPOID },
2926 { &hf_ldap_requestValue , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_T_requestValue },
2927 { NULL, 0, 0, 0, NULL }
2931 dissect_ldap_ExtendedRequest_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_) {
2932 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2933 ExtendedRequest_U_sequence, hf_index, ett_ldap_ExtendedRequest_U);
2941 dissect_ldap_ExtendedRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2942 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2943 hf_index, BER_CLASS_APP, 23, TRUE, dissect_ldap_ExtendedRequest_U);
2949 static const value_string ldap_ExtendedResponse_resultCode_vals[] = {
2951 { 1, "operationsError" },
2952 { 2, "protocolError" },
2953 { 3, "timeLimitExceeded" },
2954 { 4, "sizeLimitExceeded" },
2955 { 5, "compareFalse" },
2956 { 6, "compareTrue" },
2957 { 7, "authMethodNotSupported" },
2958 { 8, "strongAuthRequired" },
2960 { 11, "adminLimitExceeded" },
2961 { 12, "unavailableCriticalExtension" },
2962 { 13, "confidentialityRequired" },
2963 { 14, "saslBindInProgress" },
2964 { 16, "noSuchAttribute" },
2965 { 17, "undefinedAttributeType" },
2966 { 18, "inappropriateMatching" },
2967 { 19, "constraintViolation" },
2968 { 20, "attributeOrValueExists" },
2969 { 21, "invalidAttributeSyntax" },
2970 { 32, "noSuchObject" },
2971 { 33, "aliasProblem" },
2972 { 34, "invalidDNSyntax" },
2973 { 36, "aliasDereferencingProblem" },
2974 { 48, "inappropriateAuthentication" },
2975 { 49, "invalidCredentials" },
2976 { 50, "insufficientAccessRights" },
2978 { 52, "unavailable" },
2979 { 53, "unwillingToPerform" },
2980 { 54, "loopDetect" },
2981 { 64, "namingViolation" },
2982 { 65, "objectClassViolation" },
2983 { 66, "notAllowedOnNonLeaf" },
2984 { 67, "notAllowedOnRDN" },
2985 { 68, "entryAlreadyExists" },
2986 { 69, "objectClassModsProhibited" },
2987 { 71, "affectsMultipleDSAs" },
2989 { 118, "canceled" },
2990 { 119, "noSuchOperation" },
2992 { 121, "cannotCancel" },
2998 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_) {
2999 #line 435 "./asn1/ldap/ldap.cnf"
3001 ldap_conv_info_t *ldap_info = (ldap_conv_info_t *)actx->private_data;
3003 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
3005 /* If Start TLS request was sent and resultCode is success... */
3006 if (ldap_info && ldap_info->start_tls_pending &&
3007 hf_index == hf_ldap_extendedResponse_resultCode && resultCode == 0) {
3008 /* The conversation will continue using SSL */
3009 ssl_starttls_ack(find_dissector("ssl"), actx->pinfo, ldap_handle);
3010 ldap_info->start_tls_pending = FALSE;
3022 dissect_ldap_ResponseName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3023 offset = dissect_ldap_LDAPOID(implicit_tag, tvb, offset, actx, tree, hf_index);
3031 dissect_ldap_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3032 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
3039 static const ber_sequence_t ExtendedResponse_U_sequence[] = {
3040 { &hf_ldap_extendedResponse_resultCode, BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_ExtendedResponse_resultCode },
3041 { &hf_ldap_matchedDN , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
3042 { &hf_ldap_errorMessage , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_ErrorMessage },
3043 { &hf_ldap_referral , BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_Referral },
3044 { &hf_ldap_responseName , BER_CLASS_CON, 10, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_ResponseName },
3045 { &hf_ldap_response , BER_CLASS_CON, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_OCTET_STRING },
3046 { NULL, 0, 0, 0, NULL }
3050 dissect_ldap_ExtendedResponse_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_) {
3051 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3052 ExtendedResponse_U_sequence, hf_index, ett_ldap_ExtendedResponse_U);
3060 dissect_ldap_ExtendedResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3061 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
3062 hf_index, BER_CLASS_APP, 24, TRUE, dissect_ldap_ExtendedResponse_U);
3070 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_) {
3071 #line 745 "./asn1/ldap/ldap.cnf"
3076 #line 749 "./asn1/ldap/ldap.cnf"
3077 if(ldm_tree && object_identifier_id) {
3078 proto_item_set_text(ldm_tree, "%s %s", "IntermediateResponse", object_identifier_id);
3079 name = oid_resolved_from_string(wmem_packet_scope(), object_identifier_id);
3081 proto_item_append_text(ldm_tree, " (%s)", name);
3083 if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) {
3084 offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
3086 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
3097 static const ber_sequence_t IntermediateResponse_U_sequence[] = {
3098 { &hf_ldap_responseName , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_ResponseName },
3099 { &hf_ldap_intermediateResponse_responseValue, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_T_intermediateResponse_responseValue },
3100 { NULL, 0, 0, 0, NULL }
3104 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_) {
3105 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3106 IntermediateResponse_U_sequence, hf_index, ett_ldap_IntermediateResponse_U);
3114 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_) {
3115 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
3116 hf_index, BER_CLASS_APP, 25, TRUE, dissect_ldap_IntermediateResponse_U);
3122 static const value_string ldap_ProtocolOp_vals[] = {
3123 { 0, "bindRequest" },
3124 { 1, "bindResponse" },
3125 { 2, "unbindRequest" },
3126 { 3, "searchRequest" },
3127 { 4, "searchResEntry" },
3128 { 5, "searchResDone" },
3129 { 19, "searchResRef" },
3130 { 6, "modifyRequest" },
3131 { 7, "modifyResponse" },
3132 { 8, "addRequest" },
3133 { 9, "addResponse" },
3134 { 10, "delRequest" },
3135 { 11, "delResponse" },
3136 { 12, "modDNRequest" },
3137 { 13, "modDNResponse" },
3138 { 14, "compareRequest" },
3139 { 15, "compareResponse" },
3140 { 16, "abandonRequest" },
3141 { 23, "extendedReq" },
3142 { 24, "extendedResp" },
3143 { 25, "intermediateResponse" },
3147 static const ber_choice_t ProtocolOp_choice[] = {
3148 { 0, &hf_ldap_bindRequest , BER_CLASS_APP, 0, BER_FLAGS_NOOWNTAG, dissect_ldap_BindRequest },
3149 { 1, &hf_ldap_bindResponse , BER_CLASS_APP, 1, BER_FLAGS_NOOWNTAG, dissect_ldap_BindResponse },
3150 { 2, &hf_ldap_unbindRequest , BER_CLASS_APP, 2, BER_FLAGS_NOOWNTAG, dissect_ldap_UnbindRequest },
3151 { 3, &hf_ldap_searchRequest , BER_CLASS_APP, 3, BER_FLAGS_NOOWNTAG, dissect_ldap_SearchRequest },
3152 { 4, &hf_ldap_searchResEntry , BER_CLASS_APP, 4, BER_FLAGS_NOOWNTAG, dissect_ldap_SearchResultEntry },
3153 { 5, &hf_ldap_searchResDone , BER_CLASS_APP, 5, BER_FLAGS_NOOWNTAG, dissect_ldap_SearchResultDone },
3154 { 19, &hf_ldap_searchResRef , BER_CLASS_APP, 19, BER_FLAGS_NOOWNTAG, dissect_ldap_SearchResultReference },
3155 { 6, &hf_ldap_modifyRequest , BER_CLASS_APP, 6, BER_FLAGS_NOOWNTAG, dissect_ldap_ModifyRequest },
3156 { 7, &hf_ldap_modifyResponse , BER_CLASS_APP, 7, BER_FLAGS_NOOWNTAG, dissect_ldap_ModifyResponse },
3157 { 8, &hf_ldap_addRequest , BER_CLASS_APP, 8, BER_FLAGS_NOOWNTAG, dissect_ldap_AddRequest },
3158 { 9, &hf_ldap_addResponse , BER_CLASS_APP, 9, BER_FLAGS_NOOWNTAG, dissect_ldap_AddResponse },
3159 { 10, &hf_ldap_delRequest , BER_CLASS_APP, 10, BER_FLAGS_NOOWNTAG, dissect_ldap_DelRequest },
3160 { 11, &hf_ldap_delResponse , BER_CLASS_APP, 11, BER_FLAGS_NOOWNTAG, dissect_ldap_DelResponse },
3161 { 12, &hf_ldap_modDNRequest , BER_CLASS_APP, 12, BER_FLAGS_NOOWNTAG, dissect_ldap_ModifyDNRequest },
3162 { 13, &hf_ldap_modDNResponse , BER_CLASS_APP, 13, BER_FLAGS_NOOWNTAG, dissect_ldap_ModifyDNResponse },
3163 { 14, &hf_ldap_compareRequest , BER_CLASS_APP, 14, BER_FLAGS_NOOWNTAG, dissect_ldap_CompareRequest },
3164 { 15, &hf_ldap_compareResponse, BER_CLASS_APP, 15, BER_FLAGS_NOOWNTAG, dissect_ldap_CompareResponse },
3165 { 16, &hf_ldap_abandonRequest , BER_CLASS_APP, 16, BER_FLAGS_NOOWNTAG, dissect_ldap_AbandonRequest },
3166 { 23, &hf_ldap_extendedReq , BER_CLASS_APP, 23, BER_FLAGS_NOOWNTAG, dissect_ldap_ExtendedRequest },
3167 { 24, &hf_ldap_extendedResp , BER_CLASS_APP, 24, BER_FLAGS_NOOWNTAG, dissect_ldap_ExtendedResponse },
3168 { 25, &hf_ldap_intermediateResponse, BER_CLASS_APP, 25, BER_FLAGS_NOOWNTAG, dissect_ldap_IntermediateResponse },
3169 { 0, NULL, 0, 0, 0, NULL }
3173 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_) {
3174 #line 99 "./asn1/ldap/ldap.cnf"
3176 ldap_call_response_t *lcrp;
3177 ldap_conv_info_t *ldap_info = (ldap_conv_info_t *)actx->private_data;
3178 do_protocolop = TRUE;
3181 offset = dissect_ber_choice(actx, tree, tvb, offset,
3182 ProtocolOp_choice, hf_index, ett_ldap_ProtocolOp,
3185 #line 105 "./asn1/ldap/ldap.cnf"
3187 if (ProtocolOp == -1) {
3191 /* ProtocolOp is the index, not the tag so convert it to the tag value */
3192 ProtocolOp = ldap_ProtocolOp_vals[ProtocolOp].value;
3194 lcrp=ldap_match_call_response(tvb, actx->pinfo, tree, MessageID, ProtocolOp, ldap_info);
3196 tap_queue_packet(ldap_tap, actx->pinfo, lcrp);
3199 /* XXX: the count will not work if the results span multiple TCP packets */
3201 if(ldap_info) { /* only count once */
3202 switch(ProtocolOp) {
3204 case LDAP_RES_SEARCH_ENTRY:
3205 if (!actx->pinfo->fd->flags.visited)
3206 ldap_info->num_results++;
3208 proto_item_append_text(tree, " [%d result%s]",
3209 ldap_info->num_results, ldap_info->num_results == 1 ? "" : "s");
3213 case LDAP_RES_SEARCH_RESULT:
3215 col_append_fstr(actx->pinfo->cinfo, COL_INFO, " [%d result%s]",
3216 ldap_info->num_results, ldap_info->num_results == 1 ? "" : "s");
3218 proto_item_append_text(tree, " [%d result%s]",
3219 ldap_info->num_results, ldap_info->num_results == 1 ? "" : "s");
3235 dissect_ldap_ControlType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3236 offset = dissect_ldap_LDAPOID(implicit_tag, tvb, offset, actx, tree, hf_index);
3244 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_) {
3245 #line 718 "./asn1/ldap/ldap.cnf"
3251 if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) {
3252 /* remove the OCTET STRING encoding */
3253 offset=dissect_ber_identifier(actx->pinfo, NULL, tvb, offset, &ber_class, &pc, &tag);
3254 offset=dissect_ber_length(actx->pinfo, NULL, tvb, offset, &len, &ind);
3256 call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
3260 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
3272 static const ber_sequence_t Control_sequence[] = {
3273 { &hf_ldap_controlType , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_ControlType },
3274 { &hf_ldap_criticality , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
3275 { &hf_ldap_controlValue , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_T_controlValue },
3276 { NULL, 0, 0, 0, NULL }
3280 dissect_ldap_Control(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3281 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3282 Control_sequence, hf_index, ett_ldap_Control);
3288 static const ber_sequence_t Controls_sequence_of[1] = {
3289 { &hf_ldap_Controls_item , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_Control },
3293 dissect_ldap_Controls(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3294 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
3295 Controls_sequence_of, hf_index, ett_ldap_Controls);
3301 static const ber_sequence_t LDAPMessage_sequence[] = {
3302 { &hf_ldap_messageID , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_MessageID },
3303 { &hf_ldap_protocolOp , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ldap_ProtocolOp },
3304 { &hf_ldap_controls , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_Controls },
3305 { NULL, 0, 0, 0, NULL }
3309 dissect_ldap_LDAPMessage(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3310 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3311 LDAPMessage_sequence, hf_index, ett_ldap_LDAPMessage);
3321 dissect_ldap_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3322 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
3329 static const ber_sequence_t SearchControlValue_sequence[] = {
3330 { &hf_ldap_size , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_INTEGER },
3331 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3332 { NULL, 0, 0, 0, NULL }
3336 dissect_ldap_SearchControlValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3337 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3338 SearchControlValue_sequence, hf_index, ett_ldap_SearchControlValue);
3344 static const ber_sequence_t SortKeyList_item_sequence[] = {
3345 { &hf_ldap_attributeType , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
3346 { &hf_ldap_orderingRule , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_MatchingRuleId },
3347 { &hf_ldap_reverseOrder , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_BOOLEAN },
3348 { NULL, 0, 0, 0, NULL }
3352 dissect_ldap_SortKeyList_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_) {
3353 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3354 SortKeyList_item_sequence, hf_index, ett_ldap_SortKeyList_item);
3360 static const ber_sequence_t SortKeyList_sequence_of[1] = {
3361 { &hf_ldap_SortKeyList_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_SortKeyList_item },
3365 dissect_ldap_SortKeyList(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3366 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
3367 SortKeyList_sequence_of, hf_index, ett_ldap_SortKeyList);
3373 static const value_string ldap_T_sortResult_vals[] = {
3375 { 1, "operationsError" },
3376 { 3, "timeLimitExceeded" },
3377 { 8, "strongAuthRequired" },
3378 { 11, "adminLimitExceeded" },
3379 { 16, "noSuchAttribute" },
3380 { 18, "inappropriateMatching" },
3381 { 50, "insufficientAccessRights" },
3383 { 53, "unwillingToPerform" },
3390 dissect_ldap_T_sortResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3391 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
3398 static const ber_sequence_t SortResult_sequence[] = {
3399 { &hf_ldap_sortResult , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_sortResult },
3400 { &hf_ldap_attributeType , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_AttributeDescription },
3401 { NULL, 0, 0, 0, NULL }
3405 dissect_ldap_SortResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3406 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3407 SortResult_sequence, hf_index, ett_ldap_SortResult);
3415 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_) {
3416 #line 762 "./asn1/ldap/ldap.cnf"
3423 int otheroffset = offset;
3425 dissect_ber_identifier(actx->pinfo, tree, tvb, otheroffset, &ber_class, &pc, &tag);
3426 otheroffset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, NULL);
3428 gint32 remaining=tvb_reported_length_remaining(tvb, offset);
3429 len=remaining>0 ? remaining : 0;
3432 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, -1, &val);
3435 const int *flags[] = {
3436 &hf_ldap_object_security_flag,
3437 &hf_ldap_ancestor_first_flag,
3438 &hf_ldap_public_data_only_flag,
3439 &hf_ldap_incremental_value_flag,
3443 proto_tree_add_bitmask_value_with_flags(tree, tvb, otheroffset+1, hf_index,
3444 ett_ldap_DirSyncFlagsSubEntry, flags, val, BMT_NO_APPEND);
3446 proto_tree_add_uint(tree, hf_index, tvb, otheroffset+len, len, 0);
3455 static const ber_sequence_t DirSyncControlValue_sequence[] = {
3456 { &hf_ldap_flags , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_DirSyncFlags },
3457 { &hf_ldap_maxBytes , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_INTEGER },
3458 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3459 { NULL, 0, 0, 0, NULL }
3463 dissect_ldap_DirSyncControlValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3464 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3465 DirSyncControlValue_sequence, hf_index, ett_ldap_DirSyncControlValue);
3471 static const ber_sequence_t PasswdModifyRequestValue_sequence[] = {
3472 { &hf_ldap_userIdentity , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_OCTET_STRING },
3473 { &hf_ldap_oldPasswd , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_OCTET_STRING },
3474 { &hf_ldap_newPasswd , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_OCTET_STRING },
3475 { NULL, 0, 0, 0, NULL }
3479 dissect_ldap_PasswdModifyRequestValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3480 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3481 PasswdModifyRequestValue_sequence, hf_index, ett_ldap_PasswdModifyRequestValue);
3487 static const ber_sequence_t CancelRequestValue_sequence[] = {
3488 { &hf_ldap_cancelID , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_MessageID },
3489 { NULL, 0, 0, 0, NULL }
3493 dissect_ldap_CancelRequestValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3494 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3495 CancelRequestValue_sequence, hf_index, ett_ldap_CancelRequestValue);
3501 static const value_string ldap_T_mode_vals[] = {
3502 { 1, "refreshOnly" },
3503 { 3, "refreshAndPersist" },
3509 dissect_ldap_T_mode(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3510 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
3517 static const ber_sequence_t SyncRequestValue_sequence[] = {
3518 { &hf_ldap_mode , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_mode },
3519 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3520 { &hf_ldap_reloadHint , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
3521 { NULL, 0, 0, 0, NULL }
3525 dissect_ldap_SyncRequestValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3526 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3527 SyncRequestValue_sequence, hf_index, ett_ldap_SyncRequestValue);
3533 static const value_string ldap_T_state_vals[] = {
3543 dissect_ldap_T_state(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3544 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
3553 dissect_ldap_SyncUUID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3554 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
3561 static const ber_sequence_t SyncStateValue_sequence[] = {
3562 { &hf_ldap_state , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_state },
3563 { &hf_ldap_entryUUID , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_SyncUUID },
3564 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3565 { NULL, 0, 0, 0, NULL }
3569 dissect_ldap_SyncStateValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3570 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3571 SyncStateValue_sequence, hf_index, ett_ldap_SyncStateValue);
3577 static const ber_sequence_t SyncDoneValue_sequence[] = {
3578 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3579 { &hf_ldap_refreshDeletes , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
3580 { NULL, 0, 0, 0, NULL }
3584 dissect_ldap_SyncDoneValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3585 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3586 SyncDoneValue_sequence, hf_index, ett_ldap_SyncDoneValue);
3592 static const ber_sequence_t T_refreshDelete_sequence[] = {
3593 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3594 { &hf_ldap_refreshDone , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
3595 { NULL, 0, 0, 0, NULL }
3599 dissect_ldap_T_refreshDelete(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3600 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3601 T_refreshDelete_sequence, hf_index, ett_ldap_T_refreshDelete);
3607 static const ber_sequence_t T_refreshPresent_sequence[] = {
3608 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3609 { &hf_ldap_refreshDone , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
3610 { NULL, 0, 0, 0, NULL }
3614 dissect_ldap_T_refreshPresent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3615 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3616 T_refreshPresent_sequence, hf_index, ett_ldap_T_refreshPresent);
3622 static const ber_sequence_t SET_OF_SyncUUID_set_of[1] = {
3623 { &hf_ldap_syncUUIDs_item , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_SyncUUID },
3627 dissect_ldap_SET_OF_SyncUUID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3628 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
3629 SET_OF_SyncUUID_set_of, hf_index, ett_ldap_SET_OF_SyncUUID);
3635 static const ber_sequence_t T_syncIdSet_sequence[] = {
3636 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3637 { &hf_ldap_refreshDeletes , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
3638 { &hf_ldap_syncUUIDs , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_ldap_SET_OF_SyncUUID },
3639 { NULL, 0, 0, 0, NULL }
3643 dissect_ldap_T_syncIdSet(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3644 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3645 T_syncIdSet_sequence, hf_index, ett_ldap_T_syncIdSet);
3651 static const value_string ldap_SyncInfoValue_vals[] = {
3653 { 1, "refreshDelete" },
3654 { 2, "refreshPresent" },
3659 static const ber_choice_t SyncInfoValue_choice[] = {
3660 { 0, &hf_ldap_newcookie , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ldap_OCTET_STRING },
3661 { 1, &hf_ldap_refreshDelete , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ldap_T_refreshDelete },
3662 { 2, &hf_ldap_refreshPresent , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_ldap_T_refreshPresent },
3663 { 3, &hf_ldap_syncIdSet , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_ldap_T_syncIdSet },
3664 { 0, NULL, 0, 0, 0, NULL }
3668 dissect_ldap_SyncInfoValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3669 offset = dissect_ber_choice(actx, tree, tvb, offset,
3670 SyncInfoValue_choice, hf_index, ett_ldap_SyncInfoValue,
3677 static const value_string ldap_T_warning_vals[] = {
3678 { 0, "timeBeforeExpiration" },
3679 { 1, "graceAuthNsRemaining" },
3683 static const ber_choice_t T_warning_choice[] = {
3684 { 0, &hf_ldap_timeBeforeExpiration, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ldap_INTEGER_0_maxInt },
3685 { 1, &hf_ldap_graceAuthNsRemaining, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ldap_INTEGER_0_maxInt },
3686 { 0, NULL, 0, 0, 0, NULL }
3690 dissect_ldap_T_warning(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3691 offset = dissect_ber_choice(actx, tree, tvb, offset,
3692 T_warning_choice, hf_index, ett_ldap_T_warning,
3699 static const value_string ldap_T_error_vals[] = {
3700 { 0, "passwordExpired" },
3701 { 1, "accountLocked" },
3702 { 2, "changeAfterReset" },
3703 { 3, "passwordModNotAllowed" },
3704 { 4, "mustSupplyOldPassword" },
3705 { 5, "insufficientPasswordQuality" },
3706 { 6, "passwordTooShort" },
3707 { 7, "passwordTooYoung" },
3708 { 8, "passwordInHistory" },
3714 dissect_ldap_T_error(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3715 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
3722 static const ber_sequence_t PasswordPolicyResponseValue_sequence[] = {
3723 { &hf_ldap_warning , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_T_warning },
3724 { &hf_ldap_error , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_T_error },
3725 { NULL, 0, 0, 0, NULL }
3729 dissect_ldap_PasswordPolicyResponseValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
3730 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3731 PasswordPolicyResponseValue_sequence, hf_index, ett_ldap_PasswordPolicyResponseValue);
3738 static int dissect_SearchControlValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
3740 asn1_ctx_t asn1_ctx;
3741 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3742 offset = dissect_ldap_SearchControlValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SearchControlValue_PDU);
3745 static int dissect_SortKeyList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
3747 asn1_ctx_t asn1_ctx;
3748 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3749 offset = dissect_ldap_SortKeyList(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SortKeyList_PDU);
3752 static int dissect_SortResult_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
3754 asn1_ctx_t asn1_ctx;
3755 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3756 offset = dissect_ldap_SortResult(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SortResult_PDU);
3759 static int dissect_DirSyncControlValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
3761 asn1_ctx_t asn1_ctx;
3762 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3763 offset = dissect_ldap_DirSyncControlValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_DirSyncControlValue_PDU);
3766 static int dissect_PasswdModifyRequestValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
3768 asn1_ctx_t asn1_ctx;
3769 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3770 offset = dissect_ldap_PasswdModifyRequestValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_PasswdModifyRequestValue_PDU);
3773 static int dissect_CancelRequestValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
3775 asn1_ctx_t asn1_ctx;
3776 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3777 offset = dissect_ldap_CancelRequestValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_CancelRequestValue_PDU);
3780 static int dissect_SyncRequestValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
3782 asn1_ctx_t asn1_ctx;
3783 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3784 offset = dissect_ldap_SyncRequestValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SyncRequestValue_PDU);
3787 static int dissect_SyncStateValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
3789 asn1_ctx_t asn1_ctx;
3790 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3791 offset = dissect_ldap_SyncStateValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SyncStateValue_PDU);
3794 static int dissect_SyncDoneValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
3796 asn1_ctx_t asn1_ctx;
3797 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3798 offset = dissect_ldap_SyncDoneValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SyncDoneValue_PDU);
3801 static int dissect_SyncInfoValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
3803 asn1_ctx_t asn1_ctx;
3804 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3805 offset = dissect_ldap_SyncInfoValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SyncInfoValue_PDU);
3808 static int dissect_PasswordPolicyResponseValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
3810 asn1_ctx_t asn1_ctx;
3811 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3812 offset = dissect_ldap_PasswordPolicyResponseValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_PasswordPolicyResponseValue_PDU);
3817 /*--- End of included file: packet-ldap-fn.c ---*/
3818 #line 901 "./asn1/ldap/packet-ldap-template.c"
3819 static int dissect_LDAPMessage_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ldap_conv_info_t *ldap_info) {
3822 asn1_ctx_t asn1_ctx;
3823 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3825 asn1_ctx.private_data = ldap_info;
3826 offset = dissect_ldap_LDAPMessage(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_LDAPMessage_PDU);
3831 dissect_ldap_payload(tvbuff_t *tvb, packet_info *pinfo,
3832 proto_tree *tree, ldap_conv_info_t *ldap_info,
3833 gboolean is_mscldap)
3836 guint length_remaining;
3838 int messageOffset = 0;
3839 guint headerLength = 0;
3841 tvbuff_t *msg_tvb = NULL;
3843 gboolean pc, ind = 0;
3846 attributedesc_string=NULL;
3851 length_remaining = tvb_ensure_captured_length_remaining(tvb, offset);
3853 if (length_remaining < 6) return;
3856 * OK, try to read the "Sequence Of" header; this gets the total
3857 * length of the LDAP message.
3859 messageOffset = get_ber_identifier(tvb, offset, &ber_class, &pc, &ber_tag);
3860 messageOffset = get_ber_length(tvb, messageOffset, &msg_len, &ind);
3863 if((msg_len<4) || (msg_len>10000000)) return;
3865 if ( (ber_class==BER_CLASS_UNI) && (ber_tag==BER_UNI_TAG_SEQUENCE) ) {
3867 * Add the length of the "Sequence Of" header to the message
3870 headerLength = messageOffset - offset;
3871 msg_len += headerLength;
3872 if (msg_len < headerLength) {
3874 * The message length was probably so large that the total length
3877 * Report this as an error.
3879 show_reported_bounds_error(tvb, pinfo, tree);
3884 * We couldn't parse the header; just make it the amount of data
3885 * remaining in the tvbuff, so we'll give up on this segment
3886 * after attempting to parse the message - there's nothing more
3887 * we can do. "dissect_ldap_message()" will display the error.
3889 msg_len = length_remaining;
3893 * Construct a tvbuff containing the amount of the payload we have
3894 * available. Make its reported length the amount of data in the
3897 * XXX - if reassembly isn't enabled. the subdissector will throw a
3898 * BoundsError exception, rather than a ReportedBoundsError exception.
3899 * We really want a tvbuff where the length is "length", the reported
3900 * length is "plen", and the "if the snapshot length were infinite"
3901 * length is the minimum of the reported length of the tvbuff handed
3902 * to us and "plen", with a new type of exception thrown if the offset
3903 * is within the reported length but beyond that third length, with
3904 * that exception getting the "Unreassembled Packet" error.
3906 length = length_remaining;
3907 if (length > msg_len) length = msg_len;
3908 msg_tvb = tvb_new_subset_length_caplen(tvb, offset, length, msg_len);
3911 * Now dissect the LDAP message.
3913 ldap_info->is_mscldap = is_mscldap;
3914 dissect_LDAPMessage_PDU(msg_tvb, pinfo, tree, ldap_info);
3918 /* If this was a sasl blob there might be another PDU following in the
3921 if(tvb_reported_length_remaining(tvb, offset)>=6){
3922 tvb = tvb_new_subset_remaining(tvb, offset);
3931 ldap_frame_end(void)
3933 ldap_found_in_frame = FALSE;
3935 ldapvalue_string = NULL;
3937 attributedesc_string = NULL;
3938 Filter_string = NULL;
3939 and_filter_string = NULL;
3940 object_identifier_id = NULL;
3941 or_filter_string = NULL;
3943 substring_item_any = NULL;
3944 substring_item_final = NULL;
3945 substring_item_init = NULL;
3946 substring_value = NULL;
3950 Filter_elements = 0;
3952 do_protocolop = FALSE;
3955 /* seems to be ok, but reset just in case */
3956 matching_rule_string = NULL;
3960 dissect_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean is_mscldap)
3963 conversation_t *conversation;
3964 gboolean doing_sasl_security = FALSE;
3965 guint length_remaining;
3966 ldap_conv_info_t *ldap_info = NULL;
3967 proto_item *ldap_item = NULL;
3968 proto_tree *ldap_tree = NULL;
3972 conversation = find_or_create_conversation(pinfo);
3975 * Do we already have a type and mechanism?
3977 ldap_info = (ldap_conv_info_t *)conversation_get_proto_data(conversation, proto_ldap);
3978 if (ldap_info == NULL) {
3979 /* No. Attach that information to the conversation, and add
3980 * it to the list of information structures.
3982 ldap_info = wmem_new0(wmem_file_scope(), ldap_conv_info_t);
3983 ldap_info->matched=wmem_map_new(wmem_file_scope(), ldap_info_hash_matched, ldap_info_equal_matched);
3984 ldap_info->unmatched=wmem_map_new(wmem_file_scope(), ldap_info_hash_unmatched, ldap_info_equal_unmatched);
3986 conversation_add_proto_data(conversation, proto_ldap, ldap_info);
3989 switch (ldap_info->auth_type) {
3990 case LDAP_AUTH_SASL:
3992 * It's SASL; are we using a security layer?
3994 if (ldap_info->first_auth_frame != 0 &&
3995 pinfo->num >= ldap_info->first_auth_frame) {
3996 doing_sasl_security = TRUE; /* yes */
4000 length_remaining = tvb_ensure_captured_length_remaining(tvb, offset);
4002 /* It might still be a packet containing a SASL security layer
4003 * but it's just that we never saw the BIND packet.
4004 * check if it looks like it could be a SASL blob here
4005 * and in that case just assume it is GSS-SPNEGO
4007 if(!doing_sasl_security && (tvb_bytes_exist(tvb, offset, 5))
4008 &&(tvb_get_ntohl(tvb, offset)<=(guint)(tvb_reported_length_remaining(tvb, offset)-4))
4009 &&(tvb_get_guint8(tvb, offset+4)==0x60) ){
4010 ldap_info->auth_type=LDAP_AUTH_SASL;
4011 ldap_info->first_auth_frame=pinfo->num;
4012 ldap_info->auth_mech=wmem_strdup(wmem_file_scope(), "GSS-SPNEGO");
4013 doing_sasl_security=TRUE;
4017 * This is the first PDU, set the Protocol column and clear the
4020 col_set_str(pinfo->cinfo, COL_PROTOCOL, pinfo->current_proto);
4022 if(ldap_found_in_frame) {
4023 /* we have already dissected an ldap PDU in this frame - add a separator and set a fence */
4024 col_append_str(pinfo->cinfo, COL_INFO, " | ");
4025 col_set_fence(pinfo->cinfo, COL_INFO);
4027 col_clear(pinfo->cinfo, COL_INFO);
4028 register_frame_end_routine (pinfo, ldap_frame_end);
4029 ldap_found_in_frame = TRUE;
4032 ldap_item = proto_tree_add_item(tree, is_mscldap?proto_cldap:proto_ldap, tvb, 0, -1, ENC_NA);
4033 ldap_tree = proto_item_add_subtree(ldap_item, ett_ldap);
4036 * Might we be doing a SASL security layer and, if so, *are* we doing
4039 * Just because we've seen a bind reply for SASL, that doesn't mean
4040 * that we're using a SASL security layer; I've seen captures in
4041 * which some SASL negotiations lead to a security layer being used
4042 * and other negotiations don't, and it's not obvious what's different
4043 * in the two negotiations. Therefore, we assume that if the first
4044 * byte is 0, it's a length for a SASL security layer (that way, we
4045 * never reassemble more than 16 megabytes, protecting us from
4046 * chewing up *too* much memory), and otherwise that it's an LDAP
4047 * message (actually, if it's an LDAP message it should begin with 0x30,
4048 * but we want to parse garbage as LDAP messages rather than really
4052 if (doing_sasl_security && tvb_get_guint8(tvb, offset) == 0) {
4053 proto_tree *sasl_tree;
4055 guint sasl_len, sasl_msg_len, length;
4057 * Yes. The frame begins with a 4-byte big-endian length.
4058 * And we know we have at least 6 bytes
4062 * Get the SASL length, which is the length of data in the buffer
4063 * following the length (i.e., it's 4 less than the total length).
4065 * XXX - do we need to reassemble buffers? For now, we
4066 * assume that each LDAP message is entirely contained within
4069 sasl_len = tvb_get_ntohl(tvb, offset);
4070 sasl_msg_len = sasl_len + 4;
4071 if (sasl_msg_len < 4) {
4073 * The message length was probably so large that the total length
4076 * Report this as an error.
4078 show_reported_bounds_error(tvb, pinfo, tree);
4083 * Construct a tvbuff containing the amount of the payload we have
4084 * available. Make its reported length the amount of data in the PDU.
4086 * XXX - if reassembly isn't enabled. the subdissector will throw a
4087 * BoundsError exception, rather than a ReportedBoundsError exception.
4088 * We really want a tvbuff where the length is "length", the reported
4089 * length is "plen", and the "if the snapshot length were infinite"
4090 * length is the minimum of the reported length of the tvbuff handed
4091 * to us and "plen", with a new type of exception thrown if the offset
4092 * is within the reported length but beyond that third length, with
4093 * that exception getting the "Unreassembled Packet" error.
4095 length = length_remaining;
4096 if (length > sasl_msg_len) length = sasl_msg_len;
4097 sasl_tvb = tvb_new_subset_length_caplen(tvb, offset, length, sasl_msg_len);
4099 proto_tree_add_uint(ldap_tree, hf_ldap_sasl_buffer_length, sasl_tvb, 0, 4, sasl_len);
4101 sasl_tree = proto_tree_add_subtree(ldap_tree, sasl_tvb, 0, sasl_msg_len, ett_ldap_sasl_blob, NULL, "SASL Buffer");
4103 if (ldap_info->auth_mech != NULL &&
4104 ((strcmp(ldap_info->auth_mech, "GSS-SPNEGO") == 0) ||
4105 /* auth_mech may have been set from the bind */
4106 (strcmp(ldap_info->auth_mech, "GSSAPI") == 0))) {
4107 tvbuff_t *gssapi_tvb, *plain_tvb = NULL, *decr_tvb= NULL;
4110 gssapi_encrypt_info_t gssapi_encrypt;
4113 * This is GSS-API (using SPNEGO, but we should be done with
4114 * the negotiation by now).
4116 * Dissect the GSS_Wrap() token; it'll return the length of
4117 * the token, from which we compute the offset in the tvbuff at
4118 * which the plaintext data, i.e. the LDAP message, begins.
4120 tmp_length = tvb_reported_length_remaining(sasl_tvb, 4);
4121 if ((guint)tmp_length > sasl_len)
4122 tmp_length = sasl_len;
4123 gssapi_tvb = tvb_new_subset_length_caplen(sasl_tvb, 4, tmp_length, sasl_len);
4125 /* Attempt decryption of the GSSAPI wrapped data if possible */
4126 gssapi_encrypt.gssapi_data_encrypted = FALSE;
4127 gssapi_encrypt.decrypt_gssapi_tvb=DECRYPT_GSSAPI_NORMAL;
4128 gssapi_encrypt.gssapi_wrap_tvb=NULL;
4129 gssapi_encrypt.gssapi_encrypted_tvb=NULL;
4130 gssapi_encrypt.gssapi_decrypted_tvb=NULL;
4131 ver_len = call_dissector_with_data(gssapi_wrap_handle, gssapi_tvb, pinfo, sasl_tree, &gssapi_encrypt);
4132 /* if we could unwrap, do a tvb shuffle */
4133 if(gssapi_encrypt.gssapi_decrypted_tvb){
4134 decr_tvb=gssapi_encrypt.gssapi_decrypted_tvb;
4135 } else if (gssapi_encrypt.gssapi_wrap_tvb) {
4136 plain_tvb=gssapi_encrypt.gssapi_wrap_tvb;
4140 * if len is 0 it probably mean that we got a PDU that is not
4141 * aligned to the start of the segment.
4148 * if we don't have unwrapped data,
4149 * see if the wrapping involved encryption of the
4150 * data; if not, just use the plaintext data.
4152 if (!decr_tvb && !plain_tvb) {
4153 if(!gssapi_encrypt.gssapi_data_encrypted){
4154 plain_tvb = tvb_new_subset_remaining(gssapi_tvb, ver_len);
4159 proto_tree *enc_tree = NULL;
4160 guint decr_len = tvb_reported_length(decr_tvb);
4163 * The LDAP message was encrypted in the packet, and has
4164 * been decrypted; dissect the decrypted LDAP message.
4166 col_set_str(pinfo->cinfo, COL_INFO, "SASL GSS-API Privacy (decrypted): ");
4169 enc_tree = proto_tree_add_subtree_format(sasl_tree, decr_tvb, 0, -1,
4170 ett_ldap_payload, NULL, "GSS-API Encrypted payload (%d byte%s)",
4171 decr_len, plurality(decr_len, "", "s"));
4173 dissect_ldap_payload(decr_tvb, pinfo, enc_tree, ldap_info, is_mscldap);
4174 } else if (plain_tvb) {
4175 proto_tree *plain_tree = NULL;
4176 guint plain_len = tvb_reported_length(plain_tvb);
4179 * The LDAP message wasn't encrypted in the packet;
4180 * dissect the plain LDAP message.
4182 col_set_str(pinfo->cinfo, COL_INFO, "SASL GSS-API Integrity: ");
4185 plain_tree = proto_tree_add_subtree_format(sasl_tree, plain_tvb, 0, -1,
4186 ett_ldap_payload, NULL, "GSS-API payload (%d byte%s)",
4187 plain_len, plurality(plain_len, "", "s"));
4190 dissect_ldap_payload(plain_tvb, pinfo, plain_tree, ldap_info, is_mscldap);
4193 * The LDAP message was encrypted in the packet, and was
4194 * not decrypted; just show it as encrypted data.
4196 col_add_fstr(pinfo->cinfo, COL_INFO, "SASL GSS-API Privacy: payload (%d byte%s)",
4198 plurality(sasl_len - ver_len, "", "s"));
4200 proto_tree_add_item(sasl_tree, hf_ldap_gssapi_encrypted_payload, gssapi_tvb, ver_len, -1, ENC_NA);
4204 /* plain LDAP, so dissect the payload */
4205 dissect_ldap_payload(tvb, pinfo, ldap_tree, ldap_info, is_mscldap);
4210 * prepend_dot is no longer used, but is being left in place in order to
4211 * maintain ABI compatibility.
4213 int dissect_mscldap_string(tvbuff_t *tvb, int offset, char *str, int max_len, gboolean prepend_dot _U_)
4219 /* The name data MUST start at offset 0 of the tvb */
4220 compr_len = get_dns_name(tvb, offset, max_len, 0, &name, &name_len);
4221 g_strlcpy(str, name, max_len);
4222 return offset + compr_len;
4226 /* These are the cldap DC flags
4227 http://msdn.microsoft.com/en-us/library/cc201036.aspx
4229 static const true_false_string tfs_ads_pdc = {
4233 static const true_false_string tfs_ads_gc = {
4234 "This is a GLOBAL CATALOGUE of forest",
4235 "This is NOT a global catalog of forest"
4237 static const true_false_string tfs_ads_ldap = {
4238 "This is an LDAP server",
4239 "This is NOT an ldap server"
4241 static const true_false_string tfs_ads_ds = {
4242 "This dc supports DS",
4243 "This dc does NOT support ds"
4245 static const true_false_string tfs_ads_kdc = {
4246 "This is a KDC (kerberos)",
4247 "This is NOT a kdc (kerberos)"
4249 static const true_false_string tfs_ads_timeserv = {
4250 "This dc is running TIME SERVICES (ntp)",
4251 "This dc is NOT running time services (ntp)"
4253 static const true_false_string tfs_ads_closest = {
4254 "This server is in the same site as the client",
4255 "This server is NOT in the same site as the client"
4257 static const true_false_string tfs_ads_writable = {
4258 "This dc is WRITABLE",
4259 "This dc is NOT writable"
4261 static const true_false_string tfs_ads_good_timeserv = {
4262 "This dc has a GOOD TIME SERVICE (i.e. hardware clock)",
4263 "This dc does NOT have a good time service (i.e. no hardware clock)"
4265 static const true_false_string tfs_ads_ndnc = {
4266 "Domain is NON-DOMAIN NC serviced by ldap server",
4267 "Domain is NOT non-domain nc serviced by ldap server"
4269 static const true_false_string tfs_ads_rodc = {
4270 "Domain controller is a Windows 2008 RODC",
4271 "Domain controller is not a Windows 2008 RODC"
4273 static const true_false_string tfs_ads_wdc = {
4274 "Domain controller is a Windows 2008 writable NC",
4275 "Domain controller is not a Windows 2008 writable NC"
4277 static const true_false_string tfs_ads_dns = {
4278 "Server name is in DNS format (Windows 2008)",
4279 "Server name is not in DNS format (Windows 2008)"
4281 static const true_false_string tfs_ads_dnc = {
4282 "The NC is the default NC (Windows 2008)",
4283 "The NC is not the default NC (Windows 2008)"
4285 static const true_false_string tfs_ads_fnc = {
4286 "The NC is the default forest NC(Windows 2008)",
4287 "The NC is not the default forest NC (Windows 2008)"
4289 static int dissect_mscldap_netlogon_flags(proto_tree *parent_tree, tvbuff_t *tvb, int offset)
4291 static const int * flags[] = {
4292 &hf_mscldap_netlogon_flags_fnc,
4293 &hf_mscldap_netlogon_flags_dnc,
4294 &hf_mscldap_netlogon_flags_dns,
4295 &hf_mscldap_netlogon_flags_wdc,
4296 &hf_mscldap_netlogon_flags_rodc,
4297 &hf_mscldap_netlogon_flags_ndnc,
4298 &hf_mscldap_netlogon_flags_good_timeserv,
4299 &hf_mscldap_netlogon_flags_writable,
4300 &hf_mscldap_netlogon_flags_closest,
4301 &hf_mscldap_netlogon_flags_timeserv,
4302 &hf_mscldap_netlogon_flags_kdc,
4303 &hf_mscldap_netlogon_flags_ds,
4304 &hf_mscldap_netlogon_flags_ldap,
4305 &hf_mscldap_netlogon_flags_gc,
4306 &hf_mscldap_netlogon_flags_pdc,
4310 proto_tree_add_bitmask_with_flags(parent_tree, tvb, offset, hf_mscldap_netlogon_flags,
4311 ett_mscldap_netlogon_flags, flags, ENC_LITTLE_ENDIAN, BMT_NO_FALSE);
4317 static int dissect_NetLogon_PDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
4319 int old_offset, offset=0;
4332 /* Get the length of the buffer */
4333 len=tvb_reported_length_remaining(tvb,offset);
4335 /* check the len if it is to small return */
4337 return tvb_captured_length(tvb);
4340 proto_tree_add_item(tree, hf_mscldap_netlogon_opcode, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4341 itype = tvb_get_letohs(tvb, offset);
4346 case LOGON_SAM_LOGON_RESPONSE:
4347 bc = tvb_reported_length_remaining(tvb, offset);
4348 /* logon server name */
4349 fn = get_unicode_or_ascii_string(tvb,&offset,TRUE,&fn_len,FALSE,FALSE,&bc);
4350 proto_tree_add_string(tree, hf_mscldap_nb_hostname, tvb,offset, fn_len, fn);
4354 fn = get_unicode_or_ascii_string(tvb,&offset,TRUE,&fn_len,FALSE,FALSE,&bc);
4355 proto_tree_add_string(tree, hf_mscldap_username, tvb,offset, fn_len, fn);
4359 fn = get_unicode_or_ascii_string(tvb,&offset,TRUE,&fn_len,FALSE,FALSE,&bc);
4360 proto_tree_add_string(tree, hf_mscldap_nb_domain, tvb,offset, fn_len, fn);
4363 /* get the version number from the end of the buffer, as the
4364 length is variable and the version determines what fields
4365 need to be decoded */
4366 version = tvb_get_letohl(tvb,len-8);
4368 /* include the extra version 5 fields */
4369 if ((version & NETLOGON_NT_VERSION_5) == NETLOGON_NT_VERSION_5){
4372 proto_tree_add_item(tree, hf_mscldap_domain_guid, tvb, offset, 16, ENC_LITTLE_ENDIAN);
4375 /* domain guid part 2
4376 there is another 16 byte guid but this is alway zero, so we will skip it */
4381 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4382 proto_tree_add_string(tree, hf_mscldap_forest, tvb, old_offset, offset-old_offset, str);
4386 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4387 proto_tree_add_string(tree, hf_mscldap_domain, tvb, old_offset, offset-old_offset, str);
4391 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4392 proto_tree_add_string(tree, hf_mscldap_hostname, tvb, old_offset, offset-old_offset, str);
4395 proto_tree_add_item(tree, hf_mscldap_netlogon_ipaddress, tvb, offset, 4, ENC_BIG_ENDIAN);
4399 offset = dissect_mscldap_netlogon_flags(tree, tvb, offset);
4405 case LOGON_SAM_LOGON_RESPONSE_EX:
4406 /* MS-ADTS 7.3.1.9 */
4407 offset += 2; /* Skip over "Sbz" field (MUST be set to 0) */
4410 offset = dissect_mscldap_netlogon_flags(tree, tvb, offset);
4413 proto_tree_add_item(tree, hf_mscldap_domain_guid, tvb, offset, 16, ENC_LITTLE_ENDIAN);
4418 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4419 proto_tree_add_string(tree, hf_mscldap_forest, tvb, old_offset, offset-old_offset, str);
4423 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4424 proto_tree_add_string(tree, hf_mscldap_domain, tvb, old_offset, offset-old_offset, str);
4428 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4429 proto_tree_add_string(tree, hf_mscldap_hostname, tvb, old_offset, offset-old_offset, str);
4431 /* NetBIOS Domain */
4433 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4434 proto_tree_add_string(tree, hf_mscldap_nb_domain, tvb, old_offset, offset-old_offset, str);
4436 /* NetBIOS Hostname */
4438 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4439 proto_tree_add_string(tree, hf_mscldap_nb_hostname, tvb, old_offset, offset-old_offset, str);
4443 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4444 proto_tree_add_string(tree, hf_mscldap_username, tvb, old_offset, offset-old_offset, str);
4448 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4449 proto_tree_add_string(tree, hf_mscldap_sitename, tvb, old_offset, offset-old_offset, str);
4453 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4454 proto_tree_add_string(tree, hf_mscldap_clientsitename, tvb, old_offset, offset-old_offset, str);
4456 /* get the version number from the end of the buffer, as the
4457 length is variable and the version determines what fields
4458 need to be decoded */
4459 version = tvb_get_letohl(tvb,len-8);
4461 /* include the extra fields for version 5 with IP s */
4462 if ((version & NETLOGON_NT_VERSION_5EX_WITH_IP) == NETLOGON_NT_VERSION_5EX_WITH_IP){
4463 /* The ip address is returned as a sockaddr_in structure
4465 * This section may need to be updated if the base Windows APIs
4466 * are changed to support ipv6, which currently is not the case.
4468 * The desector assumes the length is based on ipv4 and
4469 * ignores the length
4472 /* skip the length of the sockaddr_in */
4476 /* add IP address and desect the sockaddr_in structure */
4478 old_offset = offset + 4;
4479 item = proto_tree_add_item(tree, hf_mscldap_netlogon_ipaddress, tvb, old_offset, 4, ENC_BIG_ENDIAN);
4482 proto_tree *subtree;
4484 subtree = proto_item_add_subtree(item, ett_mscldap_ipdetails);
4486 /* get sockaddr family */
4487 proto_tree_add_item(subtree, hf_mscldap_netlogon_ipaddress_family, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4490 /* get sockaddr port */
4491 proto_tree_add_item(subtree, hf_mscldap_netlogon_ipaddress_port, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4494 /* get IP address */
4495 proto_tree_add_item(subtree, hf_mscldap_netlogon_ipaddress_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4498 /* skip the 8 bytes of zeros in the sockaddr structure */
4508 /* complete the decode with the version and token details */
4512 /* NETLOGON_NT_VERISON Options (MS-ADTS 7.3.1.1) */
4513 offset = dissect_mscldap_ntver_flags(tree, tvb, offset);
4516 proto_tree_add_item(tree, hf_mscldap_netlogon_lm_token, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4520 proto_tree_add_item(tree, hf_mscldap_netlogon_nt_token, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4522 return tvb_captured_length(tvb);
4527 get_sasl_ldap_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
4528 int offset, void *data _U_)
4530 /* sasl encapsulated ldap is 4 bytes plus the length in size */
4531 return tvb_get_ntohl(tvb, offset)+4;
4535 dissect_sasl_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4537 dissect_ldap_pdu(tvb, pinfo, tree, FALSE);
4538 return tvb_captured_length(tvb);
4542 get_normal_ldap_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
4543 int offset, void *data _U_)
4549 /* normal ldap is tag+len bytes plus the length
4550 * offset is where the tag is
4551 * offset+1 is where length starts
4553 data_offset=get_ber_length(tvb, offset+1, &len, &ind);
4554 return len+data_offset-offset;
4558 dissect_normal_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4560 dissect_ldap_pdu(tvb, pinfo, tree, FALSE);
4561 return tvb_captured_length(tvb);
4565 dissect_ldap_oid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
4568 const char *oidname;
4570 /* tvb here contains an ascii string that is really an oid */
4571 /* XXX we should convert the string oid into a real oid so we can use
4572 * proto_tree_add_oid() instead.
4575 oid=tvb_get_string_enc(wmem_packet_scope(), tvb, 0, tvb_reported_length(tvb), ENC_UTF_8|ENC_NA);
4577 return tvb_captured_length(tvb);
4580 oidname=oid_resolved_from_string(wmem_packet_scope(), oid);
4583 proto_tree_add_string_format_value(tree, hf_ldap_oid, tvb, 0, tvb_reported_length(tvb), oid, "%s (%s)",oid,oidname);
4585 proto_tree_add_string(tree, hf_ldap_oid, tvb, 0, tvb_captured_length(tvb), oid);
4587 return tvb_captured_length(tvb);
4590 #define LDAP_ACCESSMASK_ADS_CREATE_CHILD 0x00000001
4591 #define LDAP_ACCESSMASK_ADS_DELETE_CHILD 0x00000002
4592 #define LDAP_ACCESSMASK_ADS_LIST 0x00000004
4593 #define LDAP_ACCESSMASK_ADS_SELF_WRITE 0x00000008
4594 #define LDAP_ACCESSMASK_ADS_READ_PROP 0x00000010
4595 #define LDAP_ACCESSMASK_ADS_WRITE_PROP 0x00000020
4596 #define LDAP_ACCESSMASK_ADS_DELETE_TREE 0x00000040
4597 #define LDAP_ACCESSMASK_ADS_LIST_OBJECT 0x00000080
4598 #define LDAP_ACCESSMASK_ADS_CONTROL_ACCESS 0x00000100
4601 ldap_specific_rights(tvbuff_t *tvb, gint offset, proto_tree *tree, guint32 access)
4603 static const int * access_flags[] = {
4604 &hf_ldap_AccessMask_ADS_CONTROL_ACCESS,
4605 &hf_ldap_AccessMask_ADS_LIST_OBJECT,
4606 &hf_ldap_AccessMask_ADS_DELETE_TREE,
4607 &hf_ldap_AccessMask_ADS_WRITE_PROP,
4608 &hf_ldap_AccessMask_ADS_READ_PROP,
4609 &hf_ldap_AccessMask_ADS_SELF_WRITE,
4610 &hf_ldap_AccessMask_ADS_LIST,
4611 &hf_ldap_AccessMask_ADS_DELETE_CHILD,
4612 &hf_ldap_AccessMask_ADS_CREATE_CHILD,
4616 proto_tree_add_bitmask_list_value(tree, tvb, offset, 4, access_flags, access);
4618 struct access_mask_info ldap_access_mask_info = {
4619 "LDAP", /* Name of specific rights */
4620 ldap_specific_rights, /* Dissection function */
4621 NULL, /* Generic mapping table */
4622 NULL /* Standard mapping table */
4626 dissect_ldap_nt_sec_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4628 dissect_nt_sec_desc(tvb, 0, pinfo, tree, NULL, TRUE, tvb_reported_length(tvb), &ldap_access_mask_info);
4629 return tvb_captured_length(tvb);
4633 dissect_ldap_sid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
4637 /* this octet string contains an NT SID */
4638 dissect_nt_sid(tvb, 0, tree, "SID", &tmpstr, hf_ldap_sid);
4639 ldapvalue_string=tmpstr;
4640 return tvb_captured_length(tvb);
4644 dissect_ldap_guid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4646 guint8 drep[4] = { 0x10, 0x00, 0x00, 0x00}; /* fake DREP struct */
4649 /* This octet string contained a GUID */
4650 dissect_dcerpc_uuid_t(tvb, 0, pinfo, tree, drep, hf_ldap_guid, &uuid);
4652 ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 1024);
4653 g_snprintf(ldapvalue_string, 1023, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
4654 uuid.data1, uuid.data2, uuid.data3, uuid.data4[0], uuid.data4[1],
4655 uuid.data4[2], uuid.data4[3], uuid.data4[4], uuid.data4[5],
4656 uuid.data4[6], uuid.data4[7]);
4657 return tvb_captured_length(tvb);
4661 dissect_ldap_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
4666 conversation_t *conversation;
4667 ldap_conv_info_t *ldap_info = NULL;
4670 * Do we have a conversation for this connection?
4672 conversation = find_conversation_pinfo(pinfo, 0);
4674 ldap_info = (ldap_conv_info_t *)conversation_get_proto_data(conversation, proto_ldap);
4679 /* This is a bit tricky. We have to find out whether SASL is used
4680 * so that we know how big a header we are supposed to pass
4681 * to tcp_dissect_pdus()
4682 * We must also cope with the case when a client connects to LDAP
4683 * and performs a few unauthenticated searches of LDAP before
4684 * it performs the bind on the same tcp connection.
4686 /* check for a SASL header, i.e. assume it is SASL if
4687 * 1, first four bytes (SASL length) is an integer
4688 * with a value that must be <LDAP_SASL_MAX_BUF and >2
4689 * (>2 to fight false positives, 0x00000000 is a common
4690 * "random" tcp payload)
4691 * (SASL ldap PDUs might be >64k in size, which is why
4692 * LDAP_SASL_MAX_BUF is used - defined in packet-ldap.h)
4694 * 2, we must have a conversation and the auth type must
4697 sasl_len=tvb_get_ntohl(tvb, 0);
4700 goto this_was_not_sasl;
4703 if( sasl_len>LDAP_SASL_MAX_BUF ){
4704 goto this_was_not_sasl;
4707 if((!ldap_info) || (ldap_info->auth_type!=LDAP_AUTH_SASL) ){
4708 goto this_was_not_sasl;
4711 tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 4, get_sasl_ldap_pdu_len, dissect_sasl_ldap_pdu, data);
4712 return tvb_captured_length(tvb);
4715 /* check if it is a normal BER encoded LDAP packet
4716 * i.e. first byte is 0x30 followed by a length that is
4718 * (no ldap PDUs are ever >64kb? )
4720 if(tvb_get_guint8(tvb, 0)!=0x30){
4721 goto this_was_not_normal_ldap;
4724 /* check that length makes sense */
4725 get_ber_length(tvb, 1, &ldap_len, &ind);
4727 /* don't check ind since indefinite length is never used for ldap (famous last words)*/
4729 goto this_was_not_normal_ldap;
4733 * The minimun size of a LDAP pdu is 7 bytes
4735 * dumpasn1 -hh ldap-unbind-min.dat
4737 * <30 05 02 01 09 42 00>
4742 * 5 0: [APPLICATION 2]
4743 * : Error: Object has zero length.
4746 * dumpasn1 -hh ldap-unbind-windows.dat
4748 * <30 84 00 00 00 05 02 01 09 42 00>
4753 * 9 0: [APPLICATION 2]
4754 * : Error: Object has zero length.
4757 * 6 bytes would also be ok to get the full length of
4758 * the pdu, but as the smallest pdu can be 7 bytes
4761 tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 7, get_normal_ldap_pdu_len, dissect_normal_ldap_pdu, data);
4765 this_was_not_normal_ldap:
4767 /* Ok it might be a strange case of SASL still
4768 * It has been seen with Exchange setup to MS AD
4769 * when Exchange pretend that there is SASL but in fact data are still
4771 if ((sasl_len + 4) == (guint32)tvb_reported_length_remaining(tvb, 0))
4772 tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 4, get_sasl_ldap_pdu_len, dissect_sasl_ldap_pdu, data);
4774 return tvb_captured_length(tvb);
4778 dissect_mscldap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4780 dissect_ldap_pdu(tvb, pinfo, tree, TRUE);
4781 return tvb_captured_length(tvb);
4785 /*--- proto_register_ldap -------------------------------------------*/
4786 void proto_register_ldap(void) {
4788 /* List of fields */
4790 static hf_register_info hf[] = {
4792 { &hf_ldap_sasl_buffer_length,
4793 { "SASL Buffer Length", "ldap.sasl_buffer_length",
4794 FT_UINT32, BASE_DEC, NULL, 0x0,
4796 { &hf_ldap_response_in,
4797 { "Response In", "ldap.response_in",
4798 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
4799 "The response to this LDAP request is in this frame", HFILL }},
4800 { &hf_ldap_response_to,
4801 { "Response To", "ldap.response_to",
4802 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
4803 "This is a response to the LDAP request in this frame", HFILL }},
4805 { "Time", "ldap.time",
4806 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
4807 "The time between the Call and the Reply", HFILL }},
4809 { &hf_mscldap_netlogon_opcode,
4810 { "Operation code", "mscldap.netlogon.opcode",
4811 FT_UINT16, BASE_DEC, VALS(netlogon_opcode_vals), 0x0,
4812 "LDAP ping operation code", HFILL }},
4814 { &hf_mscldap_netlogon_ipaddress_family,
4815 { "Family", "mscldap.netlogon.ipaddress.family",
4816 FT_UINT16, BASE_DEC, NULL, 0x0,
4819 { &hf_mscldap_netlogon_ipaddress_ipv4,
4820 { "IPv4", "mscldap.netlogon.ipaddress.ipv4",
4821 FT_IPv4, BASE_NONE, NULL, 0x0,
4822 "IP Address", HFILL }},
4824 { &hf_mscldap_netlogon_ipaddress_port,
4825 { "Port", "mscldap.netlogon.ipaddress.port",
4826 FT_UINT16, BASE_DEC, NULL, 0x0,
4829 { &hf_mscldap_netlogon_ipaddress,
4830 { "IP Address","mscldap.netlogon.ipaddress",
4831 FT_IPv4, BASE_NONE, NULL, 0x0,
4832 "Domain Controller IP Address", HFILL }},
4834 { &hf_mscldap_netlogon_lm_token,
4835 { "LM Token", "mscldap.netlogon.lm_token",
4836 FT_UINT16, BASE_HEX, NULL, 0x0,
4837 "MUST be set to 0xFFFF", HFILL }},
4839 { &hf_mscldap_netlogon_nt_token,
4840 { "NT Token", "mscldap.netlogon.nt_token",
4841 FT_UINT16, BASE_HEX, NULL, 0x0,
4842 "MUST be set to 0xFFFF", HFILL }},
4844 { &hf_mscldap_netlogon_flags,
4845 { "Flags", "mscldap.netlogon.flags",
4846 FT_UINT32, BASE_HEX, NULL, 0x0,
4847 "Netlogon flags describing the DC properties", HFILL }},
4849 { &hf_mscldap_ntver_flags,
4850 { "Version Flags", "mscldap.ntver.flags",
4851 FT_UINT32, BASE_HEX, NULL, 0x0,
4852 "NETLOGON_NT_VERSION Options Bits", HFILL }},
4854 { &hf_mscldap_domain_guid,
4855 { "Domain GUID", "mscldap.domain.guid",
4856 FT_GUID, BASE_NONE, NULL, 0x0,
4857 "Value of the NC's GUID attribute", HFILL }},
4859 { &hf_mscldap_forest,
4860 { "Forest", "mscldap.forest",
4861 FT_STRING, BASE_NONE, NULL, 0x0,
4862 "DNS name of the forest", HFILL }},
4864 { &hf_mscldap_domain,
4865 { "Domain", "mscldap.domain",
4866 FT_STRING, BASE_NONE, NULL, 0x0,
4867 "DNS name of the NC", HFILL }},
4869 { &hf_mscldap_hostname,
4870 { "Hostname", "mscldap.hostname",
4871 FT_STRING, BASE_NONE, NULL, 0x0,
4872 "DNS name of server", HFILL }},
4874 { &hf_mscldap_nb_domain,
4875 { "NetBIOS Domain", "mscldap.nb_domain",
4876 FT_STRING, BASE_NONE, NULL, 0x0,
4877 "NetBIOS name of the NC", HFILL }},
4879 { &hf_mscldap_nb_hostname,
4880 { "NetBIOS Hostname", "mscldap.nb_hostname",
4881 FT_STRING, BASE_NONE, NULL, 0x0,
4882 "NetBIOS name of the server", HFILL }},
4884 { &hf_mscldap_username,
4885 { "Username", "mscldap.username",
4886 FT_STRING, BASE_NONE, NULL, 0x0,
4887 "User specified in client's request", HFILL }},
4889 { &hf_mscldap_sitename,
4890 { "Server Site", "mscldap.sitename",
4891 FT_STRING, BASE_NONE, NULL, 0x0,
4892 "Site name of the server", HFILL }},
4894 { &hf_mscldap_clientsitename,
4895 { "Client Site", "mscldap.clientsitename",
4896 FT_STRING, BASE_NONE, NULL, 0x0,
4897 "Site name of the client", HFILL }},
4900 { "Sid", "ldap.sid",
4901 FT_STRING, BASE_NONE, NULL, 0x0,
4904 { &hf_mscldap_ntver_flags_v1,
4905 { "V1", "mscldap.ntver.searchflags.v1", FT_BOOLEAN, 32,
4906 TFS(&tfs_ntver_v1), 0x00000001, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4908 { &hf_mscldap_ntver_flags_v5,
4909 { "V5", "mscldap.ntver.searchflags.v5", FT_BOOLEAN, 32,
4910 TFS(&tfs_ntver_v5), 0x00000002, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4912 { &hf_mscldap_ntver_flags_v5ex,
4913 { "V5EX", "mscldap.ntver.searchflags.v5ex", FT_BOOLEAN, 32,
4914 TFS(&tfs_ntver_v5ex), 0x00000004, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4916 { &hf_mscldap_ntver_flags_v5ep,
4917 { "V5EP", "mscldap.ntver.searchflags.v5ep", FT_BOOLEAN, 32,
4918 TFS(&tfs_ntver_v5ep), 0x00000008, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4920 { &hf_mscldap_ntver_flags_vcs,
4921 { "VCS", "mscldap.ntver.searchflags.vcs", FT_BOOLEAN, 32,
4922 TFS(&tfs_ntver_vcs), 0x00000010, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4924 { &hf_mscldap_ntver_flags_vnt4,
4925 { "VNT4", "mscldap.ntver.searchflags.vnt4", FT_BOOLEAN, 32,
4926 TFS(&tfs_ntver_vnt4), 0x01000000, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4928 { &hf_mscldap_ntver_flags_vpdc,
4929 { "VPDC", "mscldap.ntver.searchflags.vpdc", FT_BOOLEAN, 32,
4930 TFS(&tfs_ntver_vpdc), 0x10000000, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4932 { &hf_mscldap_ntver_flags_vip,
4933 { "VIP", "mscldap.ntver.searchflags.vip", FT_BOOLEAN, 32,
4934 TFS(&tfs_ntver_vip), 0x20000000, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4936 { &hf_mscldap_ntver_flags_vl,
4937 { "VL", "mscldap.ntver.searchflags.vl", FT_BOOLEAN, 32,
4938 TFS(&tfs_ntver_vl), 0x40000000, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4940 { &hf_mscldap_ntver_flags_vgc,
4941 { "VGC", "mscldap.ntver.searchflags.vgc", FT_BOOLEAN, 32,
4942 TFS(&tfs_ntver_vgc), 0x80000000, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4945 { &hf_mscldap_netlogon_flags_pdc,
4946 { "PDC", "mscldap.netlogon.flags.pdc", FT_BOOLEAN, 32,
4947 TFS(&tfs_ads_pdc), 0x00000001, "Is this DC a PDC or not?", HFILL }},
4949 { &hf_mscldap_netlogon_flags_gc,
4950 { "GC", "mscldap.netlogon.flags.gc", FT_BOOLEAN, 32,
4951 TFS(&tfs_ads_gc), 0x00000004, "Does this dc service as a GLOBAL CATALOGUE?", HFILL }},
4953 { &hf_mscldap_netlogon_flags_ldap,
4954 { "LDAP", "mscldap.netlogon.flags.ldap", FT_BOOLEAN, 32,
4955 TFS(&tfs_ads_ldap), 0x00000008, "Does this DC act as an LDAP server?", HFILL }},
4957 { &hf_mscldap_netlogon_flags_ds,
4958 { "DS", "mscldap.netlogon.flags.ds", FT_BOOLEAN, 32,
4959 TFS(&tfs_ads_ds), 0x00000010, "Does this dc provide DS services?", HFILL }},
4961 { &hf_mscldap_netlogon_flags_kdc,
4962 { "KDC", "mscldap.netlogon.flags.kdc", FT_BOOLEAN, 32,
4963 TFS(&tfs_ads_kdc), 0x00000020, "Does this dc act as a KDC?", HFILL }},
4965 { &hf_mscldap_netlogon_flags_timeserv,
4966 { "Time Serv", "mscldap.netlogon.flags.timeserv", FT_BOOLEAN, 32,
4967 TFS(&tfs_ads_timeserv), 0x00000040, "Does this dc provide time services (ntp) ?", HFILL }},
4969 { &hf_mscldap_netlogon_flags_closest,
4970 { "Closest", "mscldap.netlogon.flags.closest", FT_BOOLEAN, 32,
4971 TFS(&tfs_ads_closest), 0x00000080, "Is this the closest dc?", HFILL }},
4973 { &hf_mscldap_netlogon_flags_writable,
4974 { "Writable", "mscldap.netlogon.flags.writable", FT_BOOLEAN, 32,
4975 TFS(&tfs_ads_writable), 0x00000100, "Is this dc writable?", HFILL }},
4977 { &hf_mscldap_netlogon_flags_good_timeserv,
4978 { "Good Time Serv", "mscldap.netlogon.flags.good_timeserv", FT_BOOLEAN, 32,
4979 TFS(&tfs_ads_good_timeserv), 0x00000200, "Is this a Good Time Server? (i.e. does it have a hardware clock)", HFILL }},
4981 { &hf_mscldap_netlogon_flags_ndnc,
4982 { "NDNC", "mscldap.netlogon.flags.ndnc", FT_BOOLEAN, 32,
4983 TFS(&tfs_ads_ndnc), 0x00000400, "Is this an NDNC dc?", HFILL }},
4985 { &hf_mscldap_netlogon_flags_rodc,
4986 { "RODC", "mscldap.netlogon.flags.rodc", FT_BOOLEAN, 32,
4987 TFS(&tfs_ads_rodc), 0x00000800, "Is this an read only dc?", HFILL }},
4989 { &hf_mscldap_netlogon_flags_wdc,
4990 { "WDC", "mscldap.netlogon.flags.writabledc", FT_BOOLEAN, 32,
4991 TFS(&tfs_ads_wdc), 0x00001000, "Is this an writable dc (Windows 2008)?", HFILL }},
4993 { &hf_mscldap_netlogon_flags_dns,
4994 { "DNS", "mscldap.netlogon.flags.dnsname", FT_BOOLEAN, 32,
4995 TFS(&tfs_ads_dns), 0x20000000, "Does the server have a dns name (Windows 2008)?", HFILL }},
4997 { &hf_mscldap_netlogon_flags_dnc,
4998 { "DNC", "mscldap.netlogon.flags.defaultnc", FT_BOOLEAN, 32,
4999 TFS(&tfs_ads_dnc), 0x40000000, "Is this the default NC (Windows 2008)?", HFILL }},
5001 { &hf_mscldap_netlogon_flags_fnc,
5002 { "FDC", "mscldap.netlogon.flags.forestnc", FT_BOOLEAN, 32,
5003 TFS(&tfs_ads_fnc), 0x80000000, "Is the the NC the default forest root(Windows 2008)?", HFILL }},
5006 { "GUID", "ldap.guid", FT_GUID, BASE_NONE,
5007 NULL, 0, NULL, HFILL }},
5009 { &hf_ldap_AccessMask_ADS_CREATE_CHILD,
5010 { "Ads Create Child", "ldap.AccessMask.ADS_CREATE_CHILD", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_CREATE_CHILD, NULL, HFILL }},
5012 { &hf_ldap_AccessMask_ADS_DELETE_CHILD,
5013 { "Ads Delete Child", "ldap.AccessMask.ADS_DELETE_CHILD", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_DELETE_CHILD, NULL, HFILL }},
5015 { &hf_ldap_AccessMask_ADS_LIST,
5016 { "Ads List", "ldap.AccessMask.ADS_LIST", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_LIST, NULL, HFILL }},
5018 { &hf_ldap_AccessMask_ADS_SELF_WRITE,
5019 { "Ads Self Write", "ldap.AccessMask.ADS_SELF_WRITE", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_SELF_WRITE, NULL, HFILL }},
5021 { &hf_ldap_AccessMask_ADS_READ_PROP,
5022 { "Ads Read Prop", "ldap.AccessMask.ADS_READ_PROP", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_READ_PROP, NULL, HFILL }},
5024 { &hf_ldap_AccessMask_ADS_WRITE_PROP,
5025 { "Ads Write Prop", "ldap.AccessMask.ADS_WRITE_PROP", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_WRITE_PROP, NULL, HFILL }},
5027 { &hf_ldap_AccessMask_ADS_DELETE_TREE,
5028 { "Ads Delete Tree", "ldap.AccessMask.ADS_DELETE_TREE", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_DELETE_TREE, NULL, HFILL }},
5030 { &hf_ldap_AccessMask_ADS_LIST_OBJECT,
5031 { "Ads List Object", "ldap.AccessMask.ADS_LIST_OBJECT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_LIST_OBJECT, NULL, HFILL }},
5033 { &hf_ldap_AccessMask_ADS_CONTROL_ACCESS,
5034 { "Ads Control Access", "ldap.AccessMask.ADS_CONTROL_ACCESS", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_CONTROL_ACCESS, NULL, HFILL }},
5036 { &hf_ldap_LDAPMessage_PDU,
5037 { "LDAPMessage", "ldap.LDAPMessage_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
5039 { &hf_ldap_object_security_flag,
5040 { "Flag Object_Security", "ldap.object_security_flag", FT_BOOLEAN, 32, NULL, 0x00000001, NULL, HFILL }},
5042 { &hf_ldap_ancestor_first_flag,
5043 { "Flag Ancestor_First", "ldap.ancestor_first_flag", FT_BOOLEAN, 32, NULL, 0x00000800, NULL, HFILL }},
5045 { &hf_ldap_public_data_only_flag,
5046 { "Flag Public_Data_Only", "ldap.public_data_only_flag", FT_BOOLEAN, 32, NULL, 0x00002000, NULL, HFILL }},
5048 { &hf_ldap_incremental_value_flag,
5049 { "Flag Incremental_Value", "ldap.incremental_value_flag", FT_BOOLEAN, 32, NULL, 0x80000000, NULL, HFILL }},
5052 { "OID", "ldap.oid", FT_STRING, BASE_NONE,
5053 NULL, 0, NULL, HFILL }},
5055 { &hf_ldap_gssapi_encrypted_payload,
5056 { "GSS-API Encrypted payload", "ldap.gssapi_encrypted_payload", FT_BYTES, BASE_NONE,
5057 NULL, 0, NULL, HFILL }},
5060 /*--- Included file: packet-ldap-hfarr.c ---*/
5061 #line 1 "./asn1/ldap/packet-ldap-hfarr.c"
5062 { &hf_ldap_SearchControlValue_PDU,
5063 { "SearchControlValue", "ldap.SearchControlValue_element",
5064 FT_NONE, BASE_NONE, NULL, 0,
5066 { &hf_ldap_SortKeyList_PDU,
5067 { "SortKeyList", "ldap.SortKeyList",
5068 FT_UINT32, BASE_DEC, NULL, 0,
5070 { &hf_ldap_SortResult_PDU,
5071 { "SortResult", "ldap.SortResult_element",
5072 FT_NONE, BASE_NONE, NULL, 0,
5074 { &hf_ldap_DirSyncControlValue_PDU,
5075 { "DirSyncControlValue", "ldap.DirSyncControlValue_element",
5076 FT_NONE, BASE_NONE, NULL, 0,
5078 { &hf_ldap_PasswdModifyRequestValue_PDU,
5079 { "PasswdModifyRequestValue", "ldap.PasswdModifyRequestValue_element",
5080 FT_NONE, BASE_NONE, NULL, 0,
5082 { &hf_ldap_CancelRequestValue_PDU,
5083 { "CancelRequestValue", "ldap.CancelRequestValue_element",
5084 FT_NONE, BASE_NONE, NULL, 0,
5086 { &hf_ldap_SyncRequestValue_PDU,
5087 { "SyncRequestValue", "ldap.SyncRequestValue_element",
5088 FT_NONE, BASE_NONE, NULL, 0,
5090 { &hf_ldap_SyncStateValue_PDU,
5091 { "SyncStateValue", "ldap.SyncStateValue_element",
5092 FT_NONE, BASE_NONE, NULL, 0,
5094 { &hf_ldap_SyncDoneValue_PDU,
5095 { "SyncDoneValue", "ldap.SyncDoneValue_element",
5096 FT_NONE, BASE_NONE, NULL, 0,
5098 { &hf_ldap_SyncInfoValue_PDU,
5099 { "SyncInfoValue", "ldap.SyncInfoValue",
5100 FT_UINT32, BASE_DEC, VALS(ldap_SyncInfoValue_vals), 0,
5102 { &hf_ldap_PasswordPolicyResponseValue_PDU,
5103 { "PasswordPolicyResponseValue", "ldap.PasswordPolicyResponseValue_element",
5104 FT_NONE, BASE_NONE, NULL, 0,
5106 { &hf_ldap_messageID,
5107 { "messageID", "ldap.messageID",
5108 FT_UINT32, BASE_DEC, NULL, 0,
5110 { &hf_ldap_protocolOp,
5111 { "protocolOp", "ldap.protocolOp",
5112 FT_UINT32, BASE_DEC, VALS(ldap_ProtocolOp_vals), 0,
5114 { &hf_ldap_controls,
5115 { "controls", "ldap.controls",
5116 FT_UINT32, BASE_DEC, NULL, 0,
5118 { &hf_ldap_bindRequest,
5119 { "bindRequest", "ldap.bindRequest_element",
5120 FT_NONE, BASE_NONE, NULL, 0,
5122 { &hf_ldap_bindResponse,
5123 { "bindResponse", "ldap.bindResponse_element",
5124 FT_NONE, BASE_NONE, NULL, 0,
5126 { &hf_ldap_unbindRequest,
5127 { "unbindRequest", "ldap.unbindRequest_element",
5128 FT_NONE, BASE_NONE, NULL, 0,
5130 { &hf_ldap_searchRequest,
5131 { "searchRequest", "ldap.searchRequest_element",
5132 FT_NONE, BASE_NONE, NULL, 0,
5134 { &hf_ldap_searchResEntry,
5135 { "searchResEntry", "ldap.searchResEntry_element",
5136 FT_NONE, BASE_NONE, NULL, 0,
5137 "SearchResultEntry", HFILL }},
5138 { &hf_ldap_searchResDone,
5139 { "searchResDone", "ldap.searchResDone_element",
5140 FT_NONE, BASE_NONE, NULL, 0,
5141 "SearchResultDone", HFILL }},
5142 { &hf_ldap_searchResRef,
5143 { "searchResRef", "ldap.searchResRef",
5144 FT_UINT32, BASE_DEC, NULL, 0,
5145 "SearchResultReference", HFILL }},
5146 { &hf_ldap_modifyRequest,
5147 { "modifyRequest", "ldap.modifyRequest_element",
5148 FT_NONE, BASE_NONE, NULL, 0,
5150 { &hf_ldap_modifyResponse,
5151 { "modifyResponse", "ldap.modifyResponse_element",
5152 FT_NONE, BASE_NONE, NULL, 0,
5154 { &hf_ldap_addRequest,
5155 { "addRequest", "ldap.addRequest_element",
5156 FT_NONE, BASE_NONE, NULL, 0,
5158 { &hf_ldap_addResponse,
5159 { "addResponse", "ldap.addResponse_element",
5160 FT_NONE, BASE_NONE, NULL, 0,
5162 { &hf_ldap_delRequest,
5163 { "delRequest", "ldap.delRequest",
5164 FT_STRING, BASE_NONE, NULL, 0,
5166 { &hf_ldap_delResponse,
5167 { "delResponse", "ldap.delResponse_element",
5168 FT_NONE, BASE_NONE, NULL, 0,
5170 { &hf_ldap_modDNRequest,
5171 { "modDNRequest", "ldap.modDNRequest_element",
5172 FT_NONE, BASE_NONE, NULL, 0,
5173 "ModifyDNRequest", HFILL }},
5174 { &hf_ldap_modDNResponse,
5175 { "modDNResponse", "ldap.modDNResponse_element",
5176 FT_NONE, BASE_NONE, NULL, 0,
5177 "ModifyDNResponse", HFILL }},
5178 { &hf_ldap_compareRequest,
5179 { "compareRequest", "ldap.compareRequest_element",
5180 FT_NONE, BASE_NONE, NULL, 0,
5182 { &hf_ldap_compareResponse,
5183 { "compareResponse", "ldap.compareResponse_element",
5184 FT_NONE, BASE_NONE, NULL, 0,
5186 { &hf_ldap_abandonRequest,
5187 { "abandonRequest", "ldap.abandonRequest",
5188 FT_UINT32, BASE_DEC, NULL, 0,
5190 { &hf_ldap_extendedReq,
5191 { "extendedReq", "ldap.extendedReq_element",
5192 FT_NONE, BASE_NONE, NULL, 0,
5193 "ExtendedRequest", HFILL }},
5194 { &hf_ldap_extendedResp,
5195 { "extendedResp", "ldap.extendedResp_element",
5196 FT_NONE, BASE_NONE, NULL, 0,
5197 "ExtendedResponse", HFILL }},
5198 { &hf_ldap_intermediateResponse,
5199 { "intermediateResponse", "ldap.intermediateResponse_element",
5200 FT_NONE, BASE_NONE, NULL, 0,
5202 { &hf_ldap_AttributeDescriptionList_item,
5203 { "AttributeDescription", "ldap.AttributeDescription",
5204 FT_STRING, BASE_NONE, NULL, 0,
5206 { &hf_ldap_attributeDesc,
5207 { "attributeDesc", "ldap.attributeDesc",
5208 FT_STRING, BASE_NONE, NULL, 0,
5209 "AttributeDescription", HFILL }},
5210 { &hf_ldap_assertionValue,
5211 { "assertionValue", "ldap.assertionValue",
5212 FT_STRING, BASE_NONE, NULL, 0,
5215 { "type", "ldap.type",
5216 FT_STRING, BASE_NONE, NULL, 0,
5217 "AttributeDescription", HFILL }},
5219 { "vals", "ldap.vals",
5220 FT_UINT32, BASE_DEC, NULL, 0,
5221 "SET_OF_AttributeValue", HFILL }},
5222 { &hf_ldap_vals_item,
5223 { "AttributeValue", "ldap.AttributeValue",
5224 FT_BYTES, BASE_NONE, NULL, 0,
5226 { &hf_ldap_resultCode,
5227 { "resultCode", "ldap.resultCode",
5228 FT_UINT32, BASE_DEC, VALS(ldap_T_resultCode_vals), 0,
5230 { &hf_ldap_matchedDN,
5231 { "matchedDN", "ldap.matchedDN",
5232 FT_STRING, BASE_NONE, NULL, 0,
5234 { &hf_ldap_errorMessage,
5235 { "errorMessage", "ldap.errorMessage",
5236 FT_STRING, BASE_NONE, NULL, 0,
5238 { &hf_ldap_referral,
5239 { "referral", "ldap.referral",
5240 FT_UINT32, BASE_DEC, NULL, 0,
5242 { &hf_ldap_Referral_item,
5243 { "LDAPURL", "ldap.LDAPURL",
5244 FT_STRING, BASE_NONE, NULL, 0,
5246 { &hf_ldap_Controls_item,
5247 { "Control", "ldap.Control_element",
5248 FT_NONE, BASE_NONE, NULL, 0,
5250 { &hf_ldap_controlType,
5251 { "controlType", "ldap.controlType",
5252 FT_STRING, BASE_NONE, NULL, 0,
5254 { &hf_ldap_criticality,
5255 { "criticality", "ldap.criticality",
5256 FT_BOOLEAN, BASE_NONE, NULL, 0,
5257 "BOOLEAN", HFILL }},
5258 { &hf_ldap_controlValue,
5259 { "controlValue", "ldap.controlValue",
5260 FT_BYTES, BASE_NONE, NULL, 0,
5263 { "version", "ldap.version",
5264 FT_UINT32, BASE_DEC, NULL, 0,
5265 "INTEGER_1_127", HFILL }},
5267 { "name", "ldap.name",
5268 FT_STRING, BASE_NONE, NULL, 0,
5270 { &hf_ldap_authentication,
5271 { "authentication", "ldap.authentication",
5272 FT_UINT32, BASE_DEC, VALS(ldap_AuthenticationChoice_vals), 0,
5273 "AuthenticationChoice", HFILL }},
5275 { "simple", "ldap.simple",
5276 FT_STRING, BASE_NONE, NULL, 0,
5279 { "sasl", "ldap.sasl_element",
5280 FT_NONE, BASE_NONE, NULL, 0,
5281 "SaslCredentials", HFILL }},
5282 { &hf_ldap_ntlmsspNegotiate,
5283 { "ntlmsspNegotiate", "ldap.ntlmsspNegotiate",
5284 FT_BYTES, BASE_NONE, NULL, 0,
5286 { &hf_ldap_ntlmsspAuth,
5287 { "ntlmsspAuth", "ldap.ntlmsspAuth",
5288 FT_BYTES, BASE_NONE, NULL, 0,
5290 { &hf_ldap_mechanism,
5291 { "mechanism", "ldap.mechanism",
5292 FT_STRING, BASE_NONE, NULL, 0,
5294 { &hf_ldap_credentials,
5295 { "credentials", "ldap.credentials",
5296 FT_BYTES, BASE_NONE, NULL, 0,
5298 { &hf_ldap_bindResponse_resultCode,
5299 { "resultCode", "ldap.resultCode",
5300 FT_UINT32, BASE_DEC, VALS(ldap_BindResponse_resultCode_vals), 0,
5301 "BindResponse_resultCode", HFILL }},
5302 { &hf_ldap_bindResponse_matchedDN,
5303 { "matchedDN", "ldap.matchedDN",
5304 FT_STRING, BASE_NONE, NULL, 0,
5305 "T_bindResponse_matchedDN", HFILL }},
5306 { &hf_ldap_serverSaslCreds,
5307 { "serverSaslCreds", "ldap.serverSaslCreds",
5308 FT_BYTES, BASE_NONE, NULL, 0,
5310 { &hf_ldap_baseObject,
5311 { "baseObject", "ldap.baseObject",
5312 FT_STRING, BASE_NONE, NULL, 0,
5315 { "scope", "ldap.scope",
5316 FT_UINT32, BASE_DEC, VALS(ldap_T_scope_vals), 0,
5318 { &hf_ldap_derefAliases,
5319 { "derefAliases", "ldap.derefAliases",
5320 FT_UINT32, BASE_DEC, VALS(ldap_T_derefAliases_vals), 0,
5322 { &hf_ldap_sizeLimit,
5323 { "sizeLimit", "ldap.sizeLimit",
5324 FT_UINT32, BASE_DEC, NULL, 0,
5325 "INTEGER_0_maxInt", HFILL }},
5326 { &hf_ldap_timeLimit,
5327 { "timeLimit", "ldap.timeLimit",
5328 FT_UINT32, BASE_DEC, NULL, 0,
5329 "INTEGER_0_maxInt", HFILL }},
5330 { &hf_ldap_typesOnly,
5331 { "typesOnly", "ldap.typesOnly",
5332 FT_BOOLEAN, BASE_NONE, NULL, 0,
5333 "BOOLEAN", HFILL }},
5335 { "filter", "ldap.filter",
5336 FT_UINT32, BASE_DEC, VALS(ldap_Filter_vals), 0,
5338 { &hf_ldap_searchRequest_attributes,
5339 { "attributes", "ldap.attributes",
5340 FT_UINT32, BASE_DEC, NULL, 0,
5341 "AttributeDescriptionList", HFILL }},
5343 { "and", "ldap.and",
5344 FT_UINT32, BASE_DEC, NULL, 0,
5346 { &hf_ldap_and_item,
5347 { "and item", "ldap.and_item",
5348 FT_UINT32, BASE_DEC, VALS(ldap_Filter_vals), 0,
5352 FT_UINT32, BASE_DEC, NULL, 0,
5355 { "or item", "ldap.or_item",
5356 FT_UINT32, BASE_DEC, VALS(ldap_Filter_vals), 0,
5359 { "not", "ldap.not",
5360 FT_UINT32, BASE_DEC, VALS(ldap_Filter_vals), 0,
5362 { &hf_ldap_equalityMatch,
5363 { "equalityMatch", "ldap.equalityMatch_element",
5364 FT_NONE, BASE_NONE, NULL, 0,
5366 { &hf_ldap_substrings,
5367 { "substrings", "ldap.substrings_element",
5368 FT_NONE, BASE_NONE, NULL, 0,
5369 "SubstringFilter", HFILL }},
5370 { &hf_ldap_greaterOrEqual,
5371 { "greaterOrEqual", "ldap.greaterOrEqual_element",
5372 FT_NONE, BASE_NONE, NULL, 0,
5374 { &hf_ldap_lessOrEqual,
5375 { "lessOrEqual", "ldap.lessOrEqual_element",
5376 FT_NONE, BASE_NONE, NULL, 0,
5379 { "present", "ldap.present",
5380 FT_STRING, BASE_NONE, NULL, 0,
5382 { &hf_ldap_approxMatch,
5383 { "approxMatch", "ldap.approxMatch_element",
5384 FT_NONE, BASE_NONE, NULL, 0,
5386 { &hf_ldap_extensibleMatch,
5387 { "extensibleMatch", "ldap.extensibleMatch_element",
5388 FT_NONE, BASE_NONE, NULL, 0,
5390 { &hf_ldap_substringFilter_substrings,
5391 { "substrings", "ldap.substrings",
5392 FT_UINT32, BASE_DEC, NULL, 0,
5393 "T_substringFilter_substrings", HFILL }},
5394 { &hf_ldap_substringFilter_substrings_item,
5395 { "substrings item", "ldap.substrings_item",
5396 FT_UINT32, BASE_DEC, VALS(ldap_T_substringFilter_substrings_item_vals), 0,
5397 "T_substringFilter_substrings_item", HFILL }},
5399 { "initial", "ldap.initial",
5400 FT_STRING, BASE_NONE, NULL, 0,
5401 "LDAPString", HFILL }},
5403 { "any", "ldap.any",
5404 FT_STRING, BASE_NONE, NULL, 0,
5405 "LDAPString", HFILL }},
5407 { "final", "ldap.final",
5408 FT_STRING, BASE_NONE, NULL, 0,
5409 "LDAPString", HFILL }},
5410 { &hf_ldap_matchingRule,
5411 { "matchingRule", "ldap.matchingRule",
5412 FT_STRING, BASE_NONE, NULL, 0,
5413 "MatchingRuleId", HFILL }},
5414 { &hf_ldap_matchValue,
5415 { "matchValue", "ldap.matchValue",
5416 FT_STRING, BASE_NONE, NULL, 0,
5417 "AssertionValue", HFILL }},
5418 { &hf_ldap_dnAttributes,
5419 { "dnAttributes", "ldap.dnAttributes",
5420 FT_BOOLEAN, BASE_NONE, NULL, 0,
5422 { &hf_ldap_objectName,
5423 { "objectName", "ldap.objectName",
5424 FT_STRING, BASE_NONE, NULL, 0,
5426 { &hf_ldap_searchResultEntry_attributes,
5427 { "attributes", "ldap.attributes",
5428 FT_UINT32, BASE_DEC, NULL, 0,
5429 "PartialAttributeList", HFILL }},
5430 { &hf_ldap_PartialAttributeList_item,
5431 { "PartialAttributeList item", "ldap.PartialAttributeList_item_element",
5432 FT_NONE, BASE_NONE, NULL, 0,
5434 { &hf_ldap__untag_item,
5435 { "LDAPURL", "ldap.LDAPURL",
5436 FT_STRING, BASE_NONE, NULL, 0,
5439 { "object", "ldap.object",
5440 FT_STRING, BASE_NONE, NULL, 0,
5442 { &hf_ldap_modifyRequest_modification,
5443 { "modification", "ldap.modification",
5444 FT_UINT32, BASE_DEC, NULL, 0,
5445 "ModifyRequest_modification", HFILL }},
5446 { &hf_ldap_modifyRequest_modification_item,
5447 { "modification item", "ldap.modification_item_element",
5448 FT_NONE, BASE_NONE, NULL, 0,
5449 "T_modifyRequest_modification_item", HFILL }},
5450 { &hf_ldap_operation,
5451 { "operation", "ldap.operation",
5452 FT_UINT32, BASE_DEC, VALS(ldap_T_operation_vals), 0,
5454 { &hf_ldap_modification,
5455 { "modification", "ldap.modification_element",
5456 FT_NONE, BASE_NONE, NULL, 0,
5457 "AttributeTypeAndValues", HFILL }},
5459 { "entry", "ldap.entry",
5460 FT_STRING, BASE_NONE, NULL, 0,
5462 { &hf_ldap_attributes,
5463 { "attributes", "ldap.attributes",
5464 FT_UINT32, BASE_DEC, NULL, 0,
5465 "AttributeList", HFILL }},
5466 { &hf_ldap_AttributeList_item,
5467 { "AttributeList item", "ldap.AttributeList_item_element",
5468 FT_NONE, BASE_NONE, NULL, 0,
5471 { "newrdn", "ldap.newrdn",
5472 FT_STRING, BASE_NONE, NULL, 0,
5473 "RelativeLDAPDN", HFILL }},
5474 { &hf_ldap_deleteoldrdn,
5475 { "deleteoldrdn", "ldap.deleteoldrdn",
5476 FT_BOOLEAN, BASE_NONE, NULL, 0,
5477 "BOOLEAN", HFILL }},
5478 { &hf_ldap_newSuperior,
5479 { "newSuperior", "ldap.newSuperior",
5480 FT_STRING, BASE_NONE, NULL, 0,
5483 { "ava", "ldap.ava_element",
5484 FT_NONE, BASE_NONE, NULL, 0,
5485 "AttributeValueAssertion", HFILL }},
5486 { &hf_ldap_requestName,
5487 { "requestName", "ldap.requestName",
5488 FT_STRING, BASE_NONE, NULL, 0,
5489 "LDAPOID", HFILL }},
5490 { &hf_ldap_requestValue,
5491 { "requestValue", "ldap.requestValue",
5492 FT_BYTES, BASE_NONE, NULL, 0,
5494 { &hf_ldap_extendedResponse_resultCode,
5495 { "resultCode", "ldap.resultCode",
5496 FT_UINT32, BASE_DEC, VALS(ldap_ExtendedResponse_resultCode_vals), 0,
5497 "ExtendedResponse_resultCode", HFILL }},
5498 { &hf_ldap_responseName,
5499 { "responseName", "ldap.responseName",
5500 FT_STRING, BASE_NONE, NULL, 0,
5502 { &hf_ldap_response,
5503 { "response", "ldap.response",
5504 FT_BYTES, BASE_NONE, NULL, 0,
5505 "OCTET_STRING", HFILL }},
5506 { &hf_ldap_intermediateResponse_responseValue,
5507 { "responseValue", "ldap.responseValue",
5508 FT_BYTES, BASE_NONE, NULL, 0,
5509 "T_intermediateResponse_responseValue", HFILL }},
5511 { "size", "ldap.size",
5512 FT_INT32, BASE_DEC, NULL, 0,
5513 "INTEGER", HFILL }},
5515 { "cookie", "ldap.cookie",
5516 FT_BYTES, BASE_NONE, NULL, 0,
5517 "OCTET_STRING", HFILL }},
5518 { &hf_ldap_SortKeyList_item,
5519 { "SortKeyList item", "ldap.SortKeyList_item_element",
5520 FT_NONE, BASE_NONE, NULL, 0,
5522 { &hf_ldap_attributeType,
5523 { "attributeType", "ldap.attributeType",
5524 FT_STRING, BASE_NONE, NULL, 0,
5525 "AttributeDescription", HFILL }},
5526 { &hf_ldap_orderingRule,
5527 { "orderingRule", "ldap.orderingRule",
5528 FT_STRING, BASE_NONE, NULL, 0,
5529 "MatchingRuleId", HFILL }},
5530 { &hf_ldap_reverseOrder,
5531 { "reverseOrder", "ldap.reverseOrder",
5532 FT_BOOLEAN, BASE_NONE, NULL, 0,
5533 "BOOLEAN", HFILL }},
5534 { &hf_ldap_sortResult,
5535 { "sortResult", "ldap.sortResult",
5536 FT_UINT32, BASE_DEC, VALS(ldap_T_sortResult_vals), 0,
5539 { "flags", "ldap.flags",
5540 FT_UINT32, BASE_HEX, NULL, 0,
5541 "DirSyncFlags", HFILL }},
5542 { &hf_ldap_maxBytes,
5543 { "maxBytes", "ldap.maxBytes",
5544 FT_INT32, BASE_DEC, NULL, 0,
5545 "INTEGER", HFILL }},
5546 { &hf_ldap_userIdentity,
5547 { "userIdentity", "ldap.userIdentity",
5548 FT_BYTES, BASE_NONE, NULL, 0,
5549 "OCTET_STRING", HFILL }},
5550 { &hf_ldap_oldPasswd,
5551 { "oldPasswd", "ldap.oldPasswd",
5552 FT_BYTES, BASE_NONE, NULL, 0,
5553 "OCTET_STRING", HFILL }},
5554 { &hf_ldap_newPasswd,
5555 { "newPasswd", "ldap.newPasswd",
5556 FT_BYTES, BASE_NONE, NULL, 0,
5557 "OCTET_STRING", HFILL }},
5558 { &hf_ldap_cancelID,
5559 { "cancelID", "ldap.cancelID",
5560 FT_UINT32, BASE_DEC, NULL, 0,
5561 "MessageID", HFILL }},
5563 { "mode", "ldap.mode",
5564 FT_UINT32, BASE_DEC, VALS(ldap_T_mode_vals), 0,
5566 { &hf_ldap_reloadHint,
5567 { "reloadHint", "ldap.reloadHint",
5568 FT_BOOLEAN, BASE_NONE, NULL, 0,
5569 "BOOLEAN", HFILL }},
5571 { "state", "ldap.state",
5572 FT_UINT32, BASE_DEC, VALS(ldap_T_state_vals), 0,
5574 { &hf_ldap_entryUUID,
5575 { "entryUUID", "ldap.entryUUID",
5576 FT_BYTES, BASE_NONE, NULL, 0,
5577 "SyncUUID", HFILL }},
5578 { &hf_ldap_refreshDeletes,
5579 { "refreshDeletes", "ldap.refreshDeletes",
5580 FT_BOOLEAN, BASE_NONE, NULL, 0,
5581 "BOOLEAN", HFILL }},
5582 { &hf_ldap_newcookie,
5583 { "newcookie", "ldap.newcookie",
5584 FT_BYTES, BASE_NONE, NULL, 0,
5585 "OCTET_STRING", HFILL }},
5586 { &hf_ldap_refreshDelete,
5587 { "refreshDelete", "ldap.refreshDelete_element",
5588 FT_NONE, BASE_NONE, NULL, 0,
5590 { &hf_ldap_refreshDone,
5591 { "refreshDone", "ldap.refreshDone",
5592 FT_BOOLEAN, BASE_NONE, NULL, 0,
5593 "BOOLEAN", HFILL }},
5594 { &hf_ldap_refreshPresent,
5595 { "refreshPresent", "ldap.refreshPresent_element",
5596 FT_NONE, BASE_NONE, NULL, 0,
5598 { &hf_ldap_syncIdSet,
5599 { "syncIdSet", "ldap.syncIdSet_element",
5600 FT_NONE, BASE_NONE, NULL, 0,
5602 { &hf_ldap_syncUUIDs,
5603 { "syncUUIDs", "ldap.syncUUIDs",
5604 FT_UINT32, BASE_DEC, NULL, 0,
5605 "SET_OF_SyncUUID", HFILL }},
5606 { &hf_ldap_syncUUIDs_item,
5607 { "SyncUUID", "ldap.SyncUUID",
5608 FT_BYTES, BASE_NONE, NULL, 0,
5611 { "warning", "ldap.warning",
5612 FT_UINT32, BASE_DEC, VALS(ldap_T_warning_vals), 0,
5614 { &hf_ldap_timeBeforeExpiration,
5615 { "timeBeforeExpiration", "ldap.timeBeforeExpiration",
5616 FT_UINT32, BASE_DEC, NULL, 0,
5617 "INTEGER_0_maxInt", HFILL }},
5618 { &hf_ldap_graceAuthNsRemaining,
5619 { "graceAuthNsRemaining", "ldap.graceAuthNsRemaining",
5620 FT_UINT32, BASE_DEC, NULL, 0,
5621 "INTEGER_0_maxInt", HFILL }},
5623 { "error", "ldap.error",
5624 FT_UINT32, BASE_DEC, VALS(ldap_T_error_vals), 0,
5627 /*--- End of included file: packet-ldap-hfarr.c ---*/
5628 #line 2142 "./asn1/ldap/packet-ldap-template.c"
5631 /* List of subtrees */
5632 static gint *ett[] = {
5635 &ett_ldap_sasl_blob,
5637 &ett_mscldap_netlogon_flags,
5638 &ett_mscldap_ntver_flags,
5639 &ett_mscldap_ipdetails,
5640 &ett_ldap_DirSyncFlagsSubEntry,
5643 /*--- Included file: packet-ldap-ettarr.c ---*/
5644 #line 1 "./asn1/ldap/packet-ldap-ettarr.c"
5645 &ett_ldap_LDAPMessage,
5646 &ett_ldap_ProtocolOp,
5647 &ett_ldap_AttributeDescriptionList,
5648 &ett_ldap_AttributeValueAssertion,
5649 &ett_ldap_Attribute,
5650 &ett_ldap_SET_OF_AttributeValue,
5651 &ett_ldap_LDAPResult,
5655 &ett_ldap_BindRequest_U,
5656 &ett_ldap_AuthenticationChoice,
5657 &ett_ldap_SaslCredentials,
5658 &ett_ldap_BindResponse_U,
5659 &ett_ldap_SearchRequest_U,
5663 &ett_ldap_SubstringFilter,
5664 &ett_ldap_T_substringFilter_substrings,
5665 &ett_ldap_T_substringFilter_substrings_item,
5666 &ett_ldap_MatchingRuleAssertion,
5667 &ett_ldap_SearchResultEntry_U,
5668 &ett_ldap_PartialAttributeList,
5669 &ett_ldap_PartialAttributeList_item,
5670 &ett_ldap_SEQUENCE_OF_LDAPURL,
5671 &ett_ldap_ModifyRequest_U,
5672 &ett_ldap_ModifyRequest_modification,
5673 &ett_ldap_T_modifyRequest_modification_item,
5674 &ett_ldap_AttributeTypeAndValues,
5675 &ett_ldap_AddRequest_U,
5676 &ett_ldap_AttributeList,
5677 &ett_ldap_AttributeList_item,
5678 &ett_ldap_ModifyDNRequest_U,
5679 &ett_ldap_CompareRequest_U,
5680 &ett_ldap_ExtendedRequest_U,
5681 &ett_ldap_ExtendedResponse_U,
5682 &ett_ldap_IntermediateResponse_U,
5683 &ett_ldap_SearchControlValue,
5684 &ett_ldap_SortKeyList,
5685 &ett_ldap_SortKeyList_item,
5686 &ett_ldap_SortResult,
5687 &ett_ldap_DirSyncControlValue,
5688 &ett_ldap_PasswdModifyRequestValue,
5689 &ett_ldap_CancelRequestValue,
5690 &ett_ldap_SyncRequestValue,
5691 &ett_ldap_SyncStateValue,
5692 &ett_ldap_SyncDoneValue,
5693 &ett_ldap_SyncInfoValue,
5694 &ett_ldap_T_refreshDelete,
5695 &ett_ldap_T_refreshPresent,
5696 &ett_ldap_T_syncIdSet,
5697 &ett_ldap_SET_OF_SyncUUID,
5698 &ett_ldap_PasswordPolicyResponseValue,
5699 &ett_ldap_T_warning,
5701 /*--- End of included file: packet-ldap-ettarr.c ---*/
5702 #line 2156 "./asn1/ldap/packet-ldap-template.c"
5704 /* UAT for header fields */
5705 static uat_field_t custom_attribute_types_uat_fields[] = {
5706 UAT_FLD_CSTRING(attribute_types, attribute_type, "Attribute type", "Attribute type"),
5707 UAT_FLD_CSTRING(attribute_types, attribute_desc, "Description", "Description of the value matching type"),
5711 static ei_register_info ei[] = {
5712 { &ei_ldap_exceeded_filter_length, { "ldap.exceeded_filter_length", PI_UNDECODED, PI_ERROR, "Filter length exceeds number. Giving up", EXPFILL }},
5713 { &ei_ldap_too_many_filter_elements, { "ldap.too_many_filter_elements", PI_UNDECODED, PI_ERROR, "Found more than %%u filter elements. Giving up.", EXPFILL }},
5716 expert_module_t* expert_ldap;
5717 module_t *ldap_module;
5718 uat_t *attributes_uat;
5720 /* Register protocol */
5721 proto_ldap = proto_register_protocol(PNAME, PSNAME, PFNAME);
5722 /* Register fields and subtrees */
5723 proto_register_field_array(proto_ldap, hf, array_length(hf));
5724 proto_register_subtree_array(ett, array_length(ett));
5725 expert_ldap = expert_register_protocol(proto_ldap);
5726 expert_register_field_array(expert_ldap, ei, array_length(ei));
5728 ldap_handle = register_dissector("ldap", dissect_ldap_tcp, proto_ldap);
5730 ldap_module = prefs_register_protocol(proto_ldap, prefs_register_ldap);
5731 prefs_register_bool_preference(ldap_module, "desegment_ldap_messages",
5732 "Reassemble LDAP messages spanning multiple TCP segments",
5733 "Whether the LDAP dissector should reassemble messages spanning multiple TCP segments."
5734 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
5737 prefs_register_uint_preference(ldap_module, "ssl.port", "LDAPS TCP Port",
5738 "Set the port for LDAP operations over SSL",
5739 10, &global_ldaps_tcp_port);
5741 attributes_uat = uat_new("Custom LDAP AttributeValue types",
5742 sizeof(attribute_type_t),
5743 "custom_ldap_attribute_types",
5746 &num_attribute_types,
5747 /* specifies named fields, so affects dissection
5748 and the set of named fields */
5749 UAT_AFFECTS_DISSECTION|UAT_AFFECTS_FIELDS,
5751 attribute_types_copy_cb,
5752 attribute_types_update_cb,
5753 attribute_types_free_cb,
5754 attribute_types_initialize_cb,
5756 custom_attribute_types_uat_fields);
5758 prefs_register_uat_preference(ldap_module, "custom_ldap_attribute_types",
5759 "Custom AttributeValue types",
5760 "A table to define custom LDAP attribute type values for which fields can be setup and used for filtering/data extraction etc.",
5763 prefs_register_obsolete_preference(ldap_module, "max_pdu");
5765 proto_cldap = proto_register_protocol(
5766 "Connectionless Lightweight Directory Access Protocol",
5769 ldap_tap=register_tap("ldap");
5771 ldap_name_dissector_table = register_dissector_table("ldap.name", "LDAP Attribute Type Dissectors", proto_cldap, FT_STRING, BASE_NONE);
5773 register_srt_table(proto_ldap, NULL, 1, ldapstat_packet, ldapstat_init, NULL);
5777 /*--- proto_reg_handoff_ldap ---------------------------------------*/
5779 proto_reg_handoff_ldap(void)
5781 dissector_handle_t cldap_handle;
5783 cldap_handle = create_dissector_handle(dissect_mscldap, proto_cldap);
5784 dissector_add_uint_with_preference("udp.port", UDP_PORT_CLDAP, cldap_handle);
5786 gssapi_handle = find_dissector_add_dependency("gssapi", proto_ldap);
5787 gssapi_wrap_handle = find_dissector_add_dependency("gssapi_verf", proto_ldap);
5788 spnego_handle = find_dissector_add_dependency("spnego", proto_ldap);
5790 ntlmssp_handle = find_dissector_add_dependency("ntlmssp", proto_ldap);
5792 ssl_handle = find_dissector_add_dependency("ssl", proto_ldap);
5794 prefs_register_ldap();
5796 oid_add_from_string("ISO assigned OIDs, USA", "1.2.840");
5798 /* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dsml/dsml/ldap_controls_and_session_support.asp */
5799 oid_add_from_string("LDAP_PAGED_RESULT_OID_STRING","1.2.840.113556.1.4.319");
5800 oid_add_from_string("LDAP_SERVER_SHOW_DELETED_OID","1.2.840.113556.1.4.417");
5801 oid_add_from_string("LDAP_SERVER_SORT_OID","1.2.840.113556.1.4.473");
5802 oid_add_from_string("LDAP_CONTROL_SORT_RESP_OID","1.2.840.113556.1.4.474");
5803 oid_add_from_string("LDAP_SERVER_CROSSDOM_MOVE_TARGET_OID","1.2.840.113556.1.4.521");
5804 oid_add_from_string("LDAP_SERVER_NOTIFICATION_OID","1.2.840.113556.1.4.528");
5805 oid_add_from_string("LDAP_SERVER_EXTENDED_DN_OID","1.2.840.113556.1.4.529");
5806 oid_add_from_string("meetingAdvertiseScope","1.2.840.113556.1.4.582");
5807 oid_add_from_string("LDAP_SERVER_LAZY_COMMIT_OID","1.2.840.113556.1.4.619");
5808 oid_add_from_string("mhsORAddress","1.2.840.113556.1.4.650");
5809 oid_add_from_string("managedObjects","1.2.840.113556.1.4.654");
5810 oid_add_from_string("LDAP_CAP_ACTIVE_DIRECTORY_OID","1.2.840.113556.1.4.800");
5811 oid_add_from_string("LDAP_SERVER_SD_FLAGS_OID","1.2.840.113556.1.4.801");
5812 oid_add_from_string("LDAP_OID_COMPARATOR_OR","1.2.840.113556.1.4.804");
5813 oid_add_from_string("LDAP_SERVER_TREE_DELETE_OID","1.2.840.113556.1.4.805");
5814 oid_add_from_string("LDAP_SERVER_DIRSYNC_OID","1.2.840.113556.1.4.841");
5815 oid_add_from_string("None","1.2.840.113556.1.4.970");
5816 oid_add_from_string("LDAP_SERVER_VERIFY_NAME_OID","1.2.840.113556.1.4.1338");
5817 oid_add_from_string("LDAP_SERVER_DOMAIN_SCOPE_OID","1.2.840.113556.1.4.1339");
5818 oid_add_from_string("LDAP_SERVER_SEARCH_OPTIONS_OID","1.2.840.113556.1.4.1340");
5819 oid_add_from_string("LDAP_SERVER_PERMISSIVE_MODIFY_OID","1.2.840.113556.1.4.1413");
5820 oid_add_from_string("LDAP_SERVER_ASQ_OID","1.2.840.113556.1.4.1504");
5821 oid_add_from_string("LDAP_CAP_ACTIVE_DIRECTORY_V51_OID","1.2.840.113556.1.4.1670");
5822 oid_add_from_string("LDAP_SERVER_FAST_BIND_OID","1.2.840.113556.1.4.1781");
5823 oid_add_from_string("LDAP_CAP_ACTIVE_DIRECTORY_LDAP_INTEG_OID","1.2.840.113556.1.4.1791");
5824 oid_add_from_string("msDS-ObjectReference","1.2.840.113556.1.4.1840");
5825 oid_add_from_string("msDS-QuotaEffective","1.2.840.113556.1.4.1848");
5826 oid_add_from_string("LDAP_CAP_ACTIVE_DIRECTORY_ADAM_OID","1.2.840.113556.1.4.1851");
5827 oid_add_from_string("msDS-PortSSL","1.2.840.113556.1.4.1860");
5828 oid_add_from_string("msDS-isRODC","1.2.840.113556.1.4.1960");
5829 oid_add_from_string("msDS-SDReferenceDomain","1.2.840.113556.1.4.1711");
5830 oid_add_from_string("msDS-AdditionalDnsHostName","1.2.840.113556.1.4.1717");
5831 oid_add_from_string("None","1.3.6.1.4.1.1466.101.119.1");
5832 oid_add_from_string("LDAP_START_TLS_OID","1.3.6.1.4.1.1466.20037");
5834 oid_add_from_string("inetOrgPerson", "2.16.840.1.113730.3.2.2");
5836 oid_add_from_string("US company arc", "2.16.840.1");
5838 /* http://www.alvestrand.no/objectid/2.16.840.1.113730.3.4.html */
5839 oid_add_from_string("Manage DSA IT LDAPv3 control", "2.16.840.1.113730.3.4.2");
5840 oid_add_from_string("Persistent Search LDAPv3 control", "2.16.840.1.113730.3.4.3");
5841 oid_add_from_string("Netscape Password Expired LDAPv3 control", "2.16.840.1.113730.3.4.4");
5842 oid_add_from_string("Netscape Password Expiring LDAPv3 control", "2.16.840.1.113730.3.4.5");
5843 oid_add_from_string("Netscape NT Synchronization Client LDAPv3 control", "2.16.840.1.113730.3.4.6");
5844 oid_add_from_string("Entry Change Notification LDAPv3 control", "2.16.840.1.113730.3.4.7");
5845 oid_add_from_string("Transaction ID Request Control", "2.16.840.1.113730.3.4.8");
5846 oid_add_from_string("VLV Request LDAPv3 control", "2.16.840.1.113730.3.4.9");
5847 oid_add_from_string("VLV Response LDAPv3 control", "2.16.840.1.113730.3.4.10");
5848 oid_add_from_string("Transaction ID Response Control", "2.16.840.1.113730.3.4.11");
5849 oid_add_from_string("Proxied Authorization (version 1) control", "2.16.840.1.113730.3.4.12");
5850 oid_add_from_string("iPlanet Directory Server Replication Update Information Control", "2.16.840.1.113730.3.4.13");
5851 oid_add_from_string("iPlanet Directory Server search on specific backend control", "2.16.840.1.113730.3.4.14");
5852 oid_add_from_string("Authentication Response Control", "2.16.840.1.113730.3.4.15");
5853 oid_add_from_string("Authentication Request Control", "2.16.840.1.113730.3.4.16");
5854 oid_add_from_string("Real Attributes Only Request Control", "2.16.840.1.113730.3.4.17");
5855 oid_add_from_string("Proxied Authorization (version 2) Control", "2.16.840.1.113730.3.4.18");
5856 oid_add_from_string("Chaining loop detection", "2.16.840.1.113730.3.4.19");
5857 oid_add_from_string("iPlanet Replication Modrdn Extra Mods Control", "2.16.840.1.113730.3.4.999");
5860 oid_add_from_string("LDAP_SERVER_QUOTA_CONTROL_OID", "1.2.840.113556.1.4.1852");
5861 oid_add_from_string("LDAP_SERVER_RANGE_OPTION_OID", "1.2.840.113556.1.4.802");
5862 oid_add_from_string("LDAP_SERVER_SHUTDOWN_NOTIFY_OID", "1.2.840.113556.1.4.1907");
5863 oid_add_from_string("LDAP_SERVER_RANGE_RETRIEVAL_NOERR_OID", "1.2.840.113556.1.4.1948");
5866 dissector_add_string("ldap.name", "netlogon", create_dissector_handle(dissect_NetLogon_PDU, proto_cldap));
5867 dissector_add_string("ldap.name", "objectGUID", create_dissector_handle(dissect_ldap_guid, proto_ldap));
5868 dissector_add_string("ldap.name", "supportedControl", create_dissector_handle(dissect_ldap_oid, proto_ldap));
5869 dissector_add_string("ldap.name", "supportedCapabilities", create_dissector_handle(dissect_ldap_oid, proto_ldap));
5870 dissector_add_string("ldap.name", "objectSid", create_dissector_handle(dissect_ldap_sid, proto_ldap));
5871 dissector_add_string("ldap.name", "nTSecurityDescriptor", create_dissector_handle(dissect_ldap_nt_sec_desc, proto_ldap));
5874 /*--- Included file: packet-ldap-dis-tab.c ---*/
5875 #line 1 "./asn1/ldap/packet-ldap-dis-tab.c"
5876 register_ber_oid_dissector("1.2.840.113556.1.4.319", dissect_SearchControlValue_PDU, proto_ldap, "pagedResultsControl");
5877 register_ber_oid_dissector("1.2.840.113556.1.4.473", dissect_SortKeyList_PDU, proto_ldap, "sortKeyList");
5878 register_ber_oid_dissector("1.2.840.113556.1.4.474", dissect_SortResult_PDU, proto_ldap, "sortResult");
5879 register_ber_oid_dissector("1.2.840.113556.1.4.841", dissect_DirSyncControlValue_PDU, proto_ldap, "dirsync");
5880 register_ber_oid_dissector("1.3.6.1.4.1.4203.1.11.1", dissect_PasswdModifyRequestValue_PDU, proto_ldap, "passwdModifyOID");
5881 register_ber_oid_dissector("1.3.6.1.1.8", dissect_CancelRequestValue_PDU, proto_ldap, "cancelRequestOID");
5882 register_ber_oid_dissector("1.3.6.1.4.1.4203.1.9.1.1", dissect_SyncRequestValue_PDU, proto_ldap, "syncRequestOID");
5883 register_ber_oid_dissector("1.3.6.1.4.1.4203.1.9.1.2", dissect_SyncStateValue_PDU, proto_ldap, "syncStateOID");
5884 register_ber_oid_dissector("1.3.6.1.4.1.4203.1.9.1.3", dissect_SyncDoneValue_PDU, proto_ldap, "syncDoneOID");
5885 register_ber_oid_dissector("1.3.6.1.4.1.4203.1.9.1.4", dissect_SyncInfoValue_PDU, proto_ldap, "syncInfoOID");
5886 register_ber_oid_dissector("1.3.6.1.4.1.42.2.27.8.5.1", dissect_PasswordPolicyResponseValue_PDU, proto_ldap, "passwordPolicy");
5889 /*--- End of included file: packet-ldap-dis-tab.c ---*/
5890 #line 2327 "./asn1/ldap/packet-ldap-template.c"
5892 dissector_add_uint_range_with_preference("tcp.port", TCP_PORT_RANGE_LDAP, ldap_handle);
5896 prefs_register_ldap(void)
5898 if(ssl_port != global_ldaps_tcp_port) {
5900 ssl_dissector_delete(ssl_port, ldap_handle);
5902 /* Set our port number for future use */
5903 ssl_port = global_ldaps_tcp_port;
5906 ssl_dissector_add(ssl_port, ldap_handle);
5912 * Editor modelines - http://www.wireshark.org/tools/modelines.html
5917 * indent-tabs-mode: nil
5920 * vi: set shiftwidth=2 tabstop=8 expandtab:
5921 * :indentSize=2:tabSize=8:noTabs=true: