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 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version 2
21 * of the License, or (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
34 * This is not a complete implementation. It doesn't handle the full version 3, more specifically,
35 * it handles only the commands of version 2, but any additional characteristics of the ver3 command are supported.
36 * It's also missing extensible search filters.
38 * There should probably be a lot more error checking, I simply assume that if we have a full packet, it will be a complete
41 * 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
42 * 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
46 * nazard@dragoninc.on.ca
50 * 11/11/2002 - Fixed problem when decoding LDAP with desegmentation enabled and the
51 * ASN.1 BER Universal Class Tag: "Sequence Of" header is encapsulated across 2
55 * ronald.henderson@cognicaseusa.com
59 * 20-JAN-2004 - added decoding of MS-CLDAP netlogon RPC
60 * using information from the SNIA 2003 conference paper :
61 * Active Directory Domain Controller Location Service
67 * 17-DEC-2004 - added basic decoding for LDAP Controls
68 * 20-DEC-2004 - added handling for GSS-API encrypted blobs
70 * Stefan Metzmacher <metze@samba.org>
72 * 15-NOV-2005 - Changed to use the asn2wrs compiler
73 * Anders Broman <anders.broman@ericsson.com>
77 * 3-AUG-2008 - Extended the cldap support to include all netlogon data types.
78 * Updated cldap_netlogon_flags to include Windows 2008 flags
79 * Expanded the ntver ldap option with bit field
81 * Gary Reynolds <gazzadownunder@yahoo.co.uk>
85 * 09-DEC-2009 - Added support for RFC4533
86 * Content Synchronization Operation (aka syncrepl)
87 * 11-DEC-2009 - Added support for IntermediateResponse (LDAP v3 from RFC 4511)
88 * Mathieu Parent <math.parent@gmail.com>
93 #include <epan/packet.h>
94 #include <epan/exceptions.h>
95 #include <epan/conversation.h>
96 #include <epan/prefs.h>
98 #include <epan/srt_table.h>
99 #include <epan/oids.h>
100 #include <epan/strutil.h>
101 #include <epan/show_exception.h>
102 #include <epan/asn1.h>
103 #include <epan/expert.h>
104 #include <epan/uat.h>
105 #include <wsutil/str_util.h>
106 #include "packet-frame.h"
107 #include "packet-tcp.h"
108 #include "packet-windows-common.h"
109 #include "packet-dcerpc.h"
111 #include "packet-ldap.h"
112 #include "packet-ntlmssp.h"
113 #include "packet-ssl.h"
114 #include "packet-ssl-utils.h"
115 #include "packet-smb-common.h"
116 #include "packet-gssapi.h"
118 #include "packet-ber.h"
119 #include "packet-per.h"
120 #include "packet-dns.h"
122 #define PNAME "Lightweight Directory Access Protocol"
123 #define PSNAME "LDAP"
124 #define PFNAME "ldap"
126 void proto_register_ldap(void);
127 void proto_reg_handoff_ldap(void);
129 /* Initialize the protocol and registered fields */
130 static int ldap_tap = -1;
131 static int proto_ldap = -1;
132 static int proto_cldap = -1;
134 static int hf_ldap_sasl_buffer_length = -1;
135 static int hf_ldap_response_in = -1;
136 static int hf_ldap_response_to = -1;
137 static int hf_ldap_time = -1;
138 static int hf_ldap_guid = -1;
140 static int hf_mscldap_ntver_flags = -1;
141 static int hf_mscldap_ntver_flags_v1 = -1;
142 static int hf_mscldap_ntver_flags_v5 = -1;
143 static int hf_mscldap_ntver_flags_v5ex = -1;
144 static int hf_mscldap_ntver_flags_v5ep = -1;
145 static int hf_mscldap_ntver_flags_vcs = -1;
146 static int hf_mscldap_ntver_flags_vnt4 = -1;
147 static int hf_mscldap_ntver_flags_vpdc = -1;
148 static int hf_mscldap_ntver_flags_vip = -1;
149 static int hf_mscldap_ntver_flags_vl = -1;
150 static int hf_mscldap_ntver_flags_vgc = -1;
152 static int hf_mscldap_netlogon_ipaddress_family = -1;
153 static int hf_mscldap_netlogon_ipaddress_port = -1;
154 static int hf_mscldap_netlogon_ipaddress = -1;
155 static int hf_mscldap_netlogon_ipaddress_ipv4 = -1;
156 static int hf_mscldap_netlogon_opcode = -1;
157 static int hf_mscldap_netlogon_flags = -1;
158 static int hf_mscldap_netlogon_flags_pdc = -1;
159 static int hf_mscldap_netlogon_flags_gc = -1;
160 static int hf_mscldap_netlogon_flags_ldap = -1;
161 static int hf_mscldap_netlogon_flags_ds = -1;
162 static int hf_mscldap_netlogon_flags_kdc = -1;
163 static int hf_mscldap_netlogon_flags_timeserv = -1;
164 static int hf_mscldap_netlogon_flags_closest = -1;
165 static int hf_mscldap_netlogon_flags_writable = -1;
166 static int hf_mscldap_netlogon_flags_good_timeserv = -1;
167 static int hf_mscldap_netlogon_flags_ndnc = -1;
168 static int hf_mscldap_netlogon_flags_fnc = -1;
169 static int hf_mscldap_netlogon_flags_dnc = -1;
170 static int hf_mscldap_netlogon_flags_dns = -1;
171 static int hf_mscldap_netlogon_flags_wdc = -1;
172 static int hf_mscldap_netlogon_flags_rodc = -1;
173 static int hf_mscldap_domain_guid = -1;
174 static int hf_mscldap_forest = -1;
175 static int hf_mscldap_domain = -1;
176 static int hf_mscldap_hostname = -1;
177 static int hf_mscldap_nb_domain = -1;
178 static int hf_mscldap_nb_hostname = -1;
179 static int hf_mscldap_username = -1;
180 static int hf_mscldap_sitename = -1;
181 static int hf_mscldap_clientsitename = -1;
182 static int hf_mscldap_netlogon_lm_token = -1;
183 static int hf_mscldap_netlogon_nt_token = -1;
184 static int hf_ldap_sid = -1;
185 static int hf_ldap_AccessMask_ADS_CREATE_CHILD = -1;
186 static int hf_ldap_AccessMask_ADS_DELETE_CHILD = -1;
187 static int hf_ldap_AccessMask_ADS_LIST = -1;
188 static int hf_ldap_AccessMask_ADS_SELF_WRITE = -1;
189 static int hf_ldap_AccessMask_ADS_READ_PROP = -1;
190 static int hf_ldap_AccessMask_ADS_WRITE_PROP = -1;
191 static int hf_ldap_AccessMask_ADS_DELETE_TREE = -1;
192 static int hf_ldap_AccessMask_ADS_LIST_OBJECT = -1;
193 static int hf_ldap_AccessMask_ADS_CONTROL_ACCESS = -1;
194 static int hf_ldap_LDAPMessage_PDU = -1;
195 static int hf_ldap_object_security_flag = -1;
196 static int hf_ldap_ancestor_first_flag = -1;
197 static int hf_ldap_public_data_only_flag = -1;
198 static int hf_ldap_incremental_value_flag = -1;
199 static int hf_ldap_oid = -1;
200 static int hf_ldap_gssapi_encrypted_payload = -1;
203 /*--- Included file: packet-ldap-hf.c ---*/
204 #line 1 "./asn1/ldap/packet-ldap-hf.c"
205 static int hf_ldap_SearchControlValue_PDU = -1; /* SearchControlValue */
206 static int hf_ldap_SortKeyList_PDU = -1; /* SortKeyList */
207 static int hf_ldap_SortResult_PDU = -1; /* SortResult */
208 static int hf_ldap_DirSyncControlValue_PDU = -1; /* DirSyncControlValue */
209 static int hf_ldap_PasswdModifyRequestValue_PDU = -1; /* PasswdModifyRequestValue */
210 static int hf_ldap_CancelRequestValue_PDU = -1; /* CancelRequestValue */
211 static int hf_ldap_SyncRequestValue_PDU = -1; /* SyncRequestValue */
212 static int hf_ldap_SyncStateValue_PDU = -1; /* SyncStateValue */
213 static int hf_ldap_SyncDoneValue_PDU = -1; /* SyncDoneValue */
214 static int hf_ldap_SyncInfoValue_PDU = -1; /* SyncInfoValue */
215 static int hf_ldap_PasswordPolicyResponseValue_PDU = -1; /* PasswordPolicyResponseValue */
216 static int hf_ldap_messageID = -1; /* MessageID */
217 static int hf_ldap_protocolOp = -1; /* ProtocolOp */
218 static int hf_ldap_controls = -1; /* Controls */
219 static int hf_ldap_bindRequest = -1; /* BindRequest */
220 static int hf_ldap_bindResponse = -1; /* BindResponse */
221 static int hf_ldap_unbindRequest = -1; /* UnbindRequest */
222 static int hf_ldap_searchRequest = -1; /* SearchRequest */
223 static int hf_ldap_searchResEntry = -1; /* SearchResultEntry */
224 static int hf_ldap_searchResDone = -1; /* SearchResultDone */
225 static int hf_ldap_searchResRef = -1; /* SearchResultReference */
226 static int hf_ldap_modifyRequest = -1; /* ModifyRequest */
227 static int hf_ldap_modifyResponse = -1; /* ModifyResponse */
228 static int hf_ldap_addRequest = -1; /* AddRequest */
229 static int hf_ldap_addResponse = -1; /* AddResponse */
230 static int hf_ldap_delRequest = -1; /* DelRequest */
231 static int hf_ldap_delResponse = -1; /* DelResponse */
232 static int hf_ldap_modDNRequest = -1; /* ModifyDNRequest */
233 static int hf_ldap_modDNResponse = -1; /* ModifyDNResponse */
234 static int hf_ldap_compareRequest = -1; /* CompareRequest */
235 static int hf_ldap_compareResponse = -1; /* CompareResponse */
236 static int hf_ldap_abandonRequest = -1; /* AbandonRequest */
237 static int hf_ldap_extendedReq = -1; /* ExtendedRequest */
238 static int hf_ldap_extendedResp = -1; /* ExtendedResponse */
239 static int hf_ldap_intermediateResponse = -1; /* IntermediateResponse */
240 static int hf_ldap_AttributeDescriptionList_item = -1; /* AttributeDescription */
241 static int hf_ldap_attributeDesc = -1; /* AttributeDescription */
242 static int hf_ldap_assertionValue = -1; /* AssertionValue */
243 static int hf_ldap_type = -1; /* AttributeDescription */
244 static int hf_ldap_vals = -1; /* SET_OF_AttributeValue */
245 static int hf_ldap_vals_item = -1; /* AttributeValue */
246 static int hf_ldap_resultCode = -1; /* T_resultCode */
247 static int hf_ldap_matchedDN = -1; /* LDAPDN */
248 static int hf_ldap_errorMessage = -1; /* ErrorMessage */
249 static int hf_ldap_referral = -1; /* Referral */
250 static int hf_ldap_Referral_item = -1; /* LDAPURL */
251 static int hf_ldap_Controls_item = -1; /* Control */
252 static int hf_ldap_controlType = -1; /* ControlType */
253 static int hf_ldap_criticality = -1; /* BOOLEAN */
254 static int hf_ldap_controlValue = -1; /* T_controlValue */
255 static int hf_ldap_version = -1; /* INTEGER_1_127 */
256 static int hf_ldap_name = -1; /* LDAPDN */
257 static int hf_ldap_authentication = -1; /* AuthenticationChoice */
258 static int hf_ldap_simple = -1; /* Simple */
259 static int hf_ldap_sasl = -1; /* SaslCredentials */
260 static int hf_ldap_ntlmsspNegotiate = -1; /* T_ntlmsspNegotiate */
261 static int hf_ldap_ntlmsspAuth = -1; /* T_ntlmsspAuth */
262 static int hf_ldap_mechanism = -1; /* Mechanism */
263 static int hf_ldap_credentials = -1; /* Credentials */
264 static int hf_ldap_bindResponse_resultCode = -1; /* BindResponse_resultCode */
265 static int hf_ldap_bindResponse_matchedDN = -1; /* T_bindResponse_matchedDN */
266 static int hf_ldap_serverSaslCreds = -1; /* ServerSaslCreds */
267 static int hf_ldap_baseObject = -1; /* LDAPDN */
268 static int hf_ldap_scope = -1; /* T_scope */
269 static int hf_ldap_derefAliases = -1; /* T_derefAliases */
270 static int hf_ldap_sizeLimit = -1; /* INTEGER_0_maxInt */
271 static int hf_ldap_timeLimit = -1; /* INTEGER_0_maxInt */
272 static int hf_ldap_typesOnly = -1; /* BOOLEAN */
273 static int hf_ldap_filter = -1; /* T_filter */
274 static int hf_ldap_searchRequest_attributes = -1; /* AttributeDescriptionList */
275 static int hf_ldap_and = -1; /* T_and */
276 static int hf_ldap_and_item = -1; /* T_and_item */
277 static int hf_ldap_or = -1; /* T_or */
278 static int hf_ldap_or_item = -1; /* T_or_item */
279 static int hf_ldap_not = -1; /* T_not */
280 static int hf_ldap_equalityMatch = -1; /* T_equalityMatch */
281 static int hf_ldap_substrings = -1; /* SubstringFilter */
282 static int hf_ldap_greaterOrEqual = -1; /* T_greaterOrEqual */
283 static int hf_ldap_lessOrEqual = -1; /* T_lessOrEqual */
284 static int hf_ldap_present = -1; /* T_present */
285 static int hf_ldap_approxMatch = -1; /* T_approxMatch */
286 static int hf_ldap_extensibleMatch = -1; /* T_extensibleMatch */
287 static int hf_ldap_substringFilter_substrings = -1; /* T_substringFilter_substrings */
288 static int hf_ldap_substringFilter_substrings_item = -1; /* T_substringFilter_substrings_item */
289 static int hf_ldap_initial = -1; /* LDAPString */
290 static int hf_ldap_any = -1; /* LDAPString */
291 static int hf_ldap_final = -1; /* LDAPString */
292 static int hf_ldap_matchingRule = -1; /* MatchingRuleId */
293 static int hf_ldap_matchValue = -1; /* AssertionValue */
294 static int hf_ldap_dnAttributes = -1; /* T_dnAttributes */
295 static int hf_ldap_objectName = -1; /* LDAPDN */
296 static int hf_ldap_searchResultEntry_attributes = -1; /* PartialAttributeList */
297 static int hf_ldap_PartialAttributeList_item = -1; /* PartialAttributeList_item */
298 static int hf_ldap__untag_item = -1; /* LDAPURL */
299 static int hf_ldap_object = -1; /* LDAPDN */
300 static int hf_ldap_modifyRequest_modification = -1; /* ModifyRequest_modification */
301 static int hf_ldap_modifyRequest_modification_item = -1; /* T_modifyRequest_modification_item */
302 static int hf_ldap_operation = -1; /* T_operation */
303 static int hf_ldap_modification = -1; /* AttributeTypeAndValues */
304 static int hf_ldap_entry = -1; /* LDAPDN */
305 static int hf_ldap_attributes = -1; /* AttributeList */
306 static int hf_ldap_AttributeList_item = -1; /* AttributeList_item */
307 static int hf_ldap_newrdn = -1; /* RelativeLDAPDN */
308 static int hf_ldap_deleteoldrdn = -1; /* BOOLEAN */
309 static int hf_ldap_newSuperior = -1; /* LDAPDN */
310 static int hf_ldap_ava = -1; /* AttributeValueAssertion */
311 static int hf_ldap_requestName = -1; /* LDAPOID */
312 static int hf_ldap_requestValue = -1; /* T_requestValue */
313 static int hf_ldap_extendedResponse_resultCode = -1; /* ExtendedResponse_resultCode */
314 static int hf_ldap_responseName = -1; /* ResponseName */
315 static int hf_ldap_response = -1; /* OCTET_STRING */
316 static int hf_ldap_intermediateResponse_responseValue = -1; /* T_intermediateResponse_responseValue */
317 static int hf_ldap_size = -1; /* INTEGER */
318 static int hf_ldap_cookie = -1; /* OCTET_STRING */
319 static int hf_ldap_SortKeyList_item = -1; /* SortKeyList_item */
320 static int hf_ldap_attributeType = -1; /* AttributeDescription */
321 static int hf_ldap_orderingRule = -1; /* MatchingRuleId */
322 static int hf_ldap_reverseOrder = -1; /* BOOLEAN */
323 static int hf_ldap_sortResult = -1; /* T_sortResult */
324 static int hf_ldap_flags = -1; /* DirSyncFlags */
325 static int hf_ldap_maxBytes = -1; /* INTEGER */
326 static int hf_ldap_userIdentity = -1; /* OCTET_STRING */
327 static int hf_ldap_oldPasswd = -1; /* OCTET_STRING */
328 static int hf_ldap_newPasswd = -1; /* OCTET_STRING */
329 static int hf_ldap_cancelID = -1; /* MessageID */
330 static int hf_ldap_mode = -1; /* T_mode */
331 static int hf_ldap_reloadHint = -1; /* BOOLEAN */
332 static int hf_ldap_state = -1; /* T_state */
333 static int hf_ldap_entryUUID = -1; /* SyncUUID */
334 static int hf_ldap_refreshDeletes = -1; /* BOOLEAN */
335 static int hf_ldap_newcookie = -1; /* OCTET_STRING */
336 static int hf_ldap_refreshDelete = -1; /* T_refreshDelete */
337 static int hf_ldap_refreshDone = -1; /* BOOLEAN */
338 static int hf_ldap_refreshPresent = -1; /* T_refreshPresent */
339 static int hf_ldap_syncIdSet = -1; /* T_syncIdSet */
340 static int hf_ldap_syncUUIDs = -1; /* SET_OF_SyncUUID */
341 static int hf_ldap_syncUUIDs_item = -1; /* SyncUUID */
342 static int hf_ldap_warning = -1; /* T_warning */
343 static int hf_ldap_timeBeforeExpiration = -1; /* INTEGER_0_maxInt */
344 static int hf_ldap_graceAuthNsRemaining = -1; /* INTEGER_0_maxInt */
345 static int hf_ldap_error = -1; /* T_error */
347 /*--- End of included file: packet-ldap-hf.c ---*/
348 #line 195 "./asn1/ldap/packet-ldap-template.c"
350 /* Initialize the subtree pointers */
351 static gint ett_ldap = -1;
352 static gint ett_ldap_msg = -1;
353 static gint ett_ldap_sasl_blob = -1;
354 static gint ett_ldap_payload = -1;
355 static gint ett_mscldap_netlogon_flags = -1;
356 static gint ett_mscldap_ntver_flags = -1;
357 static gint ett_mscldap_ipdetails = -1;
358 static gint ett_ldap_DirSyncFlagsSubEntry = -1;
361 /*--- Included file: packet-ldap-ett.c ---*/
362 #line 1 "./asn1/ldap/packet-ldap-ett.c"
363 static gint ett_ldap_LDAPMessage = -1;
364 static gint ett_ldap_ProtocolOp = -1;
365 static gint ett_ldap_AttributeDescriptionList = -1;
366 static gint ett_ldap_AttributeValueAssertion = -1;
367 static gint ett_ldap_Attribute = -1;
368 static gint ett_ldap_SET_OF_AttributeValue = -1;
369 static gint ett_ldap_LDAPResult = -1;
370 static gint ett_ldap_Referral = -1;
371 static gint ett_ldap_Controls = -1;
372 static gint ett_ldap_Control = -1;
373 static gint ett_ldap_BindRequest_U = -1;
374 static gint ett_ldap_AuthenticationChoice = -1;
375 static gint ett_ldap_SaslCredentials = -1;
376 static gint ett_ldap_BindResponse_U = -1;
377 static gint ett_ldap_SearchRequest_U = -1;
378 static gint ett_ldap_Filter = -1;
379 static gint ett_ldap_T_and = -1;
380 static gint ett_ldap_T_or = -1;
381 static gint ett_ldap_SubstringFilter = -1;
382 static gint ett_ldap_T_substringFilter_substrings = -1;
383 static gint ett_ldap_T_substringFilter_substrings_item = -1;
384 static gint ett_ldap_MatchingRuleAssertion = -1;
385 static gint ett_ldap_SearchResultEntry_U = -1;
386 static gint ett_ldap_PartialAttributeList = -1;
387 static gint ett_ldap_PartialAttributeList_item = -1;
388 static gint ett_ldap_SEQUENCE_OF_LDAPURL = -1;
389 static gint ett_ldap_ModifyRequest_U = -1;
390 static gint ett_ldap_ModifyRequest_modification = -1;
391 static gint ett_ldap_T_modifyRequest_modification_item = -1;
392 static gint ett_ldap_AttributeTypeAndValues = -1;
393 static gint ett_ldap_AddRequest_U = -1;
394 static gint ett_ldap_AttributeList = -1;
395 static gint ett_ldap_AttributeList_item = -1;
396 static gint ett_ldap_ModifyDNRequest_U = -1;
397 static gint ett_ldap_CompareRequest_U = -1;
398 static gint ett_ldap_ExtendedRequest_U = -1;
399 static gint ett_ldap_ExtendedResponse_U = -1;
400 static gint ett_ldap_IntermediateResponse_U = -1;
401 static gint ett_ldap_SearchControlValue = -1;
402 static gint ett_ldap_SortKeyList = -1;
403 static gint ett_ldap_SortKeyList_item = -1;
404 static gint ett_ldap_SortResult = -1;
405 static gint ett_ldap_DirSyncControlValue = -1;
406 static gint ett_ldap_PasswdModifyRequestValue = -1;
407 static gint ett_ldap_CancelRequestValue = -1;
408 static gint ett_ldap_SyncRequestValue = -1;
409 static gint ett_ldap_SyncStateValue = -1;
410 static gint ett_ldap_SyncDoneValue = -1;
411 static gint ett_ldap_SyncInfoValue = -1;
412 static gint ett_ldap_T_refreshDelete = -1;
413 static gint ett_ldap_T_refreshPresent = -1;
414 static gint ett_ldap_T_syncIdSet = -1;
415 static gint ett_ldap_SET_OF_SyncUUID = -1;
416 static gint ett_ldap_PasswordPolicyResponseValue = -1;
417 static gint ett_ldap_T_warning = -1;
419 /*--- End of included file: packet-ldap-ett.c ---*/
420 #line 207 "./asn1/ldap/packet-ldap-template.c"
422 static expert_field ei_ldap_exceeded_filter_length = EI_INIT;
423 static expert_field ei_ldap_too_many_filter_elements = EI_INIT;
425 static dissector_table_t ldap_name_dissector_table=NULL;
426 static const char *object_identifier_id = NULL; /* LDAP OID */
428 static gboolean do_protocolop = FALSE;
429 static gchar *attr_type = NULL;
430 static gboolean is_binary_attr_type = FALSE;
431 static gboolean ldap_found_in_frame = FALSE;
433 #define TCP_PORT_RANGE_LDAP "389,3268" /* 3268 is Windows 2000 Global Catalog */
434 #define TCP_PORT_LDAPS 636
435 #define UDP_PORT_CLDAP 389
437 /* desegmentation of LDAP */
438 static gboolean ldap_desegment = TRUE;
439 static guint global_ldaps_tcp_port = TCP_PORT_LDAPS;
440 static guint ssl_port = 0;
442 static dissector_handle_t gssapi_handle;
443 static dissector_handle_t gssapi_wrap_handle;
444 static dissector_handle_t ntlmssp_handle;
445 static dissector_handle_t spnego_handle;
446 static dissector_handle_t ssl_handle;
447 static dissector_handle_t ldap_handle ;
449 static void prefs_register_ldap(void); /* forward declaration for use in preferences registration */
452 /* different types of rpc calls ontop of ms cldap */
453 #define MSCLDAP_RPC_NETLOGON 1
455 /* Message type Choice values */
456 static const value_string ldap_ProtocolOp_choice_vals[] = {
457 { 0, "bindRequest" },
458 { 1, "bindResponse" },
459 { 2, "unbindRequest" },
460 { 3, "searchRequest" },
461 { 4, "searchResEntry" },
462 { 5, "searchResDone" },
463 { 6, "searchResRef" },
464 { 7, "modifyRequest" },
465 { 8, "modifyResponse" },
467 { 10, "addResponse" },
468 { 11, "delRequest" },
469 { 12, "delResponse" },
470 { 13, "modDNRequest" },
471 { 14, "modDNResponse" },
472 { 15, "compareRequest" },
473 { 16, "compareResponse" },
474 { 17, "abandonRequest" },
475 { 18, "extendedReq" },
476 { 19, "extendedResp" },
477 { 20, "intermediateResponse" },
481 /* Procedure names (used in Service Response Time */
482 const value_string ldap_procedure_names[] = {
494 #define LOGON_PRIMARY_QUERY 7
495 #define LOGON_PRIMARY_RESPONSE 12
496 #define LOGON_SAM_LOGON_REQUEST 18
497 #define LOGON_SAM_LOGON_RESPONSE 19
498 #define LOGON_SAM_PAUSE_RESPONSE 20
499 #define LOGON_SAM_USER_UNKNOWN 21
500 #define LOGON_SAM_LOGON_RESPONSE_EX 23
501 #define LOGON_SAM_PAUSE_RESPONSE_EX 24
502 #define LOGON_SAM_USER_UNKNOWN_EX 25
504 static const value_string netlogon_opcode_vals[] = {
505 { LOGON_PRIMARY_QUERY, "LOGON_PRIMARY_QUERY" },
506 { LOGON_PRIMARY_RESPONSE, "LOGON_PRIMARY_RESPONSE" },
507 { LOGON_SAM_LOGON_REQUEST, "LOGON_SAM_LOGON_REQUEST" },
508 { LOGON_SAM_LOGON_RESPONSE, "LOGON_SAM_LOGON_RESPONSE" },
509 { LOGON_SAM_PAUSE_RESPONSE, "LOGON_SAM_PAUSE_RESPONSE" },
510 { LOGON_SAM_LOGON_RESPONSE_EX, "LOGON_SAM_LOGON_RESPONSE_EX" },
511 { LOGON_SAM_PAUSE_RESPONSE_EX, "LOGON_SAM_PAUSE_RESPONSE_EX" },
512 { LOGON_SAM_USER_UNKNOWN_EX, "LOGON_SAM_USER_UNKNOWN_EX" },
516 #define LDAP_NUM_PROCEDURES 24
519 ldapstat_init(struct register_srt* srt _U_, GArray* srt_array, srt_gui_init_cb gui_callback, void* gui_data)
521 srt_stat_table *ldap_srt_table;
524 ldap_srt_table = init_srt_table("LDAP Commands", NULL, srt_array, LDAP_NUM_PROCEDURES, NULL, "ldap.protocolOp", gui_callback, gui_data, NULL);
525 for (i = 0; i < LDAP_NUM_PROCEDURES; i++)
527 init_srt_table_row(ldap_srt_table, i, val_to_str_const(i, ldap_procedure_names, "<unknown>"));
532 ldapstat_packet(void *pldap, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi)
535 srt_stat_table *ldap_srt_table;
536 const ldap_call_response_t *ldap=(const ldap_call_response_t *)psi;
537 srt_data_t *data = (srt_data_t *)pldap;
539 /* we are only interested in reply packets */
540 if(ldap->is_request){
543 /* if we havnt seen the request, just ignore it */
544 if(!ldap->req_frame){
548 /* only use the commands we know how to handle */
549 switch(ldap->protocolOpTag){
551 case LDAP_REQ_SEARCH:
552 case LDAP_REQ_MODIFY:
554 case LDAP_REQ_DELETE:
555 case LDAP_REQ_MODRDN:
556 case LDAP_REQ_COMPARE:
557 case LDAP_REQ_EXTENDED:
563 ldap_srt_table = g_array_index(data->srt_array, srt_stat_table*, i);
565 add_srt_table_data(ldap_srt_table, ldap->protocolOpTag, &ldap->req_time, pinfo);
570 * Data structure attached to a conversation, giving authentication
571 * information from a bind request.
573 typedef struct ldap_conv_info_t {
574 guint auth_type; /* authentication type */
575 char *auth_mech; /* authentication mechanism */
576 guint32 first_auth_frame; /* first frame that would use a security layer */
577 wmem_map_t *unmatched;
581 gboolean start_tls_pending;
582 guint32 start_tls_frame;
586 ldap_info_hash_matched(gconstpointer k)
588 const ldap_call_response_t *key = (const ldap_call_response_t *)k;
590 return key->messageId;
594 ldap_info_equal_matched(gconstpointer k1, gconstpointer k2)
596 const ldap_call_response_t *key1 = (const ldap_call_response_t*)k1;
597 const ldap_call_response_t *key2 = (const ldap_call_response_t*)k2;
599 if( key1->req_frame && key2->req_frame && (key1->req_frame!=key2->req_frame) ){
602 /* a response may span multiple frames
603 if( key1->rep_frame && key2->rep_frame && (key1->rep_frame!=key2->rep_frame) ){
608 return key1->messageId==key2->messageId;
612 ldap_info_hash_unmatched(gconstpointer k)
614 const ldap_call_response_t *key = (const ldap_call_response_t*)k;
616 return key->messageId;
620 ldap_info_equal_unmatched(gconstpointer k1, gconstpointer k2)
622 const ldap_call_response_t *key1 = (const ldap_call_response_t*)k1;
623 const ldap_call_response_t *key2 = (const ldap_call_response_t*)k2;
625 return key1->messageId==key2->messageId;
629 /* These are the NtVer flags
630 http://msdn.microsoft.com/en-us/library/cc201035.aspx
633 static const true_false_string tfs_ntver_v1 = {
634 "Client requested version 1 netlogon response",
635 "Version 1 netlogon response not requested"
638 static const true_false_string tfs_ntver_v5 = {
639 "Client requested version 5 netlogon response",
640 "Version 5 netlogon response not requested"
642 static const true_false_string tfs_ntver_v5ex = {
643 "Client requested version 5 extended netlogon response",
644 "Version 5 extended response not requested"
646 static const true_false_string tfs_ntver_v5ep = {
647 "Client has requested IP address of the server",
648 "IP address of server not requested"
650 static const true_false_string tfs_ntver_vcs = {
651 "Client has asked for the closest site information",
652 "Closest site information not requested"
654 static const true_false_string tfs_ntver_vnt4 = {
655 "Client is requesting server to avoid NT4 emulation",
656 "Only full AD DS requested"
658 static const true_false_string tfs_ntver_vpdc = {
659 "Client has requested the Primary Domain Controller",
660 "Primary Domain Controller not requested"
662 static const true_false_string tfs_ntver_vip = {
663 "Client has requested IP details (obsolete)",
664 "IP details not requested (obsolete)"
666 static const true_false_string tfs_ntver_vl = {
667 "Client indicated that it is the local machine",
668 "Client is not the local machine"
669 };static const true_false_string tfs_ntver_vgc = {
670 "Client has requested a Global Catalog server",
671 "Global Catalog not requested"
674 /* Stuff for generation/handling of fields for custom AttributeValues */
675 typedef struct _attribute_type_t {
676 gchar* attribute_type;
677 gchar* attribute_desc;
680 static attribute_type_t* attribute_types = NULL;
681 static guint num_attribute_types = 0;
683 static GHashTable* attribute_types_hash = NULL;
686 attribute_types_update_cb(void *r, char **err)
688 attribute_type_t *rec = (attribute_type_t *)r;
691 if (rec->attribute_type == NULL) {
692 *err = g_strdup("Attribute type can't be empty");
696 g_strstrip(rec->attribute_type);
697 if (rec->attribute_type[0] == 0) {
698 *err = g_strdup("Attribute type can't be empty");
702 /* Check for invalid characters (to avoid asserting out when
703 * registering the field).
705 c = proto_check_field_name(rec->attribute_type);
707 *err = g_strdup_printf("Attribute type can't contain '%c'", c);
716 attribute_types_copy_cb(void* n, const void* o, size_t siz _U_)
718 attribute_type_t* new_rec = (attribute_type_t*)n;
719 const attribute_type_t* old_rec = (const attribute_type_t*)o;
721 new_rec->attribute_type = g_strdup(old_rec->attribute_type);
722 new_rec->attribute_desc = g_strdup(old_rec->attribute_desc);
728 attribute_types_free_cb(void*r)
730 attribute_type_t* rec = (attribute_type_t*)r;
732 if (rec->attribute_type) g_free(rec->attribute_type);
733 if (rec->attribute_desc) g_free(rec->attribute_desc);
736 UAT_CSTRING_CB_DEF(attribute_types, attribute_type, attribute_type_t)
737 UAT_CSTRING_CB_DEF(attribute_types, attribute_desc, attribute_type_t)
743 get_hf_for_header(char* attribute_type)
747 if (attribute_types_hash) {
748 hf_id = (gint*) g_hash_table_lookup(attribute_types_hash, attribute_type);
760 attribute_types_initialize_cb(void)
762 static hf_register_info* hf;
765 gchar* attribute_type;
767 if (attribute_types_hash && hf) {
768 guint hf_size = g_hash_table_size (attribute_types_hash);
769 /* Deregister all fields */
770 for (i = 0; i < hf_size; i++) {
771 proto_deregister_field (proto_ldap, *(hf[i].p_id));
774 g_hash_table_destroy (attribute_types_hash);
775 proto_add_deregistered_data (hf);
776 attribute_types_hash = NULL;
779 if (num_attribute_types) {
780 attribute_types_hash = g_hash_table_new(g_str_hash, g_str_equal);
781 hf = g_new0(hf_register_info,num_attribute_types);
783 for (i = 0; i < num_attribute_types; i++) {
784 hf_id = g_new(gint,1);
786 attribute_type = g_strdup(attribute_types[i].attribute_type);
789 hf[i].hfinfo.name = attribute_type;
790 hf[i].hfinfo.abbrev = g_strdup_printf("ldap.AttributeValue.%s", attribute_type);
791 hf[i].hfinfo.type = FT_STRING;
792 hf[i].hfinfo.display = BASE_NONE;
793 hf[i].hfinfo.strings = NULL;
794 hf[i].hfinfo.bitmask = 0;
795 hf[i].hfinfo.blurb = g_strdup(attribute_types[i].attribute_desc);
798 g_hash_table_insert(attribute_types_hash, attribute_type, hf_id);
801 proto_register_field_array(proto_ldap, hf, num_attribute_types);
805 /* MS-ADTS specification, section 7.3.1.1, NETLOGON_NT_VERSION Options Bits */
806 static int dissect_mscldap_ntver_flags(proto_tree *parent_tree, tvbuff_t *tvb, int offset)
808 static const int * flags[] = {
809 &hf_mscldap_ntver_flags_v1,
810 &hf_mscldap_ntver_flags_v5,
811 &hf_mscldap_ntver_flags_v5ex,
812 &hf_mscldap_ntver_flags_v5ep,
813 &hf_mscldap_ntver_flags_vcs,
814 &hf_mscldap_ntver_flags_vnt4,
815 &hf_mscldap_ntver_flags_vpdc,
816 &hf_mscldap_ntver_flags_vip,
817 &hf_mscldap_ntver_flags_vl,
818 &hf_mscldap_ntver_flags_vgc,
822 proto_tree_add_bitmask_with_flags(parent_tree, tvb, offset, hf_mscldap_ntver_flags,
823 ett_mscldap_ntver_flags, flags, ENC_LITTLE_ENDIAN, BMT_NO_FALSE);
829 /* This string contains the last LDAPString that was decoded */
830 static const char *attributedesc_string=NULL;
832 /* This string contains the last AssertionValue that was decoded */
833 static char *ldapvalue_string=NULL;
835 /* if the octet string contain all printable ASCII characters, then
836 * display it as a string, othervise just display it in hex.
839 dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index)
842 gboolean pc, ind, is_ascii;
848 offset=get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
849 offset=get_ber_length(tvb, offset, &len, &ind);
851 len=tvb_reported_length_remaining(tvb,offset);
860 * Some special/wellknown attributes in common LDAP (read AD)
861 * are neither ascii strings nor blobs of hex data.
862 * Special case these attributes and decode them more nicely.
864 * Add more special cases as required to prettify further
865 * (there can't be that many ones that are truly interesting)
867 if(attributedesc_string && !strncmp("DomainSid", attributedesc_string, 9)){
871 /* this octet string contains an NT SID */
872 sid_tvb=tvb_new_subset_length(tvb, offset, len);
873 dissect_nt_sid(sid_tvb, 0, tree, "SID", &tmpstr, hf_index);
874 ldapvalue_string=tmpstr;
877 } else if ( (len==16) /* GUIDs are always 16 bytes */
878 && (attributedesc_string && !strncmp("DomainGuid", attributedesc_string, 10))) {
879 guint8 drep[4] = { 0x10, 0x00, 0x00, 0x00}; /* fake DREP struct */
882 /* This octet string contained a GUID */
883 dissect_dcerpc_uuid_t(tvb, offset, actx->pinfo, tree, drep, hf_ldap_guid, &uuid);
885 ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 1024);
886 g_snprintf(ldapvalue_string, 1023, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
887 uuid.data1, uuid.data2, uuid.data3, uuid.data4[0], uuid.data4[1],
888 uuid.data4[2], uuid.data4[3], uuid.data4[4], uuid.data4[5],
889 uuid.data4[6], uuid.data4[7]);
892 } else if (attributedesc_string && !strncmp("NtVer", attributedesc_string, 5)){
896 /* get flag value to populate ldapvalue_string */
897 flags=tvb_get_letohl(tvb, offset);
899 ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 1024);
900 g_snprintf(ldapvalue_string, 1023, "0x%08x",flags);
902 /* populate bitmask subtree */
903 offset = dissect_mscldap_ntver_flags(tree, tvb, offset);
911 * It was not one of our "wellknown" attributes so make the best
912 * we can and just try to see if it is an ascii string or if it
915 * XXX - should we support reading RFC 2252-style schemas
916 * for LDAP, and using that to determine how to display
917 * attribute values and assertion values?
919 * -- I don't think there are full schemas available that describe the
920 * interesting cases i.e. AD -- ronnie
922 str=tvb_get_ptr(tvb, offset, len);
925 if(!g_ascii_isprint(str[i])){
931 /* convert the string into a printable string */
933 ldapvalue_string=wmem_strndup(wmem_packet_scope(), str, len);
935 ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 3*len);
937 g_snprintf(ldapvalue_string+i*3,3,"%02x",str[i]&0xff);
938 ldapvalue_string[3*i+2]=':';
940 ldapvalue_string[3*len-1]=0;
943 proto_tree_add_string(tree, hf_index, tvb, offset, len, ldapvalue_string);
951 /* This string contains the last Filter item that was decoded */
952 static const char *Filter_string=NULL;
953 static const char *and_filter_string=NULL;
954 static const char *or_filter_string=NULL;
955 static const char *substring_value=NULL;
956 static const char *substring_item_init=NULL;
957 static const char *substring_item_any=NULL;
958 static const char *substring_item_final=NULL;
959 static const char *matching_rule_string=NULL;
960 static gboolean matching_rule_dnattr=FALSE;
962 #define MAX_FILTER_LEN 4096
963 static gint Filter_length;
965 #define MAX_FILTER_ELEMENTS 200
966 static gint Filter_elements;
968 /* Global variables */
969 static gint MessageID =-1;
970 static gint ProtocolOp = -1;
971 static gint result = 0;
972 static proto_item *ldm_tree = NULL; /* item to add text to */
974 static void ldap_do_protocolop(packet_info *pinfo)
980 valstr = val_to_str(ProtocolOp, ldap_ProtocolOp_choice_vals, "Unknown (%%u)");
982 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", valstr, MessageID);
985 proto_item_append_text(ldm_tree, " %s(%d)", valstr, MessageID);
987 do_protocolop = FALSE;
992 static ldap_call_response_t *
993 ldap_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint messageId, guint protocolOpTag, ldap_conv_info_t *ldap_info)
995 ldap_call_response_t lcr, *lcrp=NULL;
997 /* first see if we have already matched this */
999 lcr.messageId=messageId;
1000 switch(protocolOpTag){
1002 case LDAP_REQ_SEARCH:
1003 case LDAP_REQ_MODIFY:
1005 case LDAP_REQ_DELETE:
1006 case LDAP_REQ_MODRDN:
1007 case LDAP_REQ_COMPARE:
1008 case LDAP_REQ_EXTENDED:
1009 lcr.is_request=TRUE;
1010 lcr.req_frame=pinfo->num;
1014 case LDAP_RES_SEARCH_ENTRY:
1015 case LDAP_RES_SEARCH_REF:
1016 case LDAP_RES_SEARCH_RESULT:
1017 case LDAP_RES_MODIFY:
1019 case LDAP_RES_DELETE:
1020 case LDAP_RES_MODRDN:
1021 case LDAP_RES_COMPARE:
1022 case LDAP_RES_EXTENDED:
1023 case LDAP_RES_INTERMEDIATE:
1024 lcr.is_request=FALSE;
1026 lcr.rep_frame=pinfo->num;
1031 lcrp=(ldap_call_response_t *)wmem_map_lookup(ldap_info->matched, &lcr);
1035 lcrp->is_request=lcr.is_request;
1039 /* we haven't found a match - try and match it up */
1041 switch(protocolOpTag){
1043 case LDAP_REQ_SEARCH:
1044 case LDAP_REQ_MODIFY:
1046 case LDAP_REQ_DELETE:
1047 case LDAP_REQ_MODRDN:
1048 case LDAP_REQ_COMPARE:
1049 case LDAP_REQ_EXTENDED:
1051 /* this a a request - add it to the unmatched list */
1053 /* check that we don't already have one of those in the
1054 unmatched list and if so remove it */
1056 lcr.messageId=messageId;
1057 lcrp=(ldap_call_response_t *)wmem_map_lookup(ldap_info->unmatched, &lcr);
1059 wmem_map_remove(ldap_info->unmatched, lcrp);
1061 /* if we can't reuse the old one, grab a new chunk */
1063 lcrp=wmem_new0(wmem_file_scope(), ldap_call_response_t);
1065 lcrp->messageId=messageId;
1066 lcrp->req_frame=pinfo->num;
1067 lcrp->req_time=pinfo->abs_ts;
1069 lcrp->protocolOpTag=protocolOpTag;
1070 lcrp->is_request=TRUE;
1071 wmem_map_insert(ldap_info->unmatched, lcrp, lcrp);
1075 case LDAP_RES_SEARCH_ENTRY:
1076 case LDAP_RES_SEARCH_REF:
1077 case LDAP_RES_SEARCH_RESULT:
1078 case LDAP_RES_MODIFY:
1080 case LDAP_RES_DELETE:
1081 case LDAP_RES_MODRDN:
1082 case LDAP_RES_COMPARE:
1083 case LDAP_RES_EXTENDED:
1084 case LDAP_RES_INTERMEDIATE:
1086 /* this is a result - it should be in our unmatched list */
1088 lcr.messageId=messageId;
1089 lcrp=(ldap_call_response_t *)wmem_map_lookup(ldap_info->unmatched, &lcr);
1093 if(!lcrp->rep_frame){
1094 wmem_map_remove(ldap_info->unmatched, lcrp);
1095 lcrp->rep_frame=pinfo->num;
1096 lcrp->is_request=FALSE;
1097 wmem_map_insert(ldap_info->matched, lcrp, lcrp);
1105 /* we have found a match */
1110 if(lcrp->is_request){
1111 it=proto_tree_add_uint(tree, hf_ldap_response_in, tvb, 0, 0, lcrp->rep_frame);
1112 PROTO_ITEM_SET_GENERATED(it);
1115 it=proto_tree_add_uint(tree, hf_ldap_response_to, tvb, 0, 0, lcrp->req_frame);
1116 PROTO_ITEM_SET_GENERATED(it);
1117 nstime_delta(&ns, &pinfo->abs_ts, &lcrp->req_time);
1118 it=proto_tree_add_time(tree, hf_ldap_time, tvb, 0, 0, &ns);
1119 PROTO_ITEM_SET_GENERATED(it);
1127 /*--- Included file: packet-ldap-fn.c ---*/
1128 #line 1 "./asn1/ldap/packet-ldap-fn.c"
1129 /*--- Cyclic dependencies ---*/
1131 /* Filter -> Filter/and -> Filter/and/_item -> Filter */
1132 /* Filter -> Filter/or -> Filter/or/_item -> Filter */
1133 /* Filter -> Filter/not -> Filter */
1134 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_);
1140 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_) {
1141 #line 91 "./asn1/ldap/ldap.cnf"
1143 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1157 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_) {
1158 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1167 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_) {
1168 #line 301 "./asn1/ldap/ldap.cnf"
1169 tvbuff_t *parameter_tvb = NULL;
1170 const char *ldapstring = NULL;
1171 gchar *sc = NULL; /* semi-colon pointer */
1173 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1177 if (parameter_tvb || (hf_index == hf_ldap_baseObject)) {
1179 ldap_do_protocolop(actx->pinfo);
1182 ldapstring = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, tvb_reported_length_remaining(parameter_tvb, 0), ENC_UTF_8|ENC_NA);
1184 if(hf_index == hf_ldap_baseObject) {
1185 /* this is search - put it on the scanline */
1186 if(!ldapstring || !*ldapstring)
1187 ldapstring = "<ROOT>";
1189 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "\"%s\" ", ldapstring);
1192 proto_item_append_text(ldm_tree, " \"%s\"", ldapstring);
1195 if(!parameter_tvb) {
1197 proto_item_append_text(actx->created_item, " (%s)", ldapstring);
1200 } else if ((hf_index == hf_ldap_errorMessage) && ldapstring && *ldapstring) { /* only show message if not success */
1201 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "(%s) ", ldapstring);
1204 proto_item_append_text(ldm_tree, " (%s)", ldapstring);
1206 } else if ((hf_index == hf_ldap_objectName) ||
1207 (hf_index == hf_ldap_name) ||
1208 (hf_index == hf_ldap_entry) ||
1209 (hf_index == hf_ldap_object) ||
1210 (hf_index == hf_ldap_delRequest) ) {
1212 if(!ldapstring || !*ldapstring)
1213 ldapstring = "<ROOT>";
1215 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "\"%s\" ", ldapstring);
1218 proto_item_append_text(ldm_tree, " \"%s\"", ldapstring);
1219 } else if (hf_index == hf_ldap_attributeDesc){
1220 /* remember the attribute description */
1221 attributedesc_string=ldapstring;
1222 } else if (hf_index == hf_ldap_initial){
1223 /* remember the substring item */
1224 substring_item_init=ldapstring;
1225 } else if (hf_index == hf_ldap_any){
1226 /* remember the substring item */
1227 substring_item_any=ldapstring;
1228 } else if (hf_index == hf_ldap_final){
1229 /* remember the substring item */
1230 substring_item_final=ldapstring;
1231 } else if (hf_index == hf_ldap_matchingRule){
1232 /* remember the matching rule */
1233 matching_rule_string=ldapstring;
1234 } else if (hf_index == hf_ldap_present){
1235 /* remember the present name */
1236 Filter_string=ldapstring;
1237 } else if (hf_index == hf_ldap_type) {
1238 /* remember attribute type name */
1239 attr_type = wmem_strdup(wmem_packet_scope(), ldapstring);
1241 /* append it to the parent entry */
1242 proto_item_append_text(tree, " %s", attr_type);
1244 /* remove the ";binary" component if present */
1245 if((sc = strchr(attr_type, ';')) != NULL) {
1246 if(!strcmp(sc, ";binary")) {
1247 *sc = '\0'; /* terminate the string */
1248 is_binary_attr_type = TRUE;
1251 is_binary_attr_type = FALSE;
1266 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_) {
1267 offset = dissect_ldap_LDAPString(implicit_tag, tvb, offset, actx, tree, hf_index);
1275 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_) {
1276 #line 148 "./asn1/ldap/ldap.cnf"
1277 ldap_conv_info_t *ldap_info;
1279 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1283 ldap_info = (ldap_conv_info_t *)actx->private_data;
1284 ldap_info->auth_type = LDAP_AUTH_SIMPLE;
1294 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_) {
1295 #line 156 "./asn1/ldap/ldap.cnf"
1297 ldap_conv_info_t *ldap_info;
1298 tvbuff_t *parameter_tvb;
1299 char *mechanism = NULL;
1300 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1303 ldap_info = (ldap_conv_info_t *)actx->private_data;
1304 ldap_info->auth_type = LDAP_AUTH_SASL;
1310 * We need to remember the authentication type and mechanism for this
1313 * XXX - actually, we might need to remember more than one
1314 * type and mechanism, if you can unbind and rebind with a
1315 * different type and/or mechanism.
1317 if(!actx->pinfo->fd->flags.visited) {
1318 mechanism = tvb_get_string_enc(wmem_file_scope(), parameter_tvb, 0, tvb_reported_length_remaining(parameter_tvb,0), ENC_UTF_8|ENC_NA);
1319 ldap_info->first_auth_frame = 0; /* not known until we see the bind reply */
1321 * If the mechanism in this request is an empty string (which is
1322 * returned as a null pointer), use the saved mechanism instead.
1323 * Otherwise, if the saved mechanism is an empty string (null),
1324 * save this mechanism.
1326 if (mechanism != NULL) {
1327 wmem_free(wmem_file_scope(), ldap_info->auth_mech);
1328 ldap_info->auth_mech = mechanism;
1339 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_) {
1340 #line 190 "./asn1/ldap/ldap.cnf"
1342 tvbuff_t *parameter_tvb;
1343 ldap_conv_info_t *ldap_info;
1348 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1355 ldap_info = (ldap_conv_info_t *)actx->private_data;
1356 get_ber_identifier(parameter_tvb, 0, &ber_class, &pc, &tag);
1358 /*if ((ldap_info->auth_mech != NULL) && (strcmp(ldap_info->auth_mech, "GSS-SPNEGO") == 0) && (ber_class==BER_CLASS_CON)) {*/
1359 if ((ldap_info->auth_mech != NULL) && (ber_class==BER_CLASS_CON)) {
1361 * This is a GSS-API token ancapsulated within GSS-SPNEGO.
1362 * We need to check the first byte to check whether the blob
1363 * contains SPNEGO or GSSAPI.
1364 * All SPNEGO PDUs are of class CONSTRUCTED while
1365 * GSS PDUs are class APPLICATION
1367 if (parameter_tvb && (tvb_reported_length(parameter_tvb) > 0))
1368 call_dissector(spnego_handle, parameter_tvb, actx->pinfo, tree);
1370 /*if ((ldap_info->auth_mech != NULL) && ((strcmp(ldap_info->auth_mech, "GSSAPI") == 0) || (ber_class==BER_CLASS_APP))) {*/
1371 if ((ldap_info->auth_mech != NULL) && (ber_class==BER_CLASS_APP)) {
1373 * This is a raw GSS-API token.
1375 if (parameter_tvb && (tvb_reported_length(parameter_tvb) > 0)) {
1376 call_dissector(gssapi_handle, parameter_tvb, actx->pinfo, tree);
1379 /* Restore private data */
1380 actx->private_data = ldap_info;
1389 static const ber_sequence_t SaslCredentials_sequence[] = {
1390 { &hf_ldap_mechanism , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_Mechanism },
1391 { &hf_ldap_credentials , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_Credentials },
1392 { NULL, 0, 0, 0, NULL }
1396 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_) {
1397 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1398 SaslCredentials_sequence, hf_index, ett_ldap_SaslCredentials);
1406 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_) {
1407 #line 690 "./asn1/ldap/ldap.cnf"
1408 /* make sure the protocol op comes first */
1409 ldap_do_protocolop(actx->pinfo);
1411 call_dissector(ntlmssp_handle, tvb, actx->pinfo, tree);
1412 offset+=tvb_reported_length_remaining(tvb, offset);
1422 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_) {
1423 #line 697 "./asn1/ldap/ldap.cnf"
1424 /* make sure the protocol op comes first */
1425 ldap_do_protocolop(actx->pinfo);
1427 call_dissector(ntlmssp_handle, tvb, actx->pinfo, tree);
1428 offset+=tvb_reported_length_remaining(tvb, offset);
1436 static const value_string ldap_AuthenticationChoice_vals[] = {
1439 { 10, "ntlmsspNegotiate" },
1440 { 11, "ntlmsspAuth" },
1444 static const ber_choice_t AuthenticationChoice_choice[] = {
1445 { 0, &hf_ldap_simple , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ldap_Simple },
1446 { 3, &hf_ldap_sasl , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_ldap_SaslCredentials },
1447 { 10, &hf_ldap_ntlmsspNegotiate, BER_CLASS_CON, 10, BER_FLAGS_IMPLTAG, dissect_ldap_T_ntlmsspNegotiate },
1448 { 11, &hf_ldap_ntlmsspAuth , BER_CLASS_CON, 11, BER_FLAGS_IMPLTAG, dissect_ldap_T_ntlmsspAuth },
1449 { 0, NULL, 0, 0, 0, NULL }
1453 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_) {
1454 #line 487 "./asn1/ldap/ldap.cnf"
1457 const gchar *valstr;
1459 offset = dissect_ber_choice(actx, tree, tvb, offset,
1460 AuthenticationChoice_choice, hf_index, ett_ldap_AuthenticationChoice,
1464 ldap_do_protocolop(actx->pinfo);
1466 if((branch > -1) && (branch < (gint)(sizeof AuthenticationChoice_choice/sizeof AuthenticationChoice_choice[0])))
1467 auth = AuthenticationChoice_choice[branch].value;
1469 valstr = val_to_str(auth, ldap_AuthenticationChoice_vals, "Unknown auth(%u)");
1471 /* If auth is NTLM (10 or 11) don't add to column as the NTLM dissection will do this */
1472 if ((auth != 10) && (auth != 11))
1473 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", valstr);
1476 proto_item_append_text(ldm_tree, " %s", valstr);
1485 static const ber_sequence_t BindRequest_U_sequence[] = {
1486 { &hf_ldap_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_INTEGER_1_127 },
1487 { &hf_ldap_name , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
1488 { &hf_ldap_authentication , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ldap_AuthenticationChoice },
1489 { NULL, 0, 0, 0, NULL }
1493 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_) {
1494 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1495 BindRequest_U_sequence, hf_index, ett_ldap_BindRequest_U);
1503 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_) {
1504 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1505 hf_index, BER_CLASS_APP, 0, TRUE, dissect_ldap_BindRequest_U);
1511 static const value_string ldap_BindResponse_resultCode_vals[] = {
1513 { 1, "operationsError" },
1514 { 2, "protocolError" },
1515 { 3, "timeLimitExceeded" },
1516 { 4, "sizeLimitExceeded" },
1517 { 5, "compareFalse" },
1518 { 6, "compareTrue" },
1519 { 7, "authMethodNotSupported" },
1520 { 8, "strongAuthRequired" },
1522 { 11, "adminLimitExceeded" },
1523 { 12, "unavailableCriticalExtension" },
1524 { 13, "confidentialityRequired" },
1525 { 14, "saslBindInProgress" },
1526 { 16, "noSuchAttribute" },
1527 { 17, "undefinedAttributeType" },
1528 { 18, "inappropriateMatching" },
1529 { 19, "constraintViolation" },
1530 { 20, "attributeOrValueExists" },
1531 { 21, "invalidAttributeSyntax" },
1532 { 32, "noSuchObject" },
1533 { 33, "aliasProblem" },
1534 { 34, "invalidDNSyntax" },
1535 { 36, "aliasDereferencingProblem" },
1536 { 48, "inappropriateAuthentication" },
1537 { 49, "invalidCredentials" },
1538 { 50, "insufficientAccessRights" },
1540 { 52, "unavailable" },
1541 { 53, "unwillingToPerform" },
1542 { 54, "loopDetect" },
1543 { 64, "namingViolation" },
1544 { 65, "objectClassViolation" },
1545 { 66, "notAllowedOnNonLeaf" },
1546 { 67, "notAllowedOnRDN" },
1547 { 68, "entryAlreadyExists" },
1548 { 69, "objectClassModsProhibited" },
1549 { 71, "affectsMultipleDSAs" },
1551 { 118, "canceled" },
1552 { 119, "noSuchOperation" },
1554 { 121, "cannotCancel" },
1560 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_) {
1561 #line 421 "./asn1/ldap/ldap.cnf"
1563 const gchar *valstr;
1565 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1569 ldap_do_protocolop(actx->pinfo);
1571 valstr = val_to_str(result, ldap_BindResponse_resultCode_vals, "Unknown result(%u)");
1573 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", valstr);
1576 proto_item_append_text(ldm_tree, " %s", valstr);
1586 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_) {
1587 #line 704 "./asn1/ldap/ldap.cnf"
1588 tvbuff_t *new_tvb=NULL;
1590 offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_ldap_matchedDN, &new_tvb);
1593 && (tvb_reported_length(new_tvb)>=7)
1594 && (!tvb_memeql(new_tvb, 0, "NTLMSSP", 7))){
1596 /* make sure the protocol op comes first */
1597 ldap_do_protocolop(actx->pinfo);
1599 call_dissector(ntlmssp_handle, new_tvb, actx->pinfo, tree);
1611 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_) {
1612 offset = dissect_ldap_LDAPString(implicit_tag, tvb, offset, actx, tree, hf_index);
1620 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_) {
1621 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1624 #line 54 "./asn1/ldap/ldap.cnf"
1625 PROTO_ITEM_SET_URL(actx->created_item);
1632 static const ber_sequence_t Referral_sequence_of[1] = {
1633 { &hf_ldap_Referral_item , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPURL },
1637 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_) {
1638 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1639 Referral_sequence_of, hf_index, ett_ldap_Referral);
1647 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_) {
1648 #line 231 "./asn1/ldap/ldap.cnf"
1650 tvbuff_t *parameter_tvb = NULL;
1651 ldap_conv_info_t *ldap_info;
1653 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1658 ldap_info = (ldap_conv_info_t *)actx->private_data;
1659 switch (ldap_info->auth_type) {
1661 /* For Kerberos V4, dissect it as a ticket. */
1662 /* XXX - what about LDAP_AUTH_SIMPLE? */
1664 case LDAP_AUTH_SASL:
1666 * All frames after this are assumed to use a security layer.
1668 * XXX - won't work if there's another reply, with the security
1669 * layer, starting in the same TCP segment that ends this
1670 * reply, but as LDAP is a request/response protocol, and
1671 * as the client probably can't start using authentication until
1672 * it gets the bind reply and the server won't send a reply until
1673 * it gets a request, that probably won't happen.
1675 * XXX - that assumption is invalid; it's not clear where the
1676 * hell you find out whether there's any security layer. In
1677 * one capture, we have two GSS-SPNEGO negotiations, both of
1678 * which select MS KRB5, and the only differences in the tokens
1679 * is in the RC4-HMAC ciphertext. The various
1680 * draft-ietf--cat-sasl-gssapi-NN.txt drafts seem to imply
1681 * that the RFC 2222 spoo with the bitmask and maximum
1682 * output message size stuff is done - but where does that
1683 * stuff show up? Is it in the ciphertext, which means it's
1684 * presumably encrypted?
1686 * Grrr. We have to do a gross heuristic, checking whether the
1687 * putative LDAP message begins with 0x00 or not, making the
1688 * assumption that we won't have more than 2^24 bytes of
1689 * encapsulated stuff.
1691 ldap_info->first_auth_frame = actx->pinfo->num + 1;
1692 if (ldap_info->auth_mech != NULL &&
1693 strcmp(ldap_info->auth_mech, "GSS-SPNEGO") == 0) {
1694 /* It could be the second leg of GSS-SPNEGO wrapping NTLMSSP
1695 * which might not be wrapped in GSS-SPNEGO but be a raw
1698 if ( (tvb_reported_length(parameter_tvb)>=7)
1699 && (!tvb_memeql(parameter_tvb, 0, "NTLMSSP", 7))){
1700 call_dissector(ntlmssp_handle, parameter_tvb, actx->pinfo, tree);
1704 * This is a GSS-API token.
1706 if(parameter_tvb && (tvb_reported_length(parameter_tvb) > 0))
1707 call_dissector(spnego_handle, parameter_tvb, actx->pinfo, tree);
1708 } else if (ldap_info->auth_mech != NULL &&
1709 strcmp(ldap_info->auth_mech, "GSSAPI") == 0) {
1711 * This is a GSS-API token.
1713 if(parameter_tvb && (tvb_reported_length(parameter_tvb) > 0))
1714 call_dissector(gssapi_handle, parameter_tvb, actx->pinfo, tree);
1718 actx->private_data = ldap_info;
1726 static const ber_sequence_t BindResponse_U_sequence[] = {
1727 { &hf_ldap_bindResponse_resultCode, BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_BindResponse_resultCode },
1728 { &hf_ldap_bindResponse_matchedDN, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_T_bindResponse_matchedDN },
1729 { &hf_ldap_errorMessage , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_ErrorMessage },
1730 { &hf_ldap_referral , BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_Referral },
1731 { &hf_ldap_serverSaslCreds, BER_CLASS_CON, 7, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_ServerSaslCreds },
1732 { NULL, 0, 0, 0, NULL }
1736 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_) {
1737 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1738 BindResponse_U_sequence, hf_index, ett_ldap_BindResponse_U);
1746 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_) {
1747 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1748 hf_index, BER_CLASS_APP, 1, TRUE, dissect_ldap_BindResponse_U);
1756 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_) {
1757 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
1765 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_) {
1766 #line 509 "./asn1/ldap/ldap.cnf"
1768 implicit_tag = TRUE; /* correct problem with asn2wrs */
1770 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
1771 hf_index, BER_CLASS_APP, 2, TRUE, dissect_ldap_NULL);
1774 ldap_do_protocolop(actx->pinfo);
1786 static const value_string ldap_T_scope_vals[] = {
1787 { 0, "baseObject" },
1788 { 1, "singleLevel" },
1789 { 2, "wholeSubtree" },
1795 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_) {
1796 #line 389 "./asn1/ldap/ldap.cnf"
1798 guint32 scope = 0xffff;
1799 const gchar *valstr;
1801 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1805 ldap_do_protocolop(actx->pinfo);
1807 valstr = val_to_str(scope, ldap_T_scope_vals, "Unknown scope(%u)");
1809 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", valstr);
1812 proto_item_append_text(ldm_tree, " %s", valstr);
1820 static const value_string ldap_T_derefAliases_vals[] = {
1821 { 0, "neverDerefAliases" },
1822 { 1, "derefInSearching" },
1823 { 2, "derefFindingBaseObj" },
1824 { 3, "derefAlways" },
1830 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_) {
1831 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1840 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_) {
1841 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1850 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_) {
1851 offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
1859 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_) {
1860 offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index);
1862 #line 555 "./asn1/ldap/ldap.cnf"
1863 if(and_filter_string){
1864 and_filter_string=wmem_strdup_printf(wmem_packet_scope(), "(&%s%s)",and_filter_string,Filter_string);
1866 and_filter_string=Filter_string;
1874 static const ber_sequence_t T_and_set_of[1] = {
1875 { &hf_ldap_and_item , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ldap_T_and_item },
1879 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_) {
1880 #line 562 "./asn1/ldap/ldap.cnf"
1881 proto_tree *tr=NULL;
1882 proto_item *it=NULL;
1883 const char *old_and_filter_string=and_filter_string;
1885 and_filter_string=NULL;
1887 tr=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ldap_T_and, &it, "and: ");
1890 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
1891 T_and_set_of, hf_index, ett_ldap_T_and);
1894 if(and_filter_string) {
1895 proto_item_append_text(it, "%s", and_filter_string);
1896 Filter_string=wmem_strdup(wmem_packet_scope(), and_filter_string);
1898 and_filter_string=old_and_filter_string;
1908 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_) {
1909 offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index);
1911 #line 580 "./asn1/ldap/ldap.cnf"
1912 if(or_filter_string){
1913 or_filter_string=wmem_strdup_printf(wmem_packet_scope(), "(|%s%s)",or_filter_string,Filter_string);
1915 or_filter_string=Filter_string;
1924 static const ber_sequence_t T_or_set_of[1] = {
1925 { &hf_ldap_or_item , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ldap_T_or_item },
1929 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_) {
1930 #line 588 "./asn1/ldap/ldap.cnf"
1933 const char *old_or_filter_string=or_filter_string;
1935 or_filter_string=NULL;
1936 tr=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ldap_T_or, &it, "or: ");
1939 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
1940 T_or_set_of, hf_index, ett_ldap_T_or);
1942 if(or_filter_string) {
1943 proto_item_append_text(it, "%s", or_filter_string);
1944 Filter_string=wmem_strdup(wmem_packet_scope(), or_filter_string);
1946 or_filter_string=old_or_filter_string;
1956 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_) {
1957 offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index);
1959 #line 607 "./asn1/ldap/ldap.cnf"
1960 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(!%s)",string_or_null(Filter_string));
1969 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_) {
1970 offset = dissect_ldap_LDAPString(implicit_tag, tvb, offset, actx, tree, hf_index);
1977 static const ber_sequence_t AttributeValueAssertion_sequence[] = {
1978 { &hf_ldap_attributeDesc , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
1979 { &hf_ldap_assertionValue , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AssertionValue },
1980 { NULL, 0, 0, 0, NULL }
1984 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_) {
1985 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1986 AttributeValueAssertion_sequence, hf_index, ett_ldap_AttributeValueAssertion);
1994 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_) {
1995 offset = dissect_ldap_AttributeValueAssertion(implicit_tag, tvb, offset, actx, tree, hf_index);
1997 #line 532 "./asn1/ldap/ldap.cnf"
1998 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s=%s)",
1999 string_or_null(attributedesc_string),
2000 string_or_null(ldapvalue_string));
2008 static const value_string ldap_T_substringFilter_substrings_item_vals[] = {
2015 static const ber_choice_t T_substringFilter_substrings_item_choice[] = {
2016 { 0, &hf_ldap_initial , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ldap_LDAPString },
2017 { 1, &hf_ldap_any , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ldap_LDAPString },
2018 { 2, &hf_ldap_final , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_ldap_LDAPString },
2019 { 0, NULL, 0, 0, 0, NULL }
2023 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_) {
2024 offset = dissect_ber_choice(actx, tree, tvb, offset,
2025 T_substringFilter_substrings_item_choice, hf_index, ett_ldap_T_substringFilter_substrings_item,
2028 #line 633 "./asn1/ldap/ldap.cnf"
2029 if (substring_item_final) {
2030 substring_value=wmem_strdup_printf(wmem_packet_scope(), "%s%s",
2031 (substring_value?substring_value:"*"),
2032 substring_item_final);
2033 } else if (substring_item_any) {
2034 substring_value=wmem_strdup_printf(wmem_packet_scope(), "%s%s*",
2035 (substring_value?substring_value:"*"),
2036 substring_item_any);
2037 } else if (substring_item_init) {
2038 substring_value=wmem_strdup_printf(wmem_packet_scope(), "%s*",
2039 substring_item_init);
2047 static const ber_sequence_t T_substringFilter_substrings_sequence_of[1] = {
2048 { &hf_ldap_substringFilter_substrings_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ldap_T_substringFilter_substrings_item },
2052 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_) {
2053 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2054 T_substringFilter_substrings_sequence_of, hf_index, ett_ldap_T_substringFilter_substrings);
2060 static const ber_sequence_t SubstringFilter_sequence[] = {
2061 { &hf_ldap_type , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
2062 { &hf_ldap_substringFilter_substrings, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_T_substringFilter_substrings },
2063 { NULL, 0, 0, 0, NULL }
2067 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_) {
2068 #line 647 "./asn1/ldap/ldap.cnf"
2071 const char *old_substring_value=substring_value;
2074 substring_value=NULL;
2075 substring_item_init=NULL;
2076 substring_item_any=NULL;
2077 substring_item_final=NULL;
2079 tr=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ldap_SubstringFilter, &it, "substring: ");
2082 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2083 SubstringFilter_sequence, hf_index, ett_ldap_SubstringFilter);
2085 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s=%s)",
2086 string_or_null(attr_type),
2087 string_or_null(substring_value));
2088 proto_item_append_text(it, "%s", Filter_string);
2089 substring_value=old_substring_value;
2099 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_) {
2100 offset = dissect_ldap_AttributeValueAssertion(implicit_tag, tvb, offset, actx, tree, hf_index);
2102 #line 538 "./asn1/ldap/ldap.cnf"
2103 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s>=%s)",
2104 string_or_null(attributedesc_string),
2105 string_or_null(ldapvalue_string));
2115 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_) {
2116 offset = dissect_ldap_AttributeValueAssertion(implicit_tag, tvb, offset, actx, tree, hf_index);
2118 #line 544 "./asn1/ldap/ldap.cnf"
2119 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s<=%s)",
2120 string_or_null(attributedesc_string),
2121 string_or_null(ldapvalue_string));
2131 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_) {
2132 offset = dissect_ldap_AttributeDescription(implicit_tag, tvb, offset, actx, tree, hf_index);
2134 #line 604 "./asn1/ldap/ldap.cnf"
2135 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s=*)",string_or_null(Filter_string));
2144 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_) {
2145 offset = dissect_ldap_AttributeValueAssertion(implicit_tag, tvb, offset, actx, tree, hf_index);
2147 #line 550 "./asn1/ldap/ldap.cnf"
2148 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s~=%s)",
2149 string_or_null(attributedesc_string),
2150 string_or_null(ldapvalue_string));
2159 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_) {
2160 offset = dissect_ldap_LDAPString(implicit_tag, tvb, offset, actx, tree, hf_index);
2168 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_) {
2169 #line 610 "./asn1/ldap/ldap.cnf"
2172 offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, &val);
2175 matching_rule_dnattr = val;
2184 static const ber_sequence_t MatchingRuleAssertion_sequence[] = {
2185 { &hf_ldap_matchingRule , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_MatchingRuleId },
2186 { &hf_ldap_type , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_AttributeDescription },
2187 { &hf_ldap_matchValue , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_ldap_AssertionValue },
2188 { &hf_ldap_dnAttributes , BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_T_dnAttributes },
2189 { NULL, 0, 0, 0, NULL }
2193 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_) {
2194 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2195 MatchingRuleAssertion_sequence, hf_index, ett_ldap_MatchingRuleAssertion);
2203 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_) {
2204 #line 619 "./asn1/ldap/ldap.cnf"
2206 matching_rule_string=NULL;
2207 ldapvalue_string=NULL;
2208 matching_rule_dnattr=FALSE;
2211 offset = dissect_ldap_MatchingRuleAssertion(implicit_tag, tvb, offset, actx, tree, hf_index);
2213 #line 625 "./asn1/ldap/ldap.cnf"
2214 Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s:%s%s%s=%s)",
2215 (attr_type?attr_type:""),
2216 (matching_rule_dnattr?"dn:":""),
2217 (matching_rule_string?matching_rule_string:""),
2218 (matching_rule_string?":":""),
2219 string_or_null(ldapvalue_string));
2226 static const value_string ldap_Filter_vals[] = {
2230 { 3, "equalityMatch" },
2231 { 4, "substrings" },
2232 { 5, "greaterOrEqual" },
2233 { 6, "lessOrEqual" },
2235 { 8, "approxMatch" },
2236 { 9, "extensibleMatch" },
2240 static const ber_choice_t Filter_choice[] = {
2241 { 0, &hf_ldap_and , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ldap_T_and },
2242 { 1, &hf_ldap_or , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ldap_T_or },
2243 { 2, &hf_ldap_not , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_ldap_T_not },
2244 { 3, &hf_ldap_equalityMatch , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_ldap_T_equalityMatch },
2245 { 4, &hf_ldap_substrings , BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_ldap_SubstringFilter },
2246 { 5, &hf_ldap_greaterOrEqual , BER_CLASS_CON, 5, BER_FLAGS_IMPLTAG, dissect_ldap_T_greaterOrEqual },
2247 { 6, &hf_ldap_lessOrEqual , BER_CLASS_CON, 6, BER_FLAGS_IMPLTAG, dissect_ldap_T_lessOrEqual },
2248 { 7, &hf_ldap_present , BER_CLASS_CON, 7, BER_FLAGS_IMPLTAG, dissect_ldap_T_present },
2249 { 8, &hf_ldap_approxMatch , BER_CLASS_CON, 8, BER_FLAGS_IMPLTAG, dissect_ldap_T_approxMatch },
2250 { 9, &hf_ldap_extensibleMatch, BER_CLASS_CON, 9, BER_FLAGS_IMPLTAG, dissect_ldap_T_extensibleMatch },
2251 { 0, NULL, 0, 0, 0, NULL }
2255 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_) {
2256 #line 668 "./asn1/ldap/ldap.cnf"
2259 attributedesc_string=NULL;
2261 if (Filter_length++ > MAX_FILTER_LEN) {
2262 expert_add_info_format(actx->pinfo, tree, &ei_ldap_exceeded_filter_length, "Filter length exceeds %u. Giving up.", MAX_FILTER_LEN);
2263 THROW(ReportedBoundsError);
2266 if (Filter_elements++ > MAX_FILTER_ELEMENTS) {
2267 expert_add_info_format(actx->pinfo, tree, &ei_ldap_too_many_filter_elements, "Found more than %u filter elements. Giving up.", MAX_FILTER_ELEMENTS);
2268 THROW(ReportedBoundsError);
2271 tr=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ldap_Filter, &it, "Filter: ");
2274 offset = dissect_ber_choice(actx, tree, tvb, offset,
2275 Filter_choice, hf_index, ett_ldap_Filter,
2279 proto_item_append_text(it, "%s", string_or_null(Filter_string));
2289 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_) {
2290 #line 521 "./asn1/ldap/ldap.cnf"
2292 Filter_elements = 0;
2296 offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index);
2298 #line 526 "./asn1/ldap/ldap.cnf"
2300 and_filter_string=NULL;
2301 Filter_elements = 0;
2309 static const ber_sequence_t AttributeDescriptionList_sequence_of[1] = {
2310 { &hf_ldap_AttributeDescriptionList_item, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
2314 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_) {
2315 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2316 AttributeDescriptionList_sequence_of, hf_index, ett_ldap_AttributeDescriptionList);
2322 static const ber_sequence_t SearchRequest_U_sequence[] = {
2323 { &hf_ldap_baseObject , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2324 { &hf_ldap_scope , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_scope },
2325 { &hf_ldap_derefAliases , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_derefAliases },
2326 { &hf_ldap_sizeLimit , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_INTEGER_0_maxInt },
2327 { &hf_ldap_timeLimit , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_INTEGER_0_maxInt },
2328 { &hf_ldap_typesOnly , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
2329 { &hf_ldap_filter , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ldap_T_filter },
2330 { &hf_ldap_searchRequest_attributes, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescriptionList },
2331 { NULL, 0, 0, 0, NULL }
2335 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_) {
2336 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2337 SearchRequest_U_sequence, hf_index, ett_ldap_SearchRequest_U);
2345 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_) {
2346 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2347 hf_index, BER_CLASS_APP, 3, TRUE, dissect_ldap_SearchRequest_U);
2355 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_) {
2356 #line 451 "./asn1/ldap/ldap.cnf"
2358 tvbuff_t *next_tvb = NULL;
2361 int old_offset = offset;
2364 /* attr_type, should be set before calling this function */
2366 /* extract the value of the octetstring */
2367 offset = dissect_ber_octet_string(FALSE, actx, NULL, tvb, offset, hf_index, &next_tvb);
2369 /* first check if we have a custom attribute type configured */
2370 if ((hf_id = get_hf_for_header (attr_type)) != NULL)
2371 proto_tree_add_item (tree, *hf_id, next_tvb, 0, tvb_reported_length_remaining(next_tvb, 0), ENC_UTF_8|ENC_NA);
2373 /* if we have an attribute type that isn't binary see if there is a better dissector */
2374 else if(!attr_type || !next_tvb || !dissector_try_string(ldap_name_dissector_table, attr_type, next_tvb, actx->pinfo, tree, NULL)) {
2375 offset = old_offset;
2377 /* do the default thing */
2378 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
2382 len = tvb_reported_length_remaining(next_tvb, 0);
2384 for(i = 0; i < len; i++)
2385 if(!g_ascii_isprint(tvb_get_guint8(next_tvb, i)))
2389 string = tvb_get_string_enc(wmem_packet_scope(), next_tvb, 0, tvb_reported_length_remaining(next_tvb, 0), ENC_ASCII|ENC_NA);
2390 proto_item_set_text(actx->created_item, "AttributeValue: %s", string);
2400 static const ber_sequence_t SET_OF_AttributeValue_set_of[1] = {
2401 { &hf_ldap_vals_item , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeValue },
2405 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_) {
2406 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
2407 SET_OF_AttributeValue_set_of, hf_index, ett_ldap_SET_OF_AttributeValue);
2413 static const ber_sequence_t PartialAttributeList_item_sequence[] = {
2414 { &hf_ldap_type , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
2415 { &hf_ldap_vals , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_ldap_SET_OF_AttributeValue },
2416 { NULL, 0, 0, 0, NULL }
2420 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_) {
2421 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2422 PartialAttributeList_item_sequence, hf_index, ett_ldap_PartialAttributeList_item);
2428 static const ber_sequence_t PartialAttributeList_sequence_of[1] = {
2429 { &hf_ldap_PartialAttributeList_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_PartialAttributeList_item },
2433 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_) {
2434 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2435 PartialAttributeList_sequence_of, hf_index, ett_ldap_PartialAttributeList);
2441 static const ber_sequence_t SearchResultEntry_U_sequence[] = {
2442 { &hf_ldap_objectName , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2443 { &hf_ldap_searchResultEntry_attributes, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_PartialAttributeList },
2444 { NULL, 0, 0, 0, NULL }
2448 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_) {
2449 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2450 SearchResultEntry_U_sequence, hf_index, ett_ldap_SearchResultEntry_U);
2458 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_) {
2459 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2460 hf_index, BER_CLASS_APP, 4, TRUE, dissect_ldap_SearchResultEntry_U);
2466 static const value_string ldap_T_resultCode_vals[] = {
2468 { 1, "operationsError" },
2469 { 2, "protocolError" },
2470 { 3, "timeLimitExceeded" },
2471 { 4, "sizeLimitExceeded" },
2472 { 5, "compareFalse" },
2473 { 6, "compareTrue" },
2474 { 7, "authMethodNotSupported" },
2475 { 8, "strongAuthRequired" },
2477 { 11, "adminLimitExceeded" },
2478 { 12, "unavailableCriticalExtension" },
2479 { 13, "confidentialityRequired" },
2480 { 14, "saslBindInProgress" },
2481 { 16, "noSuchAttribute" },
2482 { 17, "undefinedAttributeType" },
2483 { 18, "inappropriateMatching" },
2484 { 19, "constraintViolation" },
2485 { 20, "attributeOrValueExists" },
2486 { 21, "invalidAttributeSyntax" },
2487 { 32, "noSuchObject" },
2488 { 33, "aliasProblem" },
2489 { 34, "invalidDNSyntax" },
2490 { 36, "aliasDereferencingProblem" },
2491 { 48, "inappropriateAuthentication" },
2492 { 49, "invalidCredentials" },
2493 { 50, "insufficientAccessRights" },
2495 { 52, "unavailable" },
2496 { 53, "unwillingToPerform" },
2497 { 54, "loopDetect" },
2498 { 64, "namingViolation" },
2499 { 65, "objectClassViolation" },
2500 { 66, "notAllowedOnNonLeaf" },
2501 { 67, "notAllowedOnRDN" },
2502 { 68, "entryAlreadyExists" },
2503 { 69, "objectClassModsProhibited" },
2504 { 71, "affectsMultipleDSAs" },
2506 { 118, "canceled" },
2507 { 119, "noSuchOperation" },
2509 { 121, "cannotCancel" },
2515 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_) {
2516 #line 405 "./asn1/ldap/ldap.cnf"
2518 const gchar *valstr;
2520 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
2524 ldap_do_protocolop(actx->pinfo);
2526 valstr = val_to_str(result, ldap_T_resultCode_vals, "Unknown result(%u)");
2528 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", valstr);
2531 proto_item_append_text(ldm_tree, " %s", valstr);
2540 static const ber_sequence_t LDAPResult_sequence[] = {
2541 { &hf_ldap_resultCode , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_resultCode },
2542 { &hf_ldap_matchedDN , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2543 { &hf_ldap_errorMessage , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_ErrorMessage },
2544 { &hf_ldap_referral , BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_Referral },
2545 { NULL, 0, 0, 0, NULL }
2549 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_) {
2550 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2551 LDAPResult_sequence, hf_index, ett_ldap_LDAPResult);
2559 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_) {
2560 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2561 hf_index, BER_CLASS_APP, 5, TRUE, dissect_ldap_LDAPResult);
2567 static const ber_sequence_t SEQUENCE_OF_LDAPURL_sequence_of[1] = {
2568 { &hf_ldap__untag_item , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPURL },
2572 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_) {
2573 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2574 SEQUENCE_OF_LDAPURL_sequence_of, hf_index, ett_ldap_SEQUENCE_OF_LDAPURL);
2582 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_) {
2583 #line 797 "./asn1/ldap/ldap.cnf"
2585 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2586 hf_index, BER_CLASS_APP, 19, TRUE, dissect_ldap_SEQUENCE_OF_LDAPURL);
2589 ldap_do_protocolop(actx->pinfo);
2598 static const value_string ldap_T_operation_vals[] = {
2608 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_) {
2609 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
2616 static const ber_sequence_t AttributeTypeAndValues_sequence[] = {
2617 { &hf_ldap_type , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
2618 { &hf_ldap_vals , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_ldap_SET_OF_AttributeValue },
2619 { NULL, 0, 0, 0, NULL }
2623 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_) {
2624 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2625 AttributeTypeAndValues_sequence, hf_index, ett_ldap_AttributeTypeAndValues);
2631 static const ber_sequence_t T_modifyRequest_modification_item_sequence[] = {
2632 { &hf_ldap_operation , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_operation },
2633 { &hf_ldap_modification , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeTypeAndValues },
2634 { NULL, 0, 0, 0, NULL }
2638 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_) {
2639 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2640 T_modifyRequest_modification_item_sequence, hf_index, ett_ldap_T_modifyRequest_modification_item);
2646 static const ber_sequence_t ModifyRequest_modification_sequence_of[1] = {
2647 { &hf_ldap_modifyRequest_modification_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_T_modifyRequest_modification_item },
2651 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_) {
2652 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2653 ModifyRequest_modification_sequence_of, hf_index, ett_ldap_ModifyRequest_modification);
2659 static const ber_sequence_t ModifyRequest_U_sequence[] = {
2660 { &hf_ldap_object , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2661 { &hf_ldap_modifyRequest_modification, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_ModifyRequest_modification },
2662 { NULL, 0, 0, 0, NULL }
2666 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_) {
2667 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2668 ModifyRequest_U_sequence, hf_index, ett_ldap_ModifyRequest_U);
2676 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_) {
2677 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2678 hf_index, BER_CLASS_APP, 6, TRUE, dissect_ldap_ModifyRequest_U);
2686 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_) {
2687 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2688 hf_index, BER_CLASS_APP, 7, TRUE, dissect_ldap_LDAPResult);
2694 static const ber_sequence_t AttributeList_item_sequence[] = {
2695 { &hf_ldap_type , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
2696 { &hf_ldap_vals , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_ldap_SET_OF_AttributeValue },
2697 { NULL, 0, 0, 0, NULL }
2701 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_) {
2702 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2703 AttributeList_item_sequence, hf_index, ett_ldap_AttributeList_item);
2709 static const ber_sequence_t AttributeList_sequence_of[1] = {
2710 { &hf_ldap_AttributeList_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeList_item },
2714 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_) {
2715 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2716 AttributeList_sequence_of, hf_index, ett_ldap_AttributeList);
2722 static const ber_sequence_t AddRequest_U_sequence[] = {
2723 { &hf_ldap_entry , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2724 { &hf_ldap_attributes , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeList },
2725 { NULL, 0, 0, 0, NULL }
2729 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_) {
2730 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2731 AddRequest_U_sequence, hf_index, ett_ldap_AddRequest_U);
2739 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_) {
2740 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2741 hf_index, BER_CLASS_APP, 8, TRUE, dissect_ldap_AddRequest_U);
2749 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_) {
2750 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2751 hf_index, BER_CLASS_APP, 9, TRUE, dissect_ldap_LDAPResult);
2759 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_) {
2760 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2761 hf_index, BER_CLASS_APP, 10, TRUE, dissect_ldap_LDAPDN);
2769 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_) {
2770 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2771 hf_index, BER_CLASS_APP, 11, TRUE, dissect_ldap_LDAPResult);
2779 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_) {
2780 offset = dissect_ldap_LDAPString(implicit_tag, tvb, offset, actx, tree, hf_index);
2786 static const ber_sequence_t ModifyDNRequest_U_sequence[] = {
2787 { &hf_ldap_entry , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2788 { &hf_ldap_newrdn , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_RelativeLDAPDN },
2789 { &hf_ldap_deleteoldrdn , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
2790 { &hf_ldap_newSuperior , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_LDAPDN },
2791 { NULL, 0, 0, 0, NULL }
2795 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_) {
2796 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2797 ModifyDNRequest_U_sequence, hf_index, ett_ldap_ModifyDNRequest_U);
2805 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_) {
2806 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2807 hf_index, BER_CLASS_APP, 12, TRUE, dissect_ldap_ModifyDNRequest_U);
2815 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_) {
2816 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2817 hf_index, BER_CLASS_APP, 13, TRUE, dissect_ldap_LDAPResult);
2823 static const ber_sequence_t CompareRequest_U_sequence[] = {
2824 { &hf_ldap_entry , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
2825 { &hf_ldap_ava , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeValueAssertion },
2826 { NULL, 0, 0, 0, NULL }
2830 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_) {
2831 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2832 CompareRequest_U_sequence, hf_index, ett_ldap_CompareRequest_U);
2840 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_) {
2841 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2842 hf_index, BER_CLASS_APP, 14, TRUE, dissect_ldap_CompareRequest_U);
2850 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_) {
2851 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2852 hf_index, BER_CLASS_APP, 15, TRUE, dissect_ldap_LDAPResult);
2860 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_) {
2861 #line 804 "./asn1/ldap/ldap.cnf"
2863 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2864 hf_index, BER_CLASS_APP, 16, TRUE, dissect_ldap_MessageID);
2867 ldap_do_protocolop(actx->pinfo);
2877 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_) {
2878 #line 57 "./asn1/ldap/ldap.cnf"
2880 tvbuff_t *parameter_tvb;
2882 ldap_conv_info_t *ldap_info = (ldap_conv_info_t *)actx->private_data;
2885 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
2888 #line 65 "./asn1/ldap/ldap.cnf"
2890 object_identifier_id = NULL;
2895 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);
2896 name = oid_resolved_from_string(wmem_packet_scope(), object_identifier_id);
2899 proto_item_append_text(actx->created_item, " (%s)", name);
2901 if((hf_index == hf_ldap_requestName) || (hf_index == hf_ldap_responseName)) {
2902 ldap_do_protocolop(actx->pinfo);
2903 col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", name);
2907 /* Has the client requested the Start TLS operation? */
2908 if (ldap_info && hf_index == hf_ldap_requestName &&
2909 !strcmp(object_identifier_id, "1.3.6.1.4.1.1466.20037")) {
2910 /* remember we have asked to start_tls */
2911 ldap_info->start_tls_pending = TRUE;
2921 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_) {
2922 #line 739 "./asn1/ldap/ldap.cnf"
2924 if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) {
2925 offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
2927 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
2938 static const ber_sequence_t ExtendedRequest_U_sequence[] = {
2939 { &hf_ldap_requestName , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ldap_LDAPOID },
2940 { &hf_ldap_requestValue , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_T_requestValue },
2941 { NULL, 0, 0, 0, NULL }
2945 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_) {
2946 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2947 ExtendedRequest_U_sequence, hf_index, ett_ldap_ExtendedRequest_U);
2955 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_) {
2956 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
2957 hf_index, BER_CLASS_APP, 23, TRUE, dissect_ldap_ExtendedRequest_U);
2963 static const value_string ldap_ExtendedResponse_resultCode_vals[] = {
2965 { 1, "operationsError" },
2966 { 2, "protocolError" },
2967 { 3, "timeLimitExceeded" },
2968 { 4, "sizeLimitExceeded" },
2969 { 5, "compareFalse" },
2970 { 6, "compareTrue" },
2971 { 7, "authMethodNotSupported" },
2972 { 8, "strongAuthRequired" },
2974 { 11, "adminLimitExceeded" },
2975 { 12, "unavailableCriticalExtension" },
2976 { 13, "confidentialityRequired" },
2977 { 14, "saslBindInProgress" },
2978 { 16, "noSuchAttribute" },
2979 { 17, "undefinedAttributeType" },
2980 { 18, "inappropriateMatching" },
2981 { 19, "constraintViolation" },
2982 { 20, "attributeOrValueExists" },
2983 { 21, "invalidAttributeSyntax" },
2984 { 32, "noSuchObject" },
2985 { 33, "aliasProblem" },
2986 { 34, "invalidDNSyntax" },
2987 { 36, "aliasDereferencingProblem" },
2988 { 48, "inappropriateAuthentication" },
2989 { 49, "invalidCredentials" },
2990 { 50, "insufficientAccessRights" },
2992 { 52, "unavailable" },
2993 { 53, "unwillingToPerform" },
2994 { 54, "loopDetect" },
2995 { 64, "namingViolation" },
2996 { 65, "objectClassViolation" },
2997 { 66, "notAllowedOnNonLeaf" },
2998 { 67, "notAllowedOnRDN" },
2999 { 68, "entryAlreadyExists" },
3000 { 69, "objectClassModsProhibited" },
3001 { 71, "affectsMultipleDSAs" },
3003 { 118, "canceled" },
3004 { 119, "noSuchOperation" },
3006 { 121, "cannotCancel" },
3012 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_) {
3013 #line 436 "./asn1/ldap/ldap.cnf"
3015 ldap_conv_info_t *ldap_info = (ldap_conv_info_t *)actx->private_data;
3017 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
3019 /* If Start TLS request was sent and resultCode is success... */
3020 if (ldap_info && ldap_info->start_tls_pending &&
3021 hf_index == hf_ldap_extendedResponse_resultCode && resultCode == 0) {
3022 /* The conversation will continue using SSL */
3023 ssl_starttls_ack(find_dissector("ssl"), actx->pinfo, ldap_handle);
3024 ldap_info->start_tls_pending = FALSE;
3036 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_) {
3037 offset = dissect_ldap_LDAPOID(implicit_tag, tvb, offset, actx, tree, hf_index);
3045 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_) {
3046 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
3053 static const ber_sequence_t ExtendedResponse_U_sequence[] = {
3054 { &hf_ldap_extendedResponse_resultCode, BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_ExtendedResponse_resultCode },
3055 { &hf_ldap_matchedDN , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_LDAPDN },
3056 { &hf_ldap_errorMessage , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_ErrorMessage },
3057 { &hf_ldap_referral , BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_Referral },
3058 { &hf_ldap_responseName , BER_CLASS_CON, 10, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_ResponseName },
3059 { &hf_ldap_response , BER_CLASS_CON, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_OCTET_STRING },
3060 { NULL, 0, 0, 0, NULL }
3064 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_) {
3065 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3066 ExtendedResponse_U_sequence, hf_index, ett_ldap_ExtendedResponse_U);
3074 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_) {
3075 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
3076 hf_index, BER_CLASS_APP, 24, TRUE, dissect_ldap_ExtendedResponse_U);
3084 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_) {
3085 #line 747 "./asn1/ldap/ldap.cnf"
3090 #line 751 "./asn1/ldap/ldap.cnf"
3091 if(ldm_tree && object_identifier_id) {
3092 proto_item_set_text(ldm_tree, "%s %s", "IntermediateResponse", object_identifier_id);
3093 name = oid_resolved_from_string(wmem_packet_scope(), object_identifier_id);
3095 proto_item_append_text(ldm_tree, " (%s)", name);
3097 if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) {
3098 offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
3100 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
3111 static const ber_sequence_t IntermediateResponse_U_sequence[] = {
3112 { &hf_ldap_responseName , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_ResponseName },
3113 { &hf_ldap_intermediateResponse_responseValue, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_T_intermediateResponse_responseValue },
3114 { NULL, 0, 0, 0, NULL }
3118 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_) {
3119 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3120 IntermediateResponse_U_sequence, hf_index, ett_ldap_IntermediateResponse_U);
3128 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_) {
3129 offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
3130 hf_index, BER_CLASS_APP, 25, TRUE, dissect_ldap_IntermediateResponse_U);
3136 static const value_string ldap_ProtocolOp_vals[] = {
3137 { 0, "bindRequest" },
3138 { 1, "bindResponse" },
3139 { 2, "unbindRequest" },
3140 { 3, "searchRequest" },
3141 { 4, "searchResEntry" },
3142 { 5, "searchResDone" },
3143 { 19, "searchResRef" },
3144 { 6, "modifyRequest" },
3145 { 7, "modifyResponse" },
3146 { 8, "addRequest" },
3147 { 9, "addResponse" },
3148 { 10, "delRequest" },
3149 { 11, "delResponse" },
3150 { 12, "modDNRequest" },
3151 { 13, "modDNResponse" },
3152 { 14, "compareRequest" },
3153 { 15, "compareResponse" },
3154 { 16, "abandonRequest" },
3155 { 23, "extendedReq" },
3156 { 24, "extendedResp" },
3157 { 25, "intermediateResponse" },
3161 static const ber_choice_t ProtocolOp_choice[] = {
3162 { 0, &hf_ldap_bindRequest , BER_CLASS_APP, 0, BER_FLAGS_NOOWNTAG, dissect_ldap_BindRequest },
3163 { 1, &hf_ldap_bindResponse , BER_CLASS_APP, 1, BER_FLAGS_NOOWNTAG, dissect_ldap_BindResponse },
3164 { 2, &hf_ldap_unbindRequest , BER_CLASS_APP, 2, BER_FLAGS_NOOWNTAG, dissect_ldap_UnbindRequest },
3165 { 3, &hf_ldap_searchRequest , BER_CLASS_APP, 3, BER_FLAGS_NOOWNTAG, dissect_ldap_SearchRequest },
3166 { 4, &hf_ldap_searchResEntry , BER_CLASS_APP, 4, BER_FLAGS_NOOWNTAG, dissect_ldap_SearchResultEntry },
3167 { 5, &hf_ldap_searchResDone , BER_CLASS_APP, 5, BER_FLAGS_NOOWNTAG, dissect_ldap_SearchResultDone },
3168 { 19, &hf_ldap_searchResRef , BER_CLASS_APP, 19, BER_FLAGS_NOOWNTAG, dissect_ldap_SearchResultReference },
3169 { 6, &hf_ldap_modifyRequest , BER_CLASS_APP, 6, BER_FLAGS_NOOWNTAG, dissect_ldap_ModifyRequest },
3170 { 7, &hf_ldap_modifyResponse , BER_CLASS_APP, 7, BER_FLAGS_NOOWNTAG, dissect_ldap_ModifyResponse },
3171 { 8, &hf_ldap_addRequest , BER_CLASS_APP, 8, BER_FLAGS_NOOWNTAG, dissect_ldap_AddRequest },
3172 { 9, &hf_ldap_addResponse , BER_CLASS_APP, 9, BER_FLAGS_NOOWNTAG, dissect_ldap_AddResponse },
3173 { 10, &hf_ldap_delRequest , BER_CLASS_APP, 10, BER_FLAGS_NOOWNTAG, dissect_ldap_DelRequest },
3174 { 11, &hf_ldap_delResponse , BER_CLASS_APP, 11, BER_FLAGS_NOOWNTAG, dissect_ldap_DelResponse },
3175 { 12, &hf_ldap_modDNRequest , BER_CLASS_APP, 12, BER_FLAGS_NOOWNTAG, dissect_ldap_ModifyDNRequest },
3176 { 13, &hf_ldap_modDNResponse , BER_CLASS_APP, 13, BER_FLAGS_NOOWNTAG, dissect_ldap_ModifyDNResponse },
3177 { 14, &hf_ldap_compareRequest , BER_CLASS_APP, 14, BER_FLAGS_NOOWNTAG, dissect_ldap_CompareRequest },
3178 { 15, &hf_ldap_compareResponse, BER_CLASS_APP, 15, BER_FLAGS_NOOWNTAG, dissect_ldap_CompareResponse },
3179 { 16, &hf_ldap_abandonRequest , BER_CLASS_APP, 16, BER_FLAGS_NOOWNTAG, dissect_ldap_AbandonRequest },
3180 { 23, &hf_ldap_extendedReq , BER_CLASS_APP, 23, BER_FLAGS_NOOWNTAG, dissect_ldap_ExtendedRequest },
3181 { 24, &hf_ldap_extendedResp , BER_CLASS_APP, 24, BER_FLAGS_NOOWNTAG, dissect_ldap_ExtendedResponse },
3182 { 25, &hf_ldap_intermediateResponse, BER_CLASS_APP, 25, BER_FLAGS_NOOWNTAG, dissect_ldap_IntermediateResponse },
3183 { 0, NULL, 0, 0, 0, NULL }
3187 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_) {
3188 #line 99 "./asn1/ldap/ldap.cnf"
3190 ldap_call_response_t *lcrp;
3191 ldap_conv_info_t *ldap_info = (ldap_conv_info_t *)actx->private_data;
3192 do_protocolop = TRUE;
3195 offset = dissect_ber_choice(actx, tree, tvb, offset,
3196 ProtocolOp_choice, hf_index, ett_ldap_ProtocolOp,
3199 #line 105 "./asn1/ldap/ldap.cnf"
3201 if (ProtocolOp == -1) {
3205 /* ProtocolOp is the index, not the tag so convert it to the tag value */
3206 ProtocolOp = ldap_ProtocolOp_vals[ProtocolOp].value;
3208 lcrp=ldap_match_call_response(tvb, actx->pinfo, tree, MessageID, ProtocolOp, ldap_info);
3210 tap_queue_packet(ldap_tap, actx->pinfo, lcrp);
3213 /* XXX: the count will not work if the results span multiple TCP packets */
3215 if(ldap_info) { /* only count once */
3216 switch(ProtocolOp) {
3218 case LDAP_RES_SEARCH_ENTRY:
3219 if (!actx->pinfo->fd->flags.visited)
3220 ldap_info->num_results++;
3222 proto_item_append_text(tree, " [%d result%s]",
3223 ldap_info->num_results, ldap_info->num_results == 1 ? "" : "s");
3227 case LDAP_RES_SEARCH_RESULT:
3229 col_append_fstr(actx->pinfo->cinfo, COL_INFO, " [%d result%s]",
3230 ldap_info->num_results, ldap_info->num_results == 1 ? "" : "s");
3232 proto_item_append_text(tree, " [%d result%s]",
3233 ldap_info->num_results, ldap_info->num_results == 1 ? "" : "s");
3249 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_) {
3250 offset = dissect_ldap_LDAPOID(implicit_tag, tvb, offset, actx, tree, hf_index);
3258 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_) {
3259 #line 720 "./asn1/ldap/ldap.cnf"
3265 if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) {
3266 /* remove the OCTET STRING encoding */
3267 offset=dissect_ber_identifier(actx->pinfo, NULL, tvb, offset, &ber_class, &pc, &tag);
3268 offset=dissect_ber_length(actx->pinfo, NULL, tvb, offset, &len, &ind);
3270 call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
3274 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
3286 static const ber_sequence_t Control_sequence[] = {
3287 { &hf_ldap_controlType , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_ControlType },
3288 { &hf_ldap_criticality , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
3289 { &hf_ldap_controlValue , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_T_controlValue },
3290 { NULL, 0, 0, 0, NULL }
3294 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_) {
3295 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3296 Control_sequence, hf_index, ett_ldap_Control);
3302 static const ber_sequence_t Controls_sequence_of[1] = {
3303 { &hf_ldap_Controls_item , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_Control },
3307 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_) {
3308 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
3309 Controls_sequence_of, hf_index, ett_ldap_Controls);
3315 static const ber_sequence_t LDAPMessage_sequence[] = {
3316 { &hf_ldap_messageID , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_MessageID },
3317 { &hf_ldap_protocolOp , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ldap_ProtocolOp },
3318 { &hf_ldap_controls , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_Controls },
3319 { NULL, 0, 0, 0, NULL }
3323 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_) {
3324 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3325 LDAPMessage_sequence, hf_index, ett_ldap_LDAPMessage);
3335 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_) {
3336 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
3343 static const ber_sequence_t SearchControlValue_sequence[] = {
3344 { &hf_ldap_size , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_INTEGER },
3345 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3346 { NULL, 0, 0, 0, NULL }
3350 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_) {
3351 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3352 SearchControlValue_sequence, hf_index, ett_ldap_SearchControlValue);
3358 static const ber_sequence_t SortKeyList_item_sequence[] = {
3359 { &hf_ldap_attributeType , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeDescription },
3360 { &hf_ldap_orderingRule , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_MatchingRuleId },
3361 { &hf_ldap_reverseOrder , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_BOOLEAN },
3362 { NULL, 0, 0, 0, NULL }
3366 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_) {
3367 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3368 SortKeyList_item_sequence, hf_index, ett_ldap_SortKeyList_item);
3374 static const ber_sequence_t SortKeyList_sequence_of[1] = {
3375 { &hf_ldap_SortKeyList_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ldap_SortKeyList_item },
3379 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_) {
3380 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
3381 SortKeyList_sequence_of, hf_index, ett_ldap_SortKeyList);
3387 static const value_string ldap_T_sortResult_vals[] = {
3389 { 1, "operationsError" },
3390 { 3, "timeLimitExceeded" },
3391 { 8, "strongAuthRequired" },
3392 { 11, "adminLimitExceeded" },
3393 { 16, "noSuchAttribute" },
3394 { 18, "inappropriateMatching" },
3395 { 50, "insufficientAccessRights" },
3397 { 53, "unwillingToPerform" },
3404 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_) {
3405 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
3412 static const ber_sequence_t SortResult_sequence[] = {
3413 { &hf_ldap_sortResult , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_sortResult },
3414 { &hf_ldap_attributeType , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_AttributeDescription },
3415 { NULL, 0, 0, 0, NULL }
3419 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_) {
3420 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3421 SortResult_sequence, hf_index, ett_ldap_SortResult);
3429 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_) {
3430 #line 764 "./asn1/ldap/ldap.cnf"
3437 int otheroffset = offset;
3439 dissect_ber_identifier(actx->pinfo, tree, tvb, otheroffset, &ber_class, &pc, &tag);
3440 otheroffset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, NULL);
3442 gint32 remaining=tvb_reported_length_remaining(tvb, offset);
3443 len=remaining>0 ? remaining : 0;
3446 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, -1, &val);
3449 const int *flags[] = {
3450 &hf_ldap_object_security_flag,
3451 &hf_ldap_ancestor_first_flag,
3452 &hf_ldap_public_data_only_flag,
3453 &hf_ldap_incremental_value_flag,
3457 proto_tree_add_bitmask_value_with_flags(tree, tvb, otheroffset+1, hf_index,
3458 ett_ldap_DirSyncFlagsSubEntry, flags, val, BMT_NO_APPEND);
3460 proto_tree_add_uint(tree, hf_index, tvb, otheroffset+len, len, 0);
3469 static const ber_sequence_t DirSyncControlValue_sequence[] = {
3470 { &hf_ldap_flags , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_DirSyncFlags },
3471 { &hf_ldap_maxBytes , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_INTEGER },
3472 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3473 { NULL, 0, 0, 0, NULL }
3477 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_) {
3478 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3479 DirSyncControlValue_sequence, hf_index, ett_ldap_DirSyncControlValue);
3485 static const ber_sequence_t PasswdModifyRequestValue_sequence[] = {
3486 { &hf_ldap_userIdentity , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_OCTET_STRING },
3487 { &hf_ldap_oldPasswd , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_OCTET_STRING },
3488 { &hf_ldap_newPasswd , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_OCTET_STRING },
3489 { NULL, 0, 0, 0, NULL }
3493 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_) {
3494 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3495 PasswdModifyRequestValue_sequence, hf_index, ett_ldap_PasswdModifyRequestValue);
3501 static const ber_sequence_t CancelRequestValue_sequence[] = {
3502 { &hf_ldap_cancelID , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ldap_MessageID },
3503 { NULL, 0, 0, 0, NULL }
3507 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_) {
3508 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3509 CancelRequestValue_sequence, hf_index, ett_ldap_CancelRequestValue);
3515 static const value_string ldap_T_mode_vals[] = {
3516 { 1, "refreshOnly" },
3517 { 3, "refreshAndPersist" },
3523 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_) {
3524 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
3531 static const ber_sequence_t SyncRequestValue_sequence[] = {
3532 { &hf_ldap_mode , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_mode },
3533 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3534 { &hf_ldap_reloadHint , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
3535 { NULL, 0, 0, 0, NULL }
3539 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_) {
3540 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3541 SyncRequestValue_sequence, hf_index, ett_ldap_SyncRequestValue);
3547 static const value_string ldap_T_state_vals[] = {
3557 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_) {
3558 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
3567 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_) {
3568 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
3575 static const ber_sequence_t SyncStateValue_sequence[] = {
3576 { &hf_ldap_state , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ldap_T_state },
3577 { &hf_ldap_entryUUID , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_SyncUUID },
3578 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3579 { NULL, 0, 0, 0, NULL }
3583 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_) {
3584 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3585 SyncStateValue_sequence, hf_index, ett_ldap_SyncStateValue);
3591 static const ber_sequence_t SyncDoneValue_sequence[] = {
3592 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3593 { &hf_ldap_refreshDeletes , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
3594 { NULL, 0, 0, 0, NULL }
3598 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_) {
3599 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3600 SyncDoneValue_sequence, hf_index, ett_ldap_SyncDoneValue);
3606 static const ber_sequence_t T_refreshDelete_sequence[] = {
3607 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3608 { &hf_ldap_refreshDone , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
3609 { NULL, 0, 0, 0, NULL }
3613 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_) {
3614 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3615 T_refreshDelete_sequence, hf_index, ett_ldap_T_refreshDelete);
3621 static const ber_sequence_t T_refreshPresent_sequence[] = {
3622 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3623 { &hf_ldap_refreshDone , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
3624 { NULL, 0, 0, 0, NULL }
3628 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_) {
3629 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3630 T_refreshPresent_sequence, hf_index, ett_ldap_T_refreshPresent);
3636 static const ber_sequence_t SET_OF_SyncUUID_set_of[1] = {
3637 { &hf_ldap_syncUUIDs_item , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_SyncUUID },
3641 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_) {
3642 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
3643 SET_OF_SyncUUID_set_of, hf_index, ett_ldap_SET_OF_SyncUUID);
3649 static const ber_sequence_t T_syncIdSet_sequence[] = {
3650 { &hf_ldap_cookie , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_OCTET_STRING },
3651 { &hf_ldap_refreshDeletes , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ldap_BOOLEAN },
3652 { &hf_ldap_syncUUIDs , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_ldap_SET_OF_SyncUUID },
3653 { NULL, 0, 0, 0, NULL }
3657 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_) {
3658 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3659 T_syncIdSet_sequence, hf_index, ett_ldap_T_syncIdSet);
3665 static const value_string ldap_SyncInfoValue_vals[] = {
3667 { 1, "refreshDelete" },
3668 { 2, "refreshPresent" },
3673 static const ber_choice_t SyncInfoValue_choice[] = {
3674 { 0, &hf_ldap_newcookie , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ldap_OCTET_STRING },
3675 { 1, &hf_ldap_refreshDelete , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ldap_T_refreshDelete },
3676 { 2, &hf_ldap_refreshPresent , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_ldap_T_refreshPresent },
3677 { 3, &hf_ldap_syncIdSet , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_ldap_T_syncIdSet },
3678 { 0, NULL, 0, 0, 0, NULL }
3682 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_) {
3683 offset = dissect_ber_choice(actx, tree, tvb, offset,
3684 SyncInfoValue_choice, hf_index, ett_ldap_SyncInfoValue,
3691 static const value_string ldap_T_warning_vals[] = {
3692 { 0, "timeBeforeExpiration" },
3693 { 1, "graceAuthNsRemaining" },
3697 static const ber_choice_t T_warning_choice[] = {
3698 { 0, &hf_ldap_timeBeforeExpiration, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ldap_INTEGER_0_maxInt },
3699 { 1, &hf_ldap_graceAuthNsRemaining, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ldap_INTEGER_0_maxInt },
3700 { 0, NULL, 0, 0, 0, NULL }
3704 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_) {
3705 offset = dissect_ber_choice(actx, tree, tvb, offset,
3706 T_warning_choice, hf_index, ett_ldap_T_warning,
3713 static const value_string ldap_T_error_vals[] = {
3714 { 0, "passwordExpired" },
3715 { 1, "accountLocked" },
3716 { 2, "changeAfterReset" },
3717 { 3, "passwordModNotAllowed" },
3718 { 4, "mustSupplyOldPassword" },
3719 { 5, "insufficientPasswordQuality" },
3720 { 6, "passwordTooShort" },
3721 { 7, "passwordTooYoung" },
3722 { 8, "passwordInHistory" },
3728 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_) {
3729 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
3736 static const ber_sequence_t PasswordPolicyResponseValue_sequence[] = {
3737 { &hf_ldap_warning , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_T_warning },
3738 { &hf_ldap_error , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ldap_T_error },
3739 { NULL, 0, 0, 0, NULL }
3743 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_) {
3744 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
3745 PasswordPolicyResponseValue_sequence, hf_index, ett_ldap_PasswordPolicyResponseValue);
3752 static int dissect_SearchControlValue_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_SearchControlValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SearchControlValue_PDU);
3759 static int dissect_SortKeyList_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_SortKeyList(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SortKeyList_PDU);
3766 static int dissect_SortResult_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_SortResult(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SortResult_PDU);
3773 static int dissect_DirSyncControlValue_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_DirSyncControlValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_DirSyncControlValue_PDU);
3780 static int dissect_PasswdModifyRequestValue_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_PasswdModifyRequestValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_PasswdModifyRequestValue_PDU);
3787 static int dissect_CancelRequestValue_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_CancelRequestValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_CancelRequestValue_PDU);
3794 static int dissect_SyncRequestValue_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_SyncRequestValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SyncRequestValue_PDU);
3801 static int dissect_SyncStateValue_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_SyncStateValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SyncStateValue_PDU);
3808 static int dissect_SyncDoneValue_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_SyncDoneValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SyncDoneValue_PDU);
3815 static int dissect_SyncInfoValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
3817 asn1_ctx_t asn1_ctx;
3818 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3819 offset = dissect_ldap_SyncInfoValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_SyncInfoValue_PDU);
3822 static int dissect_PasswordPolicyResponseValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
3824 asn1_ctx_t asn1_ctx;
3825 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3826 offset = dissect_ldap_PasswordPolicyResponseValue(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_PasswordPolicyResponseValue_PDU);
3831 /*--- End of included file: packet-ldap-fn.c ---*/
3832 #line 913 "./asn1/ldap/packet-ldap-template.c"
3833 static int dissect_LDAPMessage_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ldap_conv_info_t *ldap_info) {
3836 asn1_ctx_t asn1_ctx;
3837 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
3839 asn1_ctx.private_data = ldap_info;
3840 offset = dissect_ldap_LDAPMessage(FALSE, tvb, offset, &asn1_ctx, tree, hf_ldap_LDAPMessage_PDU);
3845 dissect_ldap_payload(tvbuff_t *tvb, packet_info *pinfo,
3846 proto_tree *tree, ldap_conv_info_t *ldap_info,
3847 gboolean is_mscldap)
3850 guint length_remaining;
3852 int messageOffset = 0;
3853 guint headerLength = 0;
3855 tvbuff_t *msg_tvb = NULL;
3857 gboolean pc, ind = 0;
3860 attributedesc_string=NULL;
3865 length_remaining = tvb_ensure_captured_length_remaining(tvb, offset);
3867 if (length_remaining < 6) return;
3870 * OK, try to read the "Sequence Of" header; this gets the total
3871 * length of the LDAP message.
3873 messageOffset = get_ber_identifier(tvb, offset, &ber_class, &pc, &ber_tag);
3874 messageOffset = get_ber_length(tvb, messageOffset, &msg_len, &ind);
3877 if((msg_len<4) || (msg_len>10000000)) return;
3879 if ( (ber_class==BER_CLASS_UNI) && (ber_tag==BER_UNI_TAG_SEQUENCE) ) {
3881 * Add the length of the "Sequence Of" header to the message
3884 headerLength = messageOffset - offset;
3885 msg_len += headerLength;
3886 if (msg_len < headerLength) {
3888 * The message length was probably so large that the total length
3891 * Report this as an error.
3893 show_reported_bounds_error(tvb, pinfo, tree);
3898 * We couldn't parse the header; just make it the amount of data
3899 * remaining in the tvbuff, so we'll give up on this segment
3900 * after attempting to parse the message - there's nothing more
3901 * we can do. "dissect_ldap_message()" will display the error.
3903 msg_len = length_remaining;
3907 * Construct a tvbuff containing the amount of the payload we have
3908 * available. Make its reported length the amount of data in the
3911 * XXX - if reassembly isn't enabled. the subdissector will throw a
3912 * BoundsError exception, rather than a ReportedBoundsError exception.
3913 * We really want a tvbuff where the length is "length", the reported
3914 * length is "plen", and the "if the snapshot length were infinite"
3915 * length is the minimum of the reported length of the tvbuff handed
3916 * to us and "plen", with a new type of exception thrown if the offset
3917 * is within the reported length but beyond that third length, with
3918 * that exception getting the "Unreassembled Packet" error.
3920 length = length_remaining;
3921 if (length > msg_len) length = msg_len;
3922 msg_tvb = tvb_new_subset_length_caplen(tvb, offset, length, msg_len);
3925 * Now dissect the LDAP message.
3927 ldap_info->is_mscldap = is_mscldap;
3928 dissect_LDAPMessage_PDU(msg_tvb, pinfo, tree, ldap_info);
3932 /* If this was a sasl blob there might be another PDU following in the
3935 if(tvb_reported_length_remaining(tvb, offset)>=6){
3936 tvb = tvb_new_subset_remaining(tvb, offset);
3945 ldap_frame_end(void)
3947 ldap_found_in_frame = FALSE;
3949 ldapvalue_string = NULL;
3951 attributedesc_string = NULL;
3952 Filter_string = NULL;
3953 and_filter_string = NULL;
3954 object_identifier_id = NULL;
3955 or_filter_string = NULL;
3957 substring_item_any = NULL;
3958 substring_item_final = NULL;
3959 substring_item_init = NULL;
3960 substring_value = NULL;
3964 Filter_elements = 0;
3966 do_protocolop = FALSE;
3969 /* seems to be ok, but reset just in case */
3970 matching_rule_string = NULL;
3974 dissect_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean is_mscldap)
3977 conversation_t *conversation;
3978 gboolean doing_sasl_security = FALSE;
3979 guint length_remaining;
3980 ldap_conv_info_t *ldap_info = NULL;
3981 proto_item *ldap_item = NULL;
3982 proto_tree *ldap_tree = NULL;
3986 conversation = find_or_create_conversation(pinfo);
3989 * Do we already have a type and mechanism?
3991 ldap_info = (ldap_conv_info_t *)conversation_get_proto_data(conversation, proto_ldap);
3992 if (ldap_info == NULL) {
3993 /* No. Attach that information to the conversation, and add
3994 * it to the list of information structures.
3996 ldap_info = wmem_new0(wmem_file_scope(), ldap_conv_info_t);
3997 ldap_info->matched=wmem_map_new(wmem_file_scope(), ldap_info_hash_matched, ldap_info_equal_matched);
3998 ldap_info->unmatched=wmem_map_new(wmem_file_scope(), ldap_info_hash_unmatched, ldap_info_equal_unmatched);
4000 conversation_add_proto_data(conversation, proto_ldap, ldap_info);
4003 switch (ldap_info->auth_type) {
4004 case LDAP_AUTH_SASL:
4006 * It's SASL; are we using a security layer?
4008 if (ldap_info->first_auth_frame != 0 &&
4009 pinfo->num >= ldap_info->first_auth_frame) {
4010 doing_sasl_security = TRUE; /* yes */
4014 length_remaining = tvb_ensure_captured_length_remaining(tvb, offset);
4016 /* It might still be a packet containing a SASL security layer
4017 * but it's just that we never saw the BIND packet.
4018 * check if it looks like it could be a SASL blob here
4019 * and in that case just assume it is GSS-SPNEGO
4021 if(!doing_sasl_security && (tvb_bytes_exist(tvb, offset, 5))
4022 &&(tvb_get_ntohl(tvb, offset)<=(guint)(tvb_reported_length_remaining(tvb, offset)-4))
4023 &&(tvb_get_guint8(tvb, offset+4)==0x60) ){
4024 ldap_info->auth_type=LDAP_AUTH_SASL;
4025 ldap_info->first_auth_frame=pinfo->num;
4026 ldap_info->auth_mech=wmem_strdup(wmem_file_scope(), "GSS-SPNEGO");
4027 doing_sasl_security=TRUE;
4031 * This is the first PDU, set the Protocol column and clear the
4034 col_set_str(pinfo->cinfo, COL_PROTOCOL, pinfo->current_proto);
4036 if(ldap_found_in_frame) {
4037 /* we have already dissected an ldap PDU in this frame - add a separator and set a fence */
4038 col_append_str(pinfo->cinfo, COL_INFO, " | ");
4039 col_set_fence(pinfo->cinfo, COL_INFO);
4041 col_clear(pinfo->cinfo, COL_INFO);
4042 register_frame_end_routine (pinfo, ldap_frame_end);
4043 ldap_found_in_frame = TRUE;
4046 ldap_item = proto_tree_add_item(tree, is_mscldap?proto_cldap:proto_ldap, tvb, 0, -1, ENC_NA);
4047 ldap_tree = proto_item_add_subtree(ldap_item, ett_ldap);
4050 * Might we be doing a SASL security layer and, if so, *are* we doing
4053 * Just because we've seen a bind reply for SASL, that doesn't mean
4054 * that we're using a SASL security layer; I've seen captures in
4055 * which some SASL negotiations lead to a security layer being used
4056 * and other negotiations don't, and it's not obvious what's different
4057 * in the two negotiations. Therefore, we assume that if the first
4058 * byte is 0, it's a length for a SASL security layer (that way, we
4059 * never reassemble more than 16 megabytes, protecting us from
4060 * chewing up *too* much memory), and otherwise that it's an LDAP
4061 * message (actually, if it's an LDAP message it should begin with 0x30,
4062 * but we want to parse garbage as LDAP messages rather than really
4066 if (doing_sasl_security && tvb_get_guint8(tvb, offset) == 0) {
4067 proto_tree *sasl_tree;
4069 guint sasl_len, sasl_msg_len, length;
4071 * Yes. The frame begins with a 4-byte big-endian length.
4072 * And we know we have at least 6 bytes
4076 * Get the SASL length, which is the length of data in the buffer
4077 * following the length (i.e., it's 4 less than the total length).
4079 * XXX - do we need to reassemble buffers? For now, we
4080 * assume that each LDAP message is entirely contained within
4083 sasl_len = tvb_get_ntohl(tvb, offset);
4084 sasl_msg_len = sasl_len + 4;
4085 if (sasl_msg_len < 4) {
4087 * The message length was probably so large that the total length
4090 * Report this as an error.
4092 show_reported_bounds_error(tvb, pinfo, tree);
4097 * Construct a tvbuff containing the amount of the payload we have
4098 * available. Make its reported length the amount of data in the PDU.
4100 * XXX - if reassembly isn't enabled. the subdissector will throw a
4101 * BoundsError exception, rather than a ReportedBoundsError exception.
4102 * We really want a tvbuff where the length is "length", the reported
4103 * length is "plen", and the "if the snapshot length were infinite"
4104 * length is the minimum of the reported length of the tvbuff handed
4105 * to us and "plen", with a new type of exception thrown if the offset
4106 * is within the reported length but beyond that third length, with
4107 * that exception getting the "Unreassembled Packet" error.
4109 length = length_remaining;
4110 if (length > sasl_msg_len) length = sasl_msg_len;
4111 sasl_tvb = tvb_new_subset_length_caplen(tvb, offset, length, sasl_msg_len);
4113 proto_tree_add_uint(ldap_tree, hf_ldap_sasl_buffer_length, sasl_tvb, 0, 4, sasl_len);
4115 sasl_tree = proto_tree_add_subtree(ldap_tree, sasl_tvb, 0, sasl_msg_len, ett_ldap_sasl_blob, NULL, "SASL Buffer");
4117 if (ldap_info->auth_mech != NULL &&
4118 ((strcmp(ldap_info->auth_mech, "GSS-SPNEGO") == 0) ||
4119 /* auth_mech may have been set from the bind */
4120 (strcmp(ldap_info->auth_mech, "GSSAPI") == 0))) {
4121 tvbuff_t *gssapi_tvb, *plain_tvb = NULL, *decr_tvb= NULL;
4124 gssapi_encrypt_info_t gssapi_encrypt;
4127 * This is GSS-API (using SPNEGO, but we should be done with
4128 * the negotiation by now).
4130 * Dissect the GSS_Wrap() token; it'll return the length of
4131 * the token, from which we compute the offset in the tvbuff at
4132 * which the plaintext data, i.e. the LDAP message, begins.
4134 tmp_length = tvb_reported_length_remaining(sasl_tvb, 4);
4135 if ((guint)tmp_length > sasl_len)
4136 tmp_length = sasl_len;
4137 gssapi_tvb = tvb_new_subset_length_caplen(sasl_tvb, 4, tmp_length, sasl_len);
4139 /* Attempt decryption of the GSSAPI wrapped data if possible */
4140 gssapi_encrypt.gssapi_data_encrypted = FALSE;
4141 gssapi_encrypt.decrypt_gssapi_tvb=DECRYPT_GSSAPI_NORMAL;
4142 gssapi_encrypt.gssapi_wrap_tvb=NULL;
4143 gssapi_encrypt.gssapi_encrypted_tvb=NULL;
4144 gssapi_encrypt.gssapi_decrypted_tvb=NULL;
4145 ver_len = call_dissector_with_data(gssapi_wrap_handle, gssapi_tvb, pinfo, sasl_tree, &gssapi_encrypt);
4146 /* if we could unwrap, do a tvb shuffle */
4147 if(gssapi_encrypt.gssapi_decrypted_tvb){
4148 decr_tvb=gssapi_encrypt.gssapi_decrypted_tvb;
4149 } else if (gssapi_encrypt.gssapi_wrap_tvb) {
4150 plain_tvb=gssapi_encrypt.gssapi_wrap_tvb;
4154 * if len is 0 it probably mean that we got a PDU that is not
4155 * aligned to the start of the segment.
4162 * if we don't have unwrapped data,
4163 * see if the wrapping involved encryption of the
4164 * data; if not, just use the plaintext data.
4166 if (!decr_tvb && !plain_tvb) {
4167 if(!gssapi_encrypt.gssapi_data_encrypted){
4168 plain_tvb = tvb_new_subset_remaining(gssapi_tvb, ver_len);
4173 proto_tree *enc_tree = NULL;
4174 guint decr_len = tvb_reported_length(decr_tvb);
4177 * The LDAP message was encrypted in the packet, and has
4178 * been decrypted; dissect the decrypted LDAP message.
4180 col_set_str(pinfo->cinfo, COL_INFO, "SASL GSS-API Privacy (decrypted): ");
4183 enc_tree = proto_tree_add_subtree_format(sasl_tree, decr_tvb, 0, -1,
4184 ett_ldap_payload, NULL, "GSS-API Encrypted payload (%d byte%s)",
4185 decr_len, plurality(decr_len, "", "s"));
4187 dissect_ldap_payload(decr_tvb, pinfo, enc_tree, ldap_info, is_mscldap);
4188 } else if (plain_tvb) {
4189 proto_tree *plain_tree = NULL;
4190 guint plain_len = tvb_reported_length(plain_tvb);
4193 * The LDAP message wasn't encrypted in the packet;
4194 * dissect the plain LDAP message.
4196 col_set_str(pinfo->cinfo, COL_INFO, "SASL GSS-API Integrity: ");
4199 plain_tree = proto_tree_add_subtree_format(sasl_tree, plain_tvb, 0, -1,
4200 ett_ldap_payload, NULL, "GSS-API payload (%d byte%s)",
4201 plain_len, plurality(plain_len, "", "s"));
4204 dissect_ldap_payload(plain_tvb, pinfo, plain_tree, ldap_info, is_mscldap);
4207 * The LDAP message was encrypted in the packet, and was
4208 * not decrypted; just show it as encrypted data.
4210 col_add_fstr(pinfo->cinfo, COL_INFO, "SASL GSS-API Privacy: payload (%d byte%s)",
4212 plurality(sasl_len - ver_len, "", "s"));
4214 proto_tree_add_item(sasl_tree, hf_ldap_gssapi_encrypted_payload, gssapi_tvb, ver_len, -1, ENC_NA);
4218 /* plain LDAP, so dissect the payload */
4219 dissect_ldap_payload(tvb, pinfo, ldap_tree, ldap_info, is_mscldap);
4224 * prepend_dot is no longer used, but is being left in place in order to
4225 * maintain ABI compatibility.
4227 int dissect_mscldap_string(tvbuff_t *tvb, int offset, char *str, int max_len, gboolean prepend_dot _U_)
4232 /* The name data MUST start at offset 0 of the tvb */
4233 compr_len = expand_dns_name(tvb, offset, max_len, 0, &name);
4234 g_strlcpy(str, name, max_len);
4235 return offset + compr_len;
4239 /* These are the cldap DC flags
4240 http://msdn.microsoft.com/en-us/library/cc201036.aspx
4242 static const true_false_string tfs_ads_pdc = {
4246 static const true_false_string tfs_ads_gc = {
4247 "This is a GLOBAL CATALOGUE of forest",
4248 "This is NOT a global catalog of forest"
4250 static const true_false_string tfs_ads_ldap = {
4251 "This is an LDAP server",
4252 "This is NOT an ldap server"
4254 static const true_false_string tfs_ads_ds = {
4255 "This dc supports DS",
4256 "This dc does NOT support ds"
4258 static const true_false_string tfs_ads_kdc = {
4259 "This is a KDC (kerberos)",
4260 "This is NOT a kdc (kerberos)"
4262 static const true_false_string tfs_ads_timeserv = {
4263 "This dc is running TIME SERVICES (ntp)",
4264 "This dc is NOT running time services (ntp)"
4266 static const true_false_string tfs_ads_closest = {
4267 "This server is in the same site as the client",
4268 "This server is NOT in the same site as the client"
4270 static const true_false_string tfs_ads_writable = {
4271 "This dc is WRITABLE",
4272 "This dc is NOT writable"
4274 static const true_false_string tfs_ads_good_timeserv = {
4275 "This dc has a GOOD TIME SERVICE (i.e. hardware clock)",
4276 "This dc does NOT have a good time service (i.e. no hardware clock)"
4278 static const true_false_string tfs_ads_ndnc = {
4279 "Domain is NON-DOMAIN NC serviced by ldap server",
4280 "Domain is NOT non-domain nc serviced by ldap server"
4282 static const true_false_string tfs_ads_rodc = {
4283 "Domain controller is a Windows 2008 RODC",
4284 "Domain controller is not a Windows 2008 RODC"
4286 static const true_false_string tfs_ads_wdc = {
4287 "Domain controller is a Windows 2008 writable NC",
4288 "Domain controller is not a Windows 2008 writable NC"
4290 static const true_false_string tfs_ads_dns = {
4291 "Server name is in DNS format (Windows 2008)",
4292 "Server name is not in DNS format (Windows 2008)"
4294 static const true_false_string tfs_ads_dnc = {
4295 "The NC is the default NC (Windows 2008)",
4296 "The NC is not the default NC (Windows 2008)"
4298 static const true_false_string tfs_ads_fnc = {
4299 "The NC is the default forest NC(Windows 2008)",
4300 "The NC is not the default forest NC (Windows 2008)"
4302 static int dissect_mscldap_netlogon_flags(proto_tree *parent_tree, tvbuff_t *tvb, int offset)
4304 static const int * flags[] = {
4305 &hf_mscldap_netlogon_flags_fnc,
4306 &hf_mscldap_netlogon_flags_dnc,
4307 &hf_mscldap_netlogon_flags_dns,
4308 &hf_mscldap_netlogon_flags_wdc,
4309 &hf_mscldap_netlogon_flags_rodc,
4310 &hf_mscldap_netlogon_flags_ndnc,
4311 &hf_mscldap_netlogon_flags_good_timeserv,
4312 &hf_mscldap_netlogon_flags_writable,
4313 &hf_mscldap_netlogon_flags_closest,
4314 &hf_mscldap_netlogon_flags_timeserv,
4315 &hf_mscldap_netlogon_flags_kdc,
4316 &hf_mscldap_netlogon_flags_ds,
4317 &hf_mscldap_netlogon_flags_ldap,
4318 &hf_mscldap_netlogon_flags_gc,
4319 &hf_mscldap_netlogon_flags_pdc,
4323 proto_tree_add_bitmask_with_flags(parent_tree, tvb, offset, hf_mscldap_netlogon_flags,
4324 ett_mscldap_netlogon_flags, flags, ENC_LITTLE_ENDIAN, BMT_NO_FALSE);
4330 static int dissect_NetLogon_PDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
4332 int old_offset, offset=0;
4345 /* Get the length of the buffer */
4346 len=tvb_reported_length_remaining(tvb,offset);
4348 /* check the len if it is to small return */
4350 return tvb_captured_length(tvb);
4353 proto_tree_add_item(tree, hf_mscldap_netlogon_opcode, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4354 itype = tvb_get_letohs(tvb, offset);
4359 case LOGON_SAM_LOGON_RESPONSE:
4360 bc = tvb_reported_length_remaining(tvb, offset);
4361 /* logon server name */
4362 fn = get_unicode_or_ascii_string(tvb,&offset,TRUE,&fn_len,FALSE,FALSE,&bc);
4363 proto_tree_add_string(tree, hf_mscldap_nb_hostname, tvb,offset, fn_len, fn);
4367 fn = get_unicode_or_ascii_string(tvb,&offset,TRUE,&fn_len,FALSE,FALSE,&bc);
4368 proto_tree_add_string(tree, hf_mscldap_username, tvb,offset, fn_len, fn);
4372 fn = get_unicode_or_ascii_string(tvb,&offset,TRUE,&fn_len,FALSE,FALSE,&bc);
4373 proto_tree_add_string(tree, hf_mscldap_nb_domain, tvb,offset, fn_len, fn);
4376 /* get the version number from the end of the buffer, as the
4377 length is variable and the version determines what fields
4378 need to be decoded */
4379 version = tvb_get_letohl(tvb,len-8);
4381 /* include the extra version 5 fields */
4382 if ((version & NETLOGON_NT_VERSION_5) == NETLOGON_NT_VERSION_5){
4385 proto_tree_add_item(tree, hf_mscldap_domain_guid, tvb, offset, 16, ENC_LITTLE_ENDIAN);
4388 /* domain guid part 2
4389 there is another 16 byte guid but this is alway zero, so we will skip it */
4394 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4395 proto_tree_add_string(tree, hf_mscldap_forest, tvb, old_offset, offset-old_offset, str);
4399 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4400 proto_tree_add_string(tree, hf_mscldap_domain, tvb, old_offset, offset-old_offset, str);
4404 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4405 proto_tree_add_string(tree, hf_mscldap_hostname, tvb, old_offset, offset-old_offset, str);
4408 proto_tree_add_ipv4(tree, hf_mscldap_netlogon_ipaddress, tvb, offset, 4, tvb_get_ntohl(tvb,offset));
4412 offset = dissect_mscldap_netlogon_flags(tree, tvb, offset);
4418 case LOGON_SAM_LOGON_RESPONSE_EX:
4419 /* MS-ADTS 7.3.1.9 */
4420 offset += 2; /* Skip over "Sbz" field (MUST be set to 0) */
4423 offset = dissect_mscldap_netlogon_flags(tree, tvb, offset);
4426 proto_tree_add_item(tree, hf_mscldap_domain_guid, tvb, offset, 16, ENC_LITTLE_ENDIAN);
4431 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4432 proto_tree_add_string(tree, hf_mscldap_forest, tvb, old_offset, offset-old_offset, str);
4436 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4437 proto_tree_add_string(tree, hf_mscldap_domain, tvb, old_offset, offset-old_offset, str);
4441 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4442 proto_tree_add_string(tree, hf_mscldap_hostname, tvb, old_offset, offset-old_offset, str);
4444 /* NetBIOS Domain */
4446 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4447 proto_tree_add_string(tree, hf_mscldap_nb_domain, tvb, old_offset, offset-old_offset, str);
4449 /* NetBIOS Hostname */
4451 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4452 proto_tree_add_string(tree, hf_mscldap_nb_hostname, tvb, old_offset, offset-old_offset, str);
4456 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4457 proto_tree_add_string(tree, hf_mscldap_username, tvb, old_offset, offset-old_offset, str);
4461 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4462 proto_tree_add_string(tree, hf_mscldap_sitename, tvb, old_offset, offset-old_offset, str);
4466 offset=dissect_mscldap_string(tvb, offset, str, 255, FALSE);
4467 proto_tree_add_string(tree, hf_mscldap_clientsitename, tvb, old_offset, offset-old_offset, str);
4469 /* get the version number from the end of the buffer, as the
4470 length is variable and the version determines what fields
4471 need to be decoded */
4472 version = tvb_get_letohl(tvb,len-8);
4474 /* include the extra fields for version 5 with IP s */
4475 if ((version & NETLOGON_NT_VERSION_5EX_WITH_IP) == NETLOGON_NT_VERSION_5EX_WITH_IP){
4476 /* The ip address is returned as a sockaddr_in structure
4478 * This section may need to be updated if the base Windows APIs
4479 * are changed to support ipv6, which currently is not the case.
4481 * The desector assumes the length is based on ipv4 and
4482 * ignores the length
4485 /* skip the length of the sockaddr_in */
4489 /* add IP address and desect the sockaddr_in structure */
4491 old_offset = offset + 4;
4492 item = proto_tree_add_ipv4(tree, hf_mscldap_netlogon_ipaddress, tvb, old_offset, 4, tvb_get_ipv4(tvb,old_offset));
4495 proto_tree *subtree;
4497 subtree = proto_item_add_subtree(item, ett_mscldap_ipdetails);
4499 /* get sockaddr family */
4500 proto_tree_add_item(subtree, hf_mscldap_netlogon_ipaddress_family, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4503 /* get sockaddr port */
4504 proto_tree_add_item(subtree, hf_mscldap_netlogon_ipaddress_port, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4507 /* get IP address */
4508 proto_tree_add_ipv4(subtree, hf_mscldap_netlogon_ipaddress_ipv4, tvb, offset, 4, tvb_get_ipv4(tvb,offset));
4511 /* skip the 8 bytes of zeros in the sockaddr structure */
4521 /* complete the decode with the version and token details */
4525 /* NETLOGON_NT_VERISON Options (MS-ADTS 7.3.1.1) */
4526 offset = dissect_mscldap_ntver_flags(tree, tvb, offset);
4529 proto_tree_add_item(tree, hf_mscldap_netlogon_lm_token, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4533 proto_tree_add_item(tree, hf_mscldap_netlogon_nt_token, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4536 return tvb_captured_length(tvb);
4541 get_sasl_ldap_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
4542 int offset, void *data _U_)
4544 /* sasl encapsulated ldap is 4 bytes plus the length in size */
4545 return tvb_get_ntohl(tvb, offset)+4;
4549 dissect_sasl_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4551 dissect_ldap_pdu(tvb, pinfo, tree, FALSE);
4552 return tvb_captured_length(tvb);
4556 get_normal_ldap_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
4557 int offset, void *data _U_)
4563 /* normal ldap is tag+len bytes plus the length
4564 * offset is where the tag is
4565 * offset+1 is where length starts
4567 data_offset=get_ber_length(tvb, offset+1, &len, &ind);
4568 return len+data_offset-offset;
4572 dissect_normal_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4574 dissect_ldap_pdu(tvb, pinfo, tree, FALSE);
4575 return tvb_captured_length(tvb);
4579 dissect_ldap_oid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
4582 const char *oidname;
4584 /* tvb here contains an ascii string that is really an oid */
4585 /* XXX we should convert the string oid into a real oid so we can use
4586 * proto_tree_add_oid() instead.
4589 oid=tvb_get_string_enc(wmem_packet_scope(), tvb, 0, tvb_reported_length(tvb), ENC_UTF_8|ENC_NA);
4591 return tvb_captured_length(tvb);
4594 oidname=oid_resolved_from_string(wmem_packet_scope(), oid);
4597 proto_tree_add_string_format_value(tree, hf_ldap_oid, tvb, 0, tvb_reported_length(tvb), oid, "%s (%s)",oid,oidname);
4599 proto_tree_add_string(tree, hf_ldap_oid, tvb, 0, tvb_captured_length(tvb), oid);
4601 return tvb_captured_length(tvb);
4604 #define LDAP_ACCESSMASK_ADS_CREATE_CHILD 0x00000001
4605 #define LDAP_ACCESSMASK_ADS_DELETE_CHILD 0x00000002
4606 #define LDAP_ACCESSMASK_ADS_LIST 0x00000004
4607 #define LDAP_ACCESSMASK_ADS_SELF_WRITE 0x00000008
4608 #define LDAP_ACCESSMASK_ADS_READ_PROP 0x00000010
4609 #define LDAP_ACCESSMASK_ADS_WRITE_PROP 0x00000020
4610 #define LDAP_ACCESSMASK_ADS_DELETE_TREE 0x00000040
4611 #define LDAP_ACCESSMASK_ADS_LIST_OBJECT 0x00000080
4612 #define LDAP_ACCESSMASK_ADS_CONTROL_ACCESS 0x00000100
4615 ldap_specific_rights(tvbuff_t *tvb, gint offset, proto_tree *tree, guint32 access)
4617 static const int * access_flags[] = {
4618 &hf_ldap_AccessMask_ADS_CONTROL_ACCESS,
4619 &hf_ldap_AccessMask_ADS_LIST_OBJECT,
4620 &hf_ldap_AccessMask_ADS_DELETE_TREE,
4621 &hf_ldap_AccessMask_ADS_WRITE_PROP,
4622 &hf_ldap_AccessMask_ADS_READ_PROP,
4623 &hf_ldap_AccessMask_ADS_SELF_WRITE,
4624 &hf_ldap_AccessMask_ADS_LIST,
4625 &hf_ldap_AccessMask_ADS_DELETE_CHILD,
4626 &hf_ldap_AccessMask_ADS_CREATE_CHILD,
4630 proto_tree_add_bitmask_list_value(tree, tvb, offset, 4, access_flags, access);
4632 struct access_mask_info ldap_access_mask_info = {
4633 "LDAP", /* Name of specific rights */
4634 ldap_specific_rights, /* Dissection function */
4635 NULL, /* Generic mapping table */
4636 NULL /* Standard mapping table */
4640 dissect_ldap_nt_sec_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4642 dissect_nt_sec_desc(tvb, 0, pinfo, tree, NULL, TRUE, tvb_reported_length(tvb), &ldap_access_mask_info);
4643 return tvb_captured_length(tvb);
4647 dissect_ldap_sid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
4651 /* this octet string contains an NT SID */
4652 dissect_nt_sid(tvb, 0, tree, "SID", &tmpstr, hf_ldap_sid);
4653 ldapvalue_string=tmpstr;
4654 return tvb_captured_length(tvb);
4658 dissect_ldap_guid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4660 guint8 drep[4] = { 0x10, 0x00, 0x00, 0x00}; /* fake DREP struct */
4663 /* This octet string contained a GUID */
4664 dissect_dcerpc_uuid_t(tvb, 0, pinfo, tree, drep, hf_ldap_guid, &uuid);
4666 ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 1024);
4667 g_snprintf(ldapvalue_string, 1023, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
4668 uuid.data1, uuid.data2, uuid.data3, uuid.data4[0], uuid.data4[1],
4669 uuid.data4[2], uuid.data4[3], uuid.data4[4], uuid.data4[5],
4670 uuid.data4[6], uuid.data4[7]);
4671 return tvb_captured_length(tvb);
4675 dissect_ldap_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
4680 conversation_t *conversation;
4681 ldap_conv_info_t *ldap_info = NULL;
4684 * Do we have a conversation for this connection?
4686 conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
4687 pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
4689 ldap_info = (ldap_conv_info_t *)conversation_get_proto_data(conversation, proto_ldap);
4694 /* This is a bit tricky. We have to find out whether SASL is used
4695 * so that we know how big a header we are supposed to pass
4696 * to tcp_dissect_pdus()
4697 * We must also cope with the case when a client connects to LDAP
4698 * and performs a few unauthenticated searches of LDAP before
4699 * it performs the bind on the same tcp connection.
4701 /* check for a SASL header, i.e. assume it is SASL if
4702 * 1, first four bytes (SASL length) is an integer
4703 * with a value that must be <LDAP_SASL_MAX_BUF and >2
4704 * (>2 to fight false positives, 0x00000000 is a common
4705 * "random" tcp payload)
4706 * (SASL ldap PDUs might be >64k in size, which is why
4707 * LDAP_SASL_MAX_BUF is used - defined in packet-ldap.h)
4709 * 2, we must have a conversation and the auth type must
4712 sasl_len=tvb_get_ntohl(tvb, 0);
4715 goto this_was_not_sasl;
4718 if( sasl_len>LDAP_SASL_MAX_BUF ){
4719 goto this_was_not_sasl;
4722 if((!ldap_info) || (ldap_info->auth_type!=LDAP_AUTH_SASL) ){
4723 goto this_was_not_sasl;
4726 tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 4, get_sasl_ldap_pdu_len, dissect_sasl_ldap_pdu, data);
4727 return tvb_captured_length(tvb);
4730 /* check if it is a normal BER encoded LDAP packet
4731 * i.e. first byte is 0x30 followed by a length that is
4733 * (no ldap PDUs are ever >64kb? )
4735 if(tvb_get_guint8(tvb, 0)!=0x30){
4736 goto this_was_not_normal_ldap;
4739 /* check that length makes sense */
4740 get_ber_length(tvb, 1, &ldap_len, &ind);
4742 /* don't check ind since indefinite length is never used for ldap (famous last words)*/
4744 goto this_was_not_normal_ldap;
4748 * The minimun size of a LDAP pdu is 7 bytes
4750 * dumpasn1 -hh ldap-unbind-min.dat
4752 * <30 05 02 01 09 42 00>
4757 * 5 0: [APPLICATION 2]
4758 * : Error: Object has zero length.
4761 * dumpasn1 -hh ldap-unbind-windows.dat
4763 * <30 84 00 00 00 05 02 01 09 42 00>
4768 * 9 0: [APPLICATION 2]
4769 * : Error: Object has zero length.
4772 * 6 bytes would also be ok to get the full length of
4773 * the pdu, but as the smallest pdu can be 7 bytes
4776 tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 7, get_normal_ldap_pdu_len, dissect_normal_ldap_pdu, data);
4780 this_was_not_normal_ldap:
4782 /* Ok it might be a strange case of SASL still
4783 * It has been seen with Exchange setup to MS AD
4784 * when Exchange pretend that there is SASL but in fact data are still
4786 if ((sasl_len + 4) == (guint32)tvb_reported_length_remaining(tvb, 0))
4787 tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 4, get_sasl_ldap_pdu_len, dissect_sasl_ldap_pdu, data);
4789 return tvb_captured_length(tvb);
4793 dissect_mscldap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4795 dissect_ldap_pdu(tvb, pinfo, tree, TRUE);
4796 return tvb_captured_length(tvb);
4800 /*--- proto_register_ldap -------------------------------------------*/
4801 void proto_register_ldap(void) {
4803 /* List of fields */
4805 static hf_register_info hf[] = {
4807 { &hf_ldap_sasl_buffer_length,
4808 { "SASL Buffer Length", "ldap.sasl_buffer_length",
4809 FT_UINT32, BASE_DEC, NULL, 0x0,
4811 { &hf_ldap_response_in,
4812 { "Response In", "ldap.response_in",
4813 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
4814 "The response to this LDAP request is in this frame", HFILL }},
4815 { &hf_ldap_response_to,
4816 { "Response To", "ldap.response_to",
4817 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
4818 "This is a response to the LDAP request in this frame", HFILL }},
4820 { "Time", "ldap.time",
4821 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
4822 "The time between the Call and the Reply", HFILL }},
4824 { &hf_mscldap_netlogon_opcode,
4825 { "Operation code", "mscldap.netlogon.opcode",
4826 FT_UINT16, BASE_DEC, VALS(netlogon_opcode_vals), 0x0,
4827 "LDAP ping operation code", HFILL }},
4829 { &hf_mscldap_netlogon_ipaddress_family,
4830 { "Family", "mscldap.netlogon.ipaddress.family",
4831 FT_UINT16, BASE_DEC, NULL, 0x0,
4834 { &hf_mscldap_netlogon_ipaddress_ipv4,
4835 { "IPv4", "mscldap.netlogon.ipaddress.ipv4",
4836 FT_IPv4, BASE_NONE, NULL, 0x0,
4837 "IP Address", HFILL }},
4839 { &hf_mscldap_netlogon_ipaddress_port,
4840 { "Port", "mscldap.netlogon.ipaddress.port",
4841 FT_UINT16, BASE_DEC, NULL, 0x0,
4844 { &hf_mscldap_netlogon_ipaddress,
4845 { "IP Address","mscldap.netlogon.ipaddress",
4846 FT_IPv4, BASE_NONE, NULL, 0x0,
4847 "Domain Controller IP Address", HFILL }},
4849 { &hf_mscldap_netlogon_lm_token,
4850 { "LM Token", "mscldap.netlogon.lm_token",
4851 FT_UINT16, BASE_HEX, NULL, 0x0,
4852 "MUST be set to 0xFFFF", HFILL }},
4854 { &hf_mscldap_netlogon_nt_token,
4855 { "NT Token", "mscldap.netlogon.nt_token",
4856 FT_UINT16, BASE_HEX, NULL, 0x0,
4857 "MUST be set to 0xFFFF", HFILL }},
4859 { &hf_mscldap_netlogon_flags,
4860 { "Flags", "mscldap.netlogon.flags",
4861 FT_UINT32, BASE_HEX, NULL, 0x0,
4862 "Netlogon flags describing the DC properties", HFILL }},
4864 { &hf_mscldap_ntver_flags,
4865 { "Version Flags", "mscldap.ntver.flags",
4866 FT_UINT32, BASE_HEX, NULL, 0x0,
4867 "NETLOGON_NT_VERSION Options Bits", HFILL }},
4869 { &hf_mscldap_domain_guid,
4870 { "Domain GUID", "mscldap.domain.guid",
4871 FT_GUID, BASE_NONE, NULL, 0x0,
4872 "Value of the NC's GUID attribute", HFILL }},
4874 { &hf_mscldap_forest,
4875 { "Forest", "mscldap.forest",
4876 FT_STRING, BASE_NONE, NULL, 0x0,
4877 "DNS name of the forest", HFILL }},
4879 { &hf_mscldap_domain,
4880 { "Domain", "mscldap.domain",
4881 FT_STRING, BASE_NONE, NULL, 0x0,
4882 "DNS name of the NC", HFILL }},
4884 { &hf_mscldap_hostname,
4885 { "Hostname", "mscldap.hostname",
4886 FT_STRING, BASE_NONE, NULL, 0x0,
4887 "DNS name of server", HFILL }},
4889 { &hf_mscldap_nb_domain,
4890 { "NetBIOS Domain", "mscldap.nb_domain",
4891 FT_STRING, BASE_NONE, NULL, 0x0,
4892 "NetBIOS name of the NC", HFILL }},
4894 { &hf_mscldap_nb_hostname,
4895 { "NetBIOS Hostname", "mscldap.nb_hostname",
4896 FT_STRING, BASE_NONE, NULL, 0x0,
4897 "NetBIOS name of the server", HFILL }},
4899 { &hf_mscldap_username,
4900 { "Username", "mscldap.username",
4901 FT_STRING, BASE_NONE, NULL, 0x0,
4902 "User specified in client's request", HFILL }},
4904 { &hf_mscldap_sitename,
4905 { "Server Site", "mscldap.sitename",
4906 FT_STRING, BASE_NONE, NULL, 0x0,
4907 "Site name of the server", HFILL }},
4909 { &hf_mscldap_clientsitename,
4910 { "Client Site", "mscldap.clientsitename",
4911 FT_STRING, BASE_NONE, NULL, 0x0,
4912 "Site name of the client", HFILL }},
4915 { "Sid", "ldap.sid",
4916 FT_STRING, BASE_NONE, NULL, 0x0,
4919 { &hf_mscldap_ntver_flags_v1,
4920 { "V1", "mscldap.ntver.searchflags.v1", FT_BOOLEAN, 32,
4921 TFS(&tfs_ntver_v1), 0x00000001, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4923 { &hf_mscldap_ntver_flags_v5,
4924 { "V5", "mscldap.ntver.searchflags.v5", FT_BOOLEAN, 32,
4925 TFS(&tfs_ntver_v5), 0x00000002, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4927 { &hf_mscldap_ntver_flags_v5ex,
4928 { "V5EX", "mscldap.ntver.searchflags.v5ex", FT_BOOLEAN, 32,
4929 TFS(&tfs_ntver_v5ex), 0x00000004, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4931 { &hf_mscldap_ntver_flags_v5ep,
4932 { "V5EP", "mscldap.ntver.searchflags.v5ep", FT_BOOLEAN, 32,
4933 TFS(&tfs_ntver_v5ep), 0x00000008, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4935 { &hf_mscldap_ntver_flags_vcs,
4936 { "VCS", "mscldap.ntver.searchflags.vcs", FT_BOOLEAN, 32,
4937 TFS(&tfs_ntver_vcs), 0x00000010, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4939 { &hf_mscldap_ntver_flags_vnt4,
4940 { "VNT4", "mscldap.ntver.searchflags.vnt4", FT_BOOLEAN, 32,
4941 TFS(&tfs_ntver_vnt4), 0x01000000, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4943 { &hf_mscldap_ntver_flags_vpdc,
4944 { "VPDC", "mscldap.ntver.searchflags.vpdc", FT_BOOLEAN, 32,
4945 TFS(&tfs_ntver_vpdc), 0x10000000, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4947 { &hf_mscldap_ntver_flags_vip,
4948 { "VIP", "mscldap.ntver.searchflags.vip", FT_BOOLEAN, 32,
4949 TFS(&tfs_ntver_vip), 0x20000000, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4951 { &hf_mscldap_ntver_flags_vl,
4952 { "VL", "mscldap.ntver.searchflags.vl", FT_BOOLEAN, 32,
4953 TFS(&tfs_ntver_vl), 0x40000000, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4955 { &hf_mscldap_ntver_flags_vgc,
4956 { "VGC", "mscldap.ntver.searchflags.vgc", FT_BOOLEAN, 32,
4957 TFS(&tfs_ntver_vgc), 0x80000000, "See section 7.3.1.1 of MS-ADTS specification", HFILL }},
4960 { &hf_mscldap_netlogon_flags_pdc,
4961 { "PDC", "mscldap.netlogon.flags.pdc", FT_BOOLEAN, 32,
4962 TFS(&tfs_ads_pdc), 0x00000001, "Is this DC a PDC or not?", HFILL }},
4964 { &hf_mscldap_netlogon_flags_gc,
4965 { "GC", "mscldap.netlogon.flags.gc", FT_BOOLEAN, 32,
4966 TFS(&tfs_ads_gc), 0x00000004, "Does this dc service as a GLOBAL CATALOGUE?", HFILL }},
4968 { &hf_mscldap_netlogon_flags_ldap,
4969 { "LDAP", "mscldap.netlogon.flags.ldap", FT_BOOLEAN, 32,
4970 TFS(&tfs_ads_ldap), 0x00000008, "Does this DC act as an LDAP server?", HFILL }},
4972 { &hf_mscldap_netlogon_flags_ds,
4973 { "DS", "mscldap.netlogon.flags.ds", FT_BOOLEAN, 32,
4974 TFS(&tfs_ads_ds), 0x00000010, "Does this dc provide DS services?", HFILL }},
4976 { &hf_mscldap_netlogon_flags_kdc,
4977 { "KDC", "mscldap.netlogon.flags.kdc", FT_BOOLEAN, 32,
4978 TFS(&tfs_ads_kdc), 0x00000020, "Does this dc act as a KDC?", HFILL }},
4980 { &hf_mscldap_netlogon_flags_timeserv,
4981 { "Time Serv", "mscldap.netlogon.flags.timeserv", FT_BOOLEAN, 32,
4982 TFS(&tfs_ads_timeserv), 0x00000040, "Does this dc provide time services (ntp) ?", HFILL }},
4984 { &hf_mscldap_netlogon_flags_closest,
4985 { "Closest", "mscldap.netlogon.flags.closest", FT_BOOLEAN, 32,
4986 TFS(&tfs_ads_closest), 0x00000080, "Is this the closest dc?", HFILL }},
4988 { &hf_mscldap_netlogon_flags_writable,
4989 { "Writable", "mscldap.netlogon.flags.writable", FT_BOOLEAN, 32,
4990 TFS(&tfs_ads_writable), 0x00000100, "Is this dc writable?", HFILL }},
4992 { &hf_mscldap_netlogon_flags_good_timeserv,
4993 { "Good Time Serv", "mscldap.netlogon.flags.good_timeserv", FT_BOOLEAN, 32,
4994 TFS(&tfs_ads_good_timeserv), 0x00000200, "Is this a Good Time Server? (i.e. does it have a hardware clock)", HFILL }},
4996 { &hf_mscldap_netlogon_flags_ndnc,
4997 { "NDNC", "mscldap.netlogon.flags.ndnc", FT_BOOLEAN, 32,
4998 TFS(&tfs_ads_ndnc), 0x00000400, "Is this an NDNC dc?", HFILL }},
5000 { &hf_mscldap_netlogon_flags_rodc,
5001 { "RODC", "mscldap.netlogon.flags.rodc", FT_BOOLEAN, 32,
5002 TFS(&tfs_ads_rodc), 0x00000800, "Is this an read only dc?", HFILL }},
5004 { &hf_mscldap_netlogon_flags_wdc,
5005 { "WDC", "mscldap.netlogon.flags.writabledc.", FT_BOOLEAN, 32,
5006 TFS(&tfs_ads_wdc), 0x00001000, "Is this an writable dc (Windows 2008)?", HFILL }},
5008 { &hf_mscldap_netlogon_flags_dns,
5009 { "DNS", "mscldap.netlogon.flags.dnsname", FT_BOOLEAN, 32,
5010 TFS(&tfs_ads_dns), 0x20000000, "Does the server have a dns name (Windows 2008)?", HFILL }},
5012 { &hf_mscldap_netlogon_flags_dnc,
5013 { "DNC", "mscldap.netlogon.flags.defaultnc", FT_BOOLEAN, 32,
5014 TFS(&tfs_ads_dnc), 0x40000000, "Is this the default NC (Windows 2008)?", HFILL }},
5016 { &hf_mscldap_netlogon_flags_fnc,
5017 { "FDC", "mscldap.netlogon.flags.forestnc", FT_BOOLEAN, 32,
5018 TFS(&tfs_ads_fnc), 0x80000000, "Is the the NC the default forest root(Windows 2008)?", HFILL }},
5021 { "GUID", "ldap.guid", FT_GUID, BASE_NONE,
5022 NULL, 0, NULL, HFILL }},
5024 { &hf_ldap_AccessMask_ADS_CREATE_CHILD,
5025 { "Ads Create Child", "ldap.AccessMask.ADS_CREATE_CHILD", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_CREATE_CHILD, NULL, HFILL }},
5027 { &hf_ldap_AccessMask_ADS_DELETE_CHILD,
5028 { "Ads Delete Child", "ldap.AccessMask.ADS_DELETE_CHILD", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_DELETE_CHILD, NULL, HFILL }},
5030 { &hf_ldap_AccessMask_ADS_LIST,
5031 { "Ads List", "ldap.AccessMask.ADS_LIST", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_LIST, NULL, HFILL }},
5033 { &hf_ldap_AccessMask_ADS_SELF_WRITE,
5034 { "Ads Self Write", "ldap.AccessMask.ADS_SELF_WRITE", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_SELF_WRITE, NULL, HFILL }},
5036 { &hf_ldap_AccessMask_ADS_READ_PROP,
5037 { "Ads Read Prop", "ldap.AccessMask.ADS_READ_PROP", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_READ_PROP, NULL, HFILL }},
5039 { &hf_ldap_AccessMask_ADS_WRITE_PROP,
5040 { "Ads Write Prop", "ldap.AccessMask.ADS_WRITE_PROP", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_WRITE_PROP, NULL, HFILL }},
5042 { &hf_ldap_AccessMask_ADS_DELETE_TREE,
5043 { "Ads Delete Tree", "ldap.AccessMask.ADS_DELETE_TREE", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_DELETE_TREE, NULL, HFILL }},
5045 { &hf_ldap_AccessMask_ADS_LIST_OBJECT,
5046 { "Ads List Object", "ldap.AccessMask.ADS_LIST_OBJECT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_LIST_OBJECT, NULL, HFILL }},
5048 { &hf_ldap_AccessMask_ADS_CONTROL_ACCESS,
5049 { "Ads Control Access", "ldap.AccessMask.ADS_CONTROL_ACCESS", FT_BOOLEAN, 32, TFS(&tfs_set_notset), LDAP_ACCESSMASK_ADS_CONTROL_ACCESS, NULL, HFILL }},
5051 { &hf_ldap_LDAPMessage_PDU,
5052 { "LDAPMessage", "ldap.LDAPMessage_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
5054 { &hf_ldap_object_security_flag,
5055 { "Flag Object_Security", "ldap.object_security_flag", FT_BOOLEAN, 32, NULL, 0x00000001, NULL, HFILL }},
5057 { &hf_ldap_ancestor_first_flag,
5058 { "Flag Ancestor_First", "ldap.ancestor_first_flag", FT_BOOLEAN, 32, NULL, 0x00000800, NULL, HFILL }},
5060 { &hf_ldap_public_data_only_flag,
5061 { "Flag Public_Data_Only", "ldap.public_data_only_flag", FT_BOOLEAN, 32, NULL, 0x00002000, NULL, HFILL }},
5063 { &hf_ldap_incremental_value_flag,
5064 { "Flag Incremental_Value", "ldap.incremental_value_flag", FT_BOOLEAN, 32, NULL, 0x80000000, NULL, HFILL }},
5067 { "OID", "ldap.oid", FT_STRING, BASE_NONE,
5068 NULL, 0, NULL, HFILL }},
5070 { &hf_ldap_gssapi_encrypted_payload,
5071 { "GSS-API Encrypted payload", "ldap.gssapi_encrypted_payload", FT_BYTES, BASE_NONE,
5072 NULL, 0, NULL, HFILL }},
5075 /*--- Included file: packet-ldap-hfarr.c ---*/
5076 #line 1 "./asn1/ldap/packet-ldap-hfarr.c"
5077 { &hf_ldap_SearchControlValue_PDU,
5078 { "SearchControlValue", "ldap.SearchControlValue_element",
5079 FT_NONE, BASE_NONE, NULL, 0,
5081 { &hf_ldap_SortKeyList_PDU,
5082 { "SortKeyList", "ldap.SortKeyList",
5083 FT_UINT32, BASE_DEC, NULL, 0,
5085 { &hf_ldap_SortResult_PDU,
5086 { "SortResult", "ldap.SortResult_element",
5087 FT_NONE, BASE_NONE, NULL, 0,
5089 { &hf_ldap_DirSyncControlValue_PDU,
5090 { "DirSyncControlValue", "ldap.DirSyncControlValue_element",
5091 FT_NONE, BASE_NONE, NULL, 0,
5093 { &hf_ldap_PasswdModifyRequestValue_PDU,
5094 { "PasswdModifyRequestValue", "ldap.PasswdModifyRequestValue_element",
5095 FT_NONE, BASE_NONE, NULL, 0,
5097 { &hf_ldap_CancelRequestValue_PDU,
5098 { "CancelRequestValue", "ldap.CancelRequestValue_element",
5099 FT_NONE, BASE_NONE, NULL, 0,
5101 { &hf_ldap_SyncRequestValue_PDU,
5102 { "SyncRequestValue", "ldap.SyncRequestValue_element",
5103 FT_NONE, BASE_NONE, NULL, 0,
5105 { &hf_ldap_SyncStateValue_PDU,
5106 { "SyncStateValue", "ldap.SyncStateValue_element",
5107 FT_NONE, BASE_NONE, NULL, 0,
5109 { &hf_ldap_SyncDoneValue_PDU,
5110 { "SyncDoneValue", "ldap.SyncDoneValue_element",
5111 FT_NONE, BASE_NONE, NULL, 0,
5113 { &hf_ldap_SyncInfoValue_PDU,
5114 { "SyncInfoValue", "ldap.SyncInfoValue",
5115 FT_UINT32, BASE_DEC, VALS(ldap_SyncInfoValue_vals), 0,
5117 { &hf_ldap_PasswordPolicyResponseValue_PDU,
5118 { "PasswordPolicyResponseValue", "ldap.PasswordPolicyResponseValue_element",
5119 FT_NONE, BASE_NONE, NULL, 0,
5121 { &hf_ldap_messageID,
5122 { "messageID", "ldap.messageID",
5123 FT_UINT32, BASE_DEC, NULL, 0,
5125 { &hf_ldap_protocolOp,
5126 { "protocolOp", "ldap.protocolOp",
5127 FT_UINT32, BASE_DEC, VALS(ldap_ProtocolOp_vals), 0,
5129 { &hf_ldap_controls,
5130 { "controls", "ldap.controls",
5131 FT_UINT32, BASE_DEC, NULL, 0,
5133 { &hf_ldap_bindRequest,
5134 { "bindRequest", "ldap.bindRequest_element",
5135 FT_NONE, BASE_NONE, NULL, 0,
5137 { &hf_ldap_bindResponse,
5138 { "bindResponse", "ldap.bindResponse_element",
5139 FT_NONE, BASE_NONE, NULL, 0,
5141 { &hf_ldap_unbindRequest,
5142 { "unbindRequest", "ldap.unbindRequest_element",
5143 FT_NONE, BASE_NONE, NULL, 0,
5145 { &hf_ldap_searchRequest,
5146 { "searchRequest", "ldap.searchRequest_element",
5147 FT_NONE, BASE_NONE, NULL, 0,
5149 { &hf_ldap_searchResEntry,
5150 { "searchResEntry", "ldap.searchResEntry_element",
5151 FT_NONE, BASE_NONE, NULL, 0,
5152 "SearchResultEntry", HFILL }},
5153 { &hf_ldap_searchResDone,
5154 { "searchResDone", "ldap.searchResDone_element",
5155 FT_NONE, BASE_NONE, NULL, 0,
5156 "SearchResultDone", HFILL }},
5157 { &hf_ldap_searchResRef,
5158 { "searchResRef", "ldap.searchResRef",
5159 FT_UINT32, BASE_DEC, NULL, 0,
5160 "SearchResultReference", HFILL }},
5161 { &hf_ldap_modifyRequest,
5162 { "modifyRequest", "ldap.modifyRequest_element",
5163 FT_NONE, BASE_NONE, NULL, 0,
5165 { &hf_ldap_modifyResponse,
5166 { "modifyResponse", "ldap.modifyResponse_element",
5167 FT_NONE, BASE_NONE, NULL, 0,
5169 { &hf_ldap_addRequest,
5170 { "addRequest", "ldap.addRequest_element",
5171 FT_NONE, BASE_NONE, NULL, 0,
5173 { &hf_ldap_addResponse,
5174 { "addResponse", "ldap.addResponse_element",
5175 FT_NONE, BASE_NONE, NULL, 0,
5177 { &hf_ldap_delRequest,
5178 { "delRequest", "ldap.delRequest",
5179 FT_STRING, BASE_NONE, NULL, 0,
5181 { &hf_ldap_delResponse,
5182 { "delResponse", "ldap.delResponse_element",
5183 FT_NONE, BASE_NONE, NULL, 0,
5185 { &hf_ldap_modDNRequest,
5186 { "modDNRequest", "ldap.modDNRequest_element",
5187 FT_NONE, BASE_NONE, NULL, 0,
5188 "ModifyDNRequest", HFILL }},
5189 { &hf_ldap_modDNResponse,
5190 { "modDNResponse", "ldap.modDNResponse_element",
5191 FT_NONE, BASE_NONE, NULL, 0,
5192 "ModifyDNResponse", HFILL }},
5193 { &hf_ldap_compareRequest,
5194 { "compareRequest", "ldap.compareRequest_element",
5195 FT_NONE, BASE_NONE, NULL, 0,
5197 { &hf_ldap_compareResponse,
5198 { "compareResponse", "ldap.compareResponse_element",
5199 FT_NONE, BASE_NONE, NULL, 0,
5201 { &hf_ldap_abandonRequest,
5202 { "abandonRequest", "ldap.abandonRequest",
5203 FT_UINT32, BASE_DEC, NULL, 0,
5205 { &hf_ldap_extendedReq,
5206 { "extendedReq", "ldap.extendedReq_element",
5207 FT_NONE, BASE_NONE, NULL, 0,
5208 "ExtendedRequest", HFILL }},
5209 { &hf_ldap_extendedResp,
5210 { "extendedResp", "ldap.extendedResp_element",
5211 FT_NONE, BASE_NONE, NULL, 0,
5212 "ExtendedResponse", HFILL }},
5213 { &hf_ldap_intermediateResponse,
5214 { "intermediateResponse", "ldap.intermediateResponse_element",
5215 FT_NONE, BASE_NONE, NULL, 0,
5217 { &hf_ldap_AttributeDescriptionList_item,
5218 { "AttributeDescription", "ldap.AttributeDescription",
5219 FT_STRING, BASE_NONE, NULL, 0,
5221 { &hf_ldap_attributeDesc,
5222 { "attributeDesc", "ldap.attributeDesc",
5223 FT_STRING, BASE_NONE, NULL, 0,
5224 "AttributeDescription", HFILL }},
5225 { &hf_ldap_assertionValue,
5226 { "assertionValue", "ldap.assertionValue",
5227 FT_STRING, BASE_NONE, NULL, 0,
5230 { "type", "ldap.type",
5231 FT_STRING, BASE_NONE, NULL, 0,
5232 "AttributeDescription", HFILL }},
5234 { "vals", "ldap.vals",
5235 FT_UINT32, BASE_DEC, NULL, 0,
5236 "SET_OF_AttributeValue", HFILL }},
5237 { &hf_ldap_vals_item,
5238 { "AttributeValue", "ldap.AttributeValue",
5239 FT_BYTES, BASE_NONE, NULL, 0,
5241 { &hf_ldap_resultCode,
5242 { "resultCode", "ldap.resultCode",
5243 FT_UINT32, BASE_DEC, VALS(ldap_T_resultCode_vals), 0,
5245 { &hf_ldap_matchedDN,
5246 { "matchedDN", "ldap.matchedDN",
5247 FT_STRING, BASE_NONE, NULL, 0,
5249 { &hf_ldap_errorMessage,
5250 { "errorMessage", "ldap.errorMessage",
5251 FT_STRING, BASE_NONE, NULL, 0,
5253 { &hf_ldap_referral,
5254 { "referral", "ldap.referral",
5255 FT_UINT32, BASE_DEC, NULL, 0,
5257 { &hf_ldap_Referral_item,
5258 { "LDAPURL", "ldap.LDAPURL",
5259 FT_STRING, BASE_NONE, NULL, 0,
5261 { &hf_ldap_Controls_item,
5262 { "Control", "ldap.Control_element",
5263 FT_NONE, BASE_NONE, NULL, 0,
5265 { &hf_ldap_controlType,
5266 { "controlType", "ldap.controlType",
5267 FT_STRING, BASE_NONE, NULL, 0,
5269 { &hf_ldap_criticality,
5270 { "criticality", "ldap.criticality",
5271 FT_BOOLEAN, BASE_NONE, NULL, 0,
5272 "BOOLEAN", HFILL }},
5273 { &hf_ldap_controlValue,
5274 { "controlValue", "ldap.controlValue",
5275 FT_BYTES, BASE_NONE, NULL, 0,
5278 { "version", "ldap.version",
5279 FT_UINT32, BASE_DEC, NULL, 0,
5280 "INTEGER_1_127", HFILL }},
5282 { "name", "ldap.name",
5283 FT_STRING, BASE_NONE, NULL, 0,
5285 { &hf_ldap_authentication,
5286 { "authentication", "ldap.authentication",
5287 FT_UINT32, BASE_DEC, VALS(ldap_AuthenticationChoice_vals), 0,
5288 "AuthenticationChoice", HFILL }},
5290 { "simple", "ldap.simple",
5291 FT_STRING, BASE_NONE, NULL, 0,
5294 { "sasl", "ldap.sasl_element",
5295 FT_NONE, BASE_NONE, NULL, 0,
5296 "SaslCredentials", HFILL }},
5297 { &hf_ldap_ntlmsspNegotiate,
5298 { "ntlmsspNegotiate", "ldap.ntlmsspNegotiate",
5299 FT_BYTES, BASE_NONE, NULL, 0,
5301 { &hf_ldap_ntlmsspAuth,
5302 { "ntlmsspAuth", "ldap.ntlmsspAuth",
5303 FT_BYTES, BASE_NONE, NULL, 0,
5305 { &hf_ldap_mechanism,
5306 { "mechanism", "ldap.mechanism",
5307 FT_STRING, BASE_NONE, NULL, 0,
5309 { &hf_ldap_credentials,
5310 { "credentials", "ldap.credentials",
5311 FT_BYTES, BASE_NONE, NULL, 0,
5313 { &hf_ldap_bindResponse_resultCode,
5314 { "resultCode", "ldap.resultCode",
5315 FT_UINT32, BASE_DEC, VALS(ldap_BindResponse_resultCode_vals), 0,
5316 "BindResponse_resultCode", HFILL }},
5317 { &hf_ldap_bindResponse_matchedDN,
5318 { "matchedDN", "ldap.matchedDN",
5319 FT_STRING, BASE_NONE, NULL, 0,
5320 "T_bindResponse_matchedDN", HFILL }},
5321 { &hf_ldap_serverSaslCreds,
5322 { "serverSaslCreds", "ldap.serverSaslCreds",
5323 FT_BYTES, BASE_NONE, NULL, 0,
5325 { &hf_ldap_baseObject,
5326 { "baseObject", "ldap.baseObject",
5327 FT_STRING, BASE_NONE, NULL, 0,
5330 { "scope", "ldap.scope",
5331 FT_UINT32, BASE_DEC, VALS(ldap_T_scope_vals), 0,
5333 { &hf_ldap_derefAliases,
5334 { "derefAliases", "ldap.derefAliases",
5335 FT_UINT32, BASE_DEC, VALS(ldap_T_derefAliases_vals), 0,
5337 { &hf_ldap_sizeLimit,
5338 { "sizeLimit", "ldap.sizeLimit",
5339 FT_UINT32, BASE_DEC, NULL, 0,
5340 "INTEGER_0_maxInt", HFILL }},
5341 { &hf_ldap_timeLimit,
5342 { "timeLimit", "ldap.timeLimit",
5343 FT_UINT32, BASE_DEC, NULL, 0,
5344 "INTEGER_0_maxInt", HFILL }},
5345 { &hf_ldap_typesOnly,
5346 { "typesOnly", "ldap.typesOnly",
5347 FT_BOOLEAN, BASE_NONE, NULL, 0,
5348 "BOOLEAN", HFILL }},
5350 { "filter", "ldap.filter",
5351 FT_UINT32, BASE_DEC, VALS(ldap_Filter_vals), 0,
5353 { &hf_ldap_searchRequest_attributes,
5354 { "attributes", "ldap.attributes",
5355 FT_UINT32, BASE_DEC, NULL, 0,
5356 "AttributeDescriptionList", HFILL }},
5358 { "and", "ldap.and",
5359 FT_UINT32, BASE_DEC, NULL, 0,
5361 { &hf_ldap_and_item,
5362 { "and item", "ldap.and_item",
5363 FT_UINT32, BASE_DEC, VALS(ldap_Filter_vals), 0,
5367 FT_UINT32, BASE_DEC, NULL, 0,
5370 { "or item", "ldap.or_item",
5371 FT_UINT32, BASE_DEC, VALS(ldap_Filter_vals), 0,
5374 { "not", "ldap.not",
5375 FT_UINT32, BASE_DEC, VALS(ldap_Filter_vals), 0,
5377 { &hf_ldap_equalityMatch,
5378 { "equalityMatch", "ldap.equalityMatch_element",
5379 FT_NONE, BASE_NONE, NULL, 0,
5381 { &hf_ldap_substrings,
5382 { "substrings", "ldap.substrings_element",
5383 FT_NONE, BASE_NONE, NULL, 0,
5384 "SubstringFilter", HFILL }},
5385 { &hf_ldap_greaterOrEqual,
5386 { "greaterOrEqual", "ldap.greaterOrEqual_element",
5387 FT_NONE, BASE_NONE, NULL, 0,
5389 { &hf_ldap_lessOrEqual,
5390 { "lessOrEqual", "ldap.lessOrEqual_element",
5391 FT_NONE, BASE_NONE, NULL, 0,
5394 { "present", "ldap.present",
5395 FT_STRING, BASE_NONE, NULL, 0,
5397 { &hf_ldap_approxMatch,
5398 { "approxMatch", "ldap.approxMatch_element",
5399 FT_NONE, BASE_NONE, NULL, 0,
5401 { &hf_ldap_extensibleMatch,
5402 { "extensibleMatch", "ldap.extensibleMatch_element",
5403 FT_NONE, BASE_NONE, NULL, 0,
5405 { &hf_ldap_substringFilter_substrings,
5406 { "substrings", "ldap.substrings",
5407 FT_UINT32, BASE_DEC, NULL, 0,
5408 "T_substringFilter_substrings", HFILL }},
5409 { &hf_ldap_substringFilter_substrings_item,
5410 { "substrings item", "ldap.substrings_item",
5411 FT_UINT32, BASE_DEC, VALS(ldap_T_substringFilter_substrings_item_vals), 0,
5412 "T_substringFilter_substrings_item", HFILL }},
5414 { "initial", "ldap.initial",
5415 FT_STRING, BASE_NONE, NULL, 0,
5416 "LDAPString", HFILL }},
5418 { "any", "ldap.any",
5419 FT_STRING, BASE_NONE, NULL, 0,
5420 "LDAPString", HFILL }},
5422 { "final", "ldap.final",
5423 FT_STRING, BASE_NONE, NULL, 0,
5424 "LDAPString", HFILL }},
5425 { &hf_ldap_matchingRule,
5426 { "matchingRule", "ldap.matchingRule",
5427 FT_STRING, BASE_NONE, NULL, 0,
5428 "MatchingRuleId", HFILL }},
5429 { &hf_ldap_matchValue,
5430 { "matchValue", "ldap.matchValue",
5431 FT_STRING, BASE_NONE, NULL, 0,
5432 "AssertionValue", HFILL }},
5433 { &hf_ldap_dnAttributes,
5434 { "dnAttributes", "ldap.dnAttributes",
5435 FT_BOOLEAN, BASE_NONE, NULL, 0,
5437 { &hf_ldap_objectName,
5438 { "objectName", "ldap.objectName",
5439 FT_STRING, BASE_NONE, NULL, 0,
5441 { &hf_ldap_searchResultEntry_attributes,
5442 { "attributes", "ldap.attributes",
5443 FT_UINT32, BASE_DEC, NULL, 0,
5444 "PartialAttributeList", HFILL }},
5445 { &hf_ldap_PartialAttributeList_item,
5446 { "PartialAttributeList item", "ldap.PartialAttributeList_item_element",
5447 FT_NONE, BASE_NONE, NULL, 0,
5449 { &hf_ldap__untag_item,
5450 { "LDAPURL", "ldap.LDAPURL",
5451 FT_STRING, BASE_NONE, NULL, 0,
5454 { "object", "ldap.object",
5455 FT_STRING, BASE_NONE, NULL, 0,
5457 { &hf_ldap_modifyRequest_modification,
5458 { "modification", "ldap.modification",
5459 FT_UINT32, BASE_DEC, NULL, 0,
5460 "ModifyRequest_modification", HFILL }},
5461 { &hf_ldap_modifyRequest_modification_item,
5462 { "modification item", "ldap.modification_item_element",
5463 FT_NONE, BASE_NONE, NULL, 0,
5464 "T_modifyRequest_modification_item", HFILL }},
5465 { &hf_ldap_operation,
5466 { "operation", "ldap.operation",
5467 FT_UINT32, BASE_DEC, VALS(ldap_T_operation_vals), 0,
5469 { &hf_ldap_modification,
5470 { "modification", "ldap.modification_element",
5471 FT_NONE, BASE_NONE, NULL, 0,
5472 "AttributeTypeAndValues", HFILL }},
5474 { "entry", "ldap.entry",
5475 FT_STRING, BASE_NONE, NULL, 0,
5477 { &hf_ldap_attributes,
5478 { "attributes", "ldap.attributes",
5479 FT_UINT32, BASE_DEC, NULL, 0,
5480 "AttributeList", HFILL }},
5481 { &hf_ldap_AttributeList_item,
5482 { "AttributeList item", "ldap.AttributeList_item_element",
5483 FT_NONE, BASE_NONE, NULL, 0,
5486 { "newrdn", "ldap.newrdn",
5487 FT_STRING, BASE_NONE, NULL, 0,
5488 "RelativeLDAPDN", HFILL }},
5489 { &hf_ldap_deleteoldrdn,
5490 { "deleteoldrdn", "ldap.deleteoldrdn",
5491 FT_BOOLEAN, BASE_NONE, NULL, 0,
5492 "BOOLEAN", HFILL }},
5493 { &hf_ldap_newSuperior,
5494 { "newSuperior", "ldap.newSuperior",
5495 FT_STRING, BASE_NONE, NULL, 0,
5498 { "ava", "ldap.ava_element",
5499 FT_NONE, BASE_NONE, NULL, 0,
5500 "AttributeValueAssertion", HFILL }},
5501 { &hf_ldap_requestName,
5502 { "requestName", "ldap.requestName",
5503 FT_STRING, BASE_NONE, NULL, 0,
5504 "LDAPOID", HFILL }},
5505 { &hf_ldap_requestValue,
5506 { "requestValue", "ldap.requestValue",
5507 FT_BYTES, BASE_NONE, NULL, 0,
5509 { &hf_ldap_extendedResponse_resultCode,
5510 { "resultCode", "ldap.resultCode",
5511 FT_UINT32, BASE_DEC, VALS(ldap_ExtendedResponse_resultCode_vals), 0,
5512 "ExtendedResponse_resultCode", HFILL }},
5513 { &hf_ldap_responseName,
5514 { "responseName", "ldap.responseName",
5515 FT_STRING, BASE_NONE, NULL, 0,
5517 { &hf_ldap_response,
5518 { "response", "ldap.response",
5519 FT_BYTES, BASE_NONE, NULL, 0,
5520 "OCTET_STRING", HFILL }},
5521 { &hf_ldap_intermediateResponse_responseValue,
5522 { "responseValue", "ldap.responseValue",
5523 FT_BYTES, BASE_NONE, NULL, 0,
5524 "T_intermediateResponse_responseValue", HFILL }},
5526 { "size", "ldap.size",
5527 FT_INT32, BASE_DEC, NULL, 0,
5528 "INTEGER", HFILL }},
5530 { "cookie", "ldap.cookie",
5531 FT_BYTES, BASE_NONE, NULL, 0,
5532 "OCTET_STRING", HFILL }},
5533 { &hf_ldap_SortKeyList_item,
5534 { "SortKeyList item", "ldap.SortKeyList_item_element",
5535 FT_NONE, BASE_NONE, NULL, 0,
5537 { &hf_ldap_attributeType,
5538 { "attributeType", "ldap.attributeType",
5539 FT_STRING, BASE_NONE, NULL, 0,
5540 "AttributeDescription", HFILL }},
5541 { &hf_ldap_orderingRule,
5542 { "orderingRule", "ldap.orderingRule",
5543 FT_STRING, BASE_NONE, NULL, 0,
5544 "MatchingRuleId", HFILL }},
5545 { &hf_ldap_reverseOrder,
5546 { "reverseOrder", "ldap.reverseOrder",
5547 FT_BOOLEAN, BASE_NONE, NULL, 0,
5548 "BOOLEAN", HFILL }},
5549 { &hf_ldap_sortResult,
5550 { "sortResult", "ldap.sortResult",
5551 FT_UINT32, BASE_DEC, VALS(ldap_T_sortResult_vals), 0,
5554 { "flags", "ldap.flags",
5555 FT_UINT32, BASE_HEX, NULL, 0,
5556 "DirSyncFlags", HFILL }},
5557 { &hf_ldap_maxBytes,
5558 { "maxBytes", "ldap.maxBytes",
5559 FT_INT32, BASE_DEC, NULL, 0,
5560 "INTEGER", HFILL }},
5561 { &hf_ldap_userIdentity,
5562 { "userIdentity", "ldap.userIdentity",
5563 FT_BYTES, BASE_NONE, NULL, 0,
5564 "OCTET_STRING", HFILL }},
5565 { &hf_ldap_oldPasswd,
5566 { "oldPasswd", "ldap.oldPasswd",
5567 FT_BYTES, BASE_NONE, NULL, 0,
5568 "OCTET_STRING", HFILL }},
5569 { &hf_ldap_newPasswd,
5570 { "newPasswd", "ldap.newPasswd",
5571 FT_BYTES, BASE_NONE, NULL, 0,
5572 "OCTET_STRING", HFILL }},
5573 { &hf_ldap_cancelID,
5574 { "cancelID", "ldap.cancelID",
5575 FT_UINT32, BASE_DEC, NULL, 0,
5576 "MessageID", HFILL }},
5578 { "mode", "ldap.mode",
5579 FT_UINT32, BASE_DEC, VALS(ldap_T_mode_vals), 0,
5581 { &hf_ldap_reloadHint,
5582 { "reloadHint", "ldap.reloadHint",
5583 FT_BOOLEAN, BASE_NONE, NULL, 0,
5584 "BOOLEAN", HFILL }},
5586 { "state", "ldap.state",
5587 FT_UINT32, BASE_DEC, VALS(ldap_T_state_vals), 0,
5589 { &hf_ldap_entryUUID,
5590 { "entryUUID", "ldap.entryUUID",
5591 FT_BYTES, BASE_NONE, NULL, 0,
5592 "SyncUUID", HFILL }},
5593 { &hf_ldap_refreshDeletes,
5594 { "refreshDeletes", "ldap.refreshDeletes",
5595 FT_BOOLEAN, BASE_NONE, NULL, 0,
5596 "BOOLEAN", HFILL }},
5597 { &hf_ldap_newcookie,
5598 { "newcookie", "ldap.newcookie",
5599 FT_BYTES, BASE_NONE, NULL, 0,
5600 "OCTET_STRING", HFILL }},
5601 { &hf_ldap_refreshDelete,
5602 { "refreshDelete", "ldap.refreshDelete_element",
5603 FT_NONE, BASE_NONE, NULL, 0,
5605 { &hf_ldap_refreshDone,
5606 { "refreshDone", "ldap.refreshDone",
5607 FT_BOOLEAN, BASE_NONE, NULL, 0,
5608 "BOOLEAN", HFILL }},
5609 { &hf_ldap_refreshPresent,
5610 { "refreshPresent", "ldap.refreshPresent_element",
5611 FT_NONE, BASE_NONE, NULL, 0,
5613 { &hf_ldap_syncIdSet,
5614 { "syncIdSet", "ldap.syncIdSet_element",
5615 FT_NONE, BASE_NONE, NULL, 0,
5617 { &hf_ldap_syncUUIDs,
5618 { "syncUUIDs", "ldap.syncUUIDs",
5619 FT_UINT32, BASE_DEC, NULL, 0,
5620 "SET_OF_SyncUUID", HFILL }},
5621 { &hf_ldap_syncUUIDs_item,
5622 { "SyncUUID", "ldap.SyncUUID",
5623 FT_BYTES, BASE_NONE, NULL, 0,
5626 { "warning", "ldap.warning",
5627 FT_UINT32, BASE_DEC, VALS(ldap_T_warning_vals), 0,
5629 { &hf_ldap_timeBeforeExpiration,
5630 { "timeBeforeExpiration", "ldap.timeBeforeExpiration",
5631 FT_UINT32, BASE_DEC, NULL, 0,
5632 "INTEGER_0_maxInt", HFILL }},
5633 { &hf_ldap_graceAuthNsRemaining,
5634 { "graceAuthNsRemaining", "ldap.graceAuthNsRemaining",
5635 FT_UINT32, BASE_DEC, NULL, 0,
5636 "INTEGER_0_maxInt", HFILL }},
5638 { "error", "ldap.error",
5639 FT_UINT32, BASE_DEC, VALS(ldap_T_error_vals), 0,
5642 /*--- End of included file: packet-ldap-hfarr.c ---*/
5643 #line 2155 "./asn1/ldap/packet-ldap-template.c"
5646 /* List of subtrees */
5647 static gint *ett[] = {
5650 &ett_ldap_sasl_blob,
5652 &ett_mscldap_netlogon_flags,
5653 &ett_mscldap_ntver_flags,
5654 &ett_mscldap_ipdetails,
5655 &ett_ldap_DirSyncFlagsSubEntry,
5658 /*--- Included file: packet-ldap-ettarr.c ---*/
5659 #line 1 "./asn1/ldap/packet-ldap-ettarr.c"
5660 &ett_ldap_LDAPMessage,
5661 &ett_ldap_ProtocolOp,
5662 &ett_ldap_AttributeDescriptionList,
5663 &ett_ldap_AttributeValueAssertion,
5664 &ett_ldap_Attribute,
5665 &ett_ldap_SET_OF_AttributeValue,
5666 &ett_ldap_LDAPResult,
5670 &ett_ldap_BindRequest_U,
5671 &ett_ldap_AuthenticationChoice,
5672 &ett_ldap_SaslCredentials,
5673 &ett_ldap_BindResponse_U,
5674 &ett_ldap_SearchRequest_U,
5678 &ett_ldap_SubstringFilter,
5679 &ett_ldap_T_substringFilter_substrings,
5680 &ett_ldap_T_substringFilter_substrings_item,
5681 &ett_ldap_MatchingRuleAssertion,
5682 &ett_ldap_SearchResultEntry_U,
5683 &ett_ldap_PartialAttributeList,
5684 &ett_ldap_PartialAttributeList_item,
5685 &ett_ldap_SEQUENCE_OF_LDAPURL,
5686 &ett_ldap_ModifyRequest_U,
5687 &ett_ldap_ModifyRequest_modification,
5688 &ett_ldap_T_modifyRequest_modification_item,
5689 &ett_ldap_AttributeTypeAndValues,
5690 &ett_ldap_AddRequest_U,
5691 &ett_ldap_AttributeList,
5692 &ett_ldap_AttributeList_item,
5693 &ett_ldap_ModifyDNRequest_U,
5694 &ett_ldap_CompareRequest_U,
5695 &ett_ldap_ExtendedRequest_U,
5696 &ett_ldap_ExtendedResponse_U,
5697 &ett_ldap_IntermediateResponse_U,
5698 &ett_ldap_SearchControlValue,
5699 &ett_ldap_SortKeyList,
5700 &ett_ldap_SortKeyList_item,
5701 &ett_ldap_SortResult,
5702 &ett_ldap_DirSyncControlValue,
5703 &ett_ldap_PasswdModifyRequestValue,
5704 &ett_ldap_CancelRequestValue,
5705 &ett_ldap_SyncRequestValue,
5706 &ett_ldap_SyncStateValue,
5707 &ett_ldap_SyncDoneValue,
5708 &ett_ldap_SyncInfoValue,
5709 &ett_ldap_T_refreshDelete,
5710 &ett_ldap_T_refreshPresent,
5711 &ett_ldap_T_syncIdSet,
5712 &ett_ldap_SET_OF_SyncUUID,
5713 &ett_ldap_PasswordPolicyResponseValue,
5714 &ett_ldap_T_warning,
5716 /*--- End of included file: packet-ldap-ettarr.c ---*/
5717 #line 2169 "./asn1/ldap/packet-ldap-template.c"
5719 /* UAT for header fields */
5720 static uat_field_t custom_attribute_types_uat_fields[] = {
5721 UAT_FLD_CSTRING(attribute_types, attribute_type, "Attribute type", "Attribute type"),
5722 UAT_FLD_CSTRING(attribute_types, attribute_desc, "Description", "Description of the value matching type"),
5726 static ei_register_info ei[] = {
5727 { &ei_ldap_exceeded_filter_length, { "ldap.exceeded_filter_length", PI_UNDECODED, PI_ERROR, "Filter length exceeds number. Giving up", EXPFILL }},
5728 { &ei_ldap_too_many_filter_elements, { "ldap.too_many_filter_elements", PI_UNDECODED, PI_ERROR, "Found more than %%u filter elements. Giving up.", EXPFILL }},
5731 expert_module_t* expert_ldap;
5732 module_t *ldap_module;
5733 uat_t *attributes_uat;
5735 /* Register protocol */
5736 proto_ldap = proto_register_protocol(PNAME, PSNAME, PFNAME);
5737 /* Register fields and subtrees */
5738 proto_register_field_array(proto_ldap, hf, array_length(hf));
5739 proto_register_subtree_array(ett, array_length(ett));
5740 expert_ldap = expert_register_protocol(proto_ldap);
5741 expert_register_field_array(expert_ldap, ei, array_length(ei));
5743 ldap_handle = register_dissector("ldap", dissect_ldap_tcp, proto_ldap);
5745 ldap_module = prefs_register_protocol(proto_ldap, prefs_register_ldap);
5746 prefs_register_bool_preference(ldap_module, "desegment_ldap_messages",
5747 "Reassemble LDAP messages spanning multiple TCP segments",
5748 "Whether the LDAP dissector should reassemble messages spanning multiple TCP segments."
5749 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
5752 prefs_register_uint_preference(ldap_module, "ssl.port", "LDAPS TCP Port",
5753 "Set the port for LDAP operations over SSL",
5754 10, &global_ldaps_tcp_port);
5756 attributes_uat = uat_new("Custom LDAP AttributeValue types",
5757 sizeof(attribute_type_t),
5758 "custom_ldap_attribute_types",
5761 &num_attribute_types,
5762 /* specifies named fields, so affects dissection
5763 and the set of named fields */
5764 UAT_AFFECTS_DISSECTION|UAT_AFFECTS_FIELDS,
5766 attribute_types_copy_cb,
5767 attribute_types_update_cb,
5768 attribute_types_free_cb,
5769 attribute_types_initialize_cb,
5771 custom_attribute_types_uat_fields);
5773 prefs_register_uat_preference(ldap_module, "custom_ldap_attribute_types",
5774 "Custom AttributeValue types",
5775 "A table to define custom LDAP attribute type values for which fields can be setup and used for filtering/data extraction etc.",
5778 prefs_register_obsolete_preference(ldap_module, "max_pdu");
5780 proto_cldap = proto_register_protocol(
5781 "Connectionless Lightweight Directory Access Protocol",
5784 ldap_tap=register_tap("ldap");
5786 ldap_name_dissector_table = register_dissector_table("ldap.name", "LDAP Attribute Type Dissectors", proto_cldap, FT_STRING, BASE_NONE);
5788 register_srt_table(proto_ldap, NULL, 1, ldapstat_packet, ldapstat_init, NULL);
5792 /*--- proto_reg_handoff_ldap ---------------------------------------*/
5794 proto_reg_handoff_ldap(void)
5796 dissector_handle_t cldap_handle;
5798 cldap_handle = create_dissector_handle(dissect_mscldap, proto_cldap);
5799 dissector_add_uint_with_preference("udp.port", UDP_PORT_CLDAP, cldap_handle);
5801 gssapi_handle = find_dissector_add_dependency("gssapi", proto_ldap);
5802 gssapi_wrap_handle = find_dissector_add_dependency("gssapi_verf", proto_ldap);
5803 spnego_handle = find_dissector_add_dependency("spnego", proto_ldap);
5805 ntlmssp_handle = find_dissector_add_dependency("ntlmssp", proto_ldap);
5807 ssl_handle = find_dissector_add_dependency("ssl", proto_ldap);
5809 prefs_register_ldap();
5811 /* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dsml/dsml/ldap_controls_and_session_support.asp */
5812 oid_add_from_string("LDAP_PAGED_RESULT_OID_STRING","1.2.840.113556.1.4.319");
5813 oid_add_from_string("LDAP_SERVER_SHOW_DELETED_OID","1.2.840.113556.1.4.417");
5814 oid_add_from_string("LDAP_SERVER_SORT_OID","1.2.840.113556.1.4.473");
5815 oid_add_from_string("LDAP_CONTROL_SORT_RESP_OID","1.2.840.113556.1.4.474");
5816 oid_add_from_string("LDAP_SERVER_CROSSDOM_MOVE_TARGET_OID","1.2.840.113556.1.4.521");
5817 oid_add_from_string("LDAP_SERVER_NOTIFICATION_OID","1.2.840.113556.1.4.528");
5818 oid_add_from_string("LDAP_SERVER_EXTENDED_DN_OID","1.2.840.113556.1.4.529");
5819 oid_add_from_string("meetingAdvertiseScope","1.2.840.113556.1.4.582");
5820 oid_add_from_string("LDAP_SERVER_LAZY_COMMIT_OID","1.2.840.113556.1.4.619");
5821 oid_add_from_string("mhsORAddress","1.2.840.113556.1.4.650");
5822 oid_add_from_string("managedObjects","1.2.840.113556.1.4.654");
5823 oid_add_from_string("LDAP_CAP_ACTIVE_DIRECTORY_OID","1.2.840.113556.1.4.800");
5824 oid_add_from_string("LDAP_SERVER_SD_FLAGS_OID","1.2.840.113556.1.4.801");
5825 oid_add_from_string("LDAP_OID_COMPARATOR_OR","1.2.840.113556.1.4.804");
5826 oid_add_from_string("LDAP_SERVER_TREE_DELETE_OID","1.2.840.113556.1.4.805");
5827 oid_add_from_string("LDAP_SERVER_DIRSYNC_OID","1.2.840.113556.1.4.841");
5828 oid_add_from_string("None","1.2.840.113556.1.4.970");
5829 oid_add_from_string("LDAP_SERVER_VERIFY_NAME_OID","1.2.840.113556.1.4.1338");
5830 oid_add_from_string("LDAP_SERVER_DOMAIN_SCOPE_OID","1.2.840.113556.1.4.1339");
5831 oid_add_from_string("LDAP_SERVER_SEARCH_OPTIONS_OID","1.2.840.113556.1.4.1340");
5832 oid_add_from_string("LDAP_SERVER_PERMISSIVE_MODIFY_OID","1.2.840.113556.1.4.1413");
5833 oid_add_from_string("LDAP_SERVER_ASQ_OID","1.2.840.113556.1.4.1504");
5834 oid_add_from_string("LDAP_CAP_ACTIVE_DIRECTORY_V51_OID","1.2.840.113556.1.4.1670");
5835 oid_add_from_string("LDAP_SERVER_FAST_BIND_OID","1.2.840.113556.1.4.1781");
5836 oid_add_from_string("LDAP_CAP_ACTIVE_DIRECTORY_LDAP_INTEG_OID","1.2.840.113556.1.4.1791");
5837 oid_add_from_string("msDS-ObjectReference","1.2.840.113556.1.4.1840");
5838 oid_add_from_string("msDS-QuotaEffective","1.2.840.113556.1.4.1848");
5839 oid_add_from_string("LDAP_CAP_ACTIVE_DIRECTORY_ADAM_OID","1.2.840.113556.1.4.1851");
5840 oid_add_from_string("msDS-PortSSL","1.2.840.113556.1.4.1860");
5841 oid_add_from_string("msDS-isRODC","1.2.840.113556.1.4.1960");
5842 oid_add_from_string("msDS-SDReferenceDomain","1.2.840.113556.1.4.1711");
5843 oid_add_from_string("msDS-AdditionalDnsHostName","1.2.840.113556.1.4.1717");
5844 oid_add_from_string("None","1.3.6.1.4.1.1466.101.119.1");
5845 oid_add_from_string("LDAP_START_TLS_OID","1.3.6.1.4.1.1466.20037");
5846 oid_add_from_string("LDAP_CONTROL_VLVREQUEST VLV","2.16.840.1.113730.3.4.9");
5847 oid_add_from_string("LDAP_CONTROL_VLVRESPONSE VLV","2.16.840.1.113730.3.4.10");
5848 oid_add_from_string("LDAP_SERVER_QUOTA_CONTROL_OID","1.2.840.113556.1.4.1852");
5849 oid_add_from_string("LDAP_SERVER_RANGE_OPTION_OID","1.2.840.113556.1.4.802");
5850 oid_add_from_string("LDAP_SERVER_SHUTDOWN_NOTIFY_OID","1.2.840.113556.1.4.1907");
5851 oid_add_from_string("LDAP_SERVER_RANGE_RETRIEVAL_NOERR_OID","1.2.840.113556.1.4.1948");
5854 oid_add_from_string("inetOrgPerson","2.16.840.1.113730.3.2.2");
5856 dissector_add_string("ldap.name", "netlogon", create_dissector_handle(dissect_NetLogon_PDU, proto_cldap));
5857 dissector_add_string("ldap.name", "objectGUID", create_dissector_handle(dissect_ldap_guid, proto_ldap));
5858 dissector_add_string("ldap.name", "supportedControl", create_dissector_handle(dissect_ldap_oid, proto_ldap));
5859 dissector_add_string("ldap.name", "supportedCapabilities", create_dissector_handle(dissect_ldap_oid, proto_ldap));
5860 dissector_add_string("ldap.name", "objectSid", create_dissector_handle(dissect_ldap_sid, proto_ldap));
5861 dissector_add_string("ldap.name", "nTSecurityDescriptor", create_dissector_handle(dissect_ldap_nt_sec_desc, proto_ldap));
5864 /*--- Included file: packet-ldap-dis-tab.c ---*/
5865 #line 1 "./asn1/ldap/packet-ldap-dis-tab.c"
5866 register_ber_oid_dissector("1.2.840.113556.1.4.319", dissect_SearchControlValue_PDU, proto_ldap, "pagedResultsControl");
5867 register_ber_oid_dissector("1.2.840.113556.1.4.473", dissect_SortKeyList_PDU, proto_ldap, "sortKeyList");
5868 register_ber_oid_dissector("1.2.840.113556.1.4.474", dissect_SortResult_PDU, proto_ldap, "sortResult");
5869 register_ber_oid_dissector("1.2.840.113556.1.4.841", dissect_DirSyncControlValue_PDU, proto_ldap, "dirsync");
5870 register_ber_oid_dissector("1.3.6.1.4.1.4203.1.11.1", dissect_PasswdModifyRequestValue_PDU, proto_ldap, "passwdModifyOID");
5871 register_ber_oid_dissector("1.3.6.1.1.8", dissect_CancelRequestValue_PDU, proto_ldap, "cancelRequestOID");
5872 register_ber_oid_dissector("1.3.6.1.4.1.4203.1.9.1.1", dissect_SyncRequestValue_PDU, proto_ldap, "syncRequestOID");
5873 register_ber_oid_dissector("1.3.6.1.4.1.4203.1.9.1.2", dissect_SyncStateValue_PDU, proto_ldap, "syncStateOID");
5874 register_ber_oid_dissector("1.3.6.1.4.1.4203.1.9.1.3", dissect_SyncDoneValue_PDU, proto_ldap, "syncDoneOID");
5875 register_ber_oid_dissector("1.3.6.1.4.1.4203.1.9.1.4", dissect_SyncInfoValue_PDU, proto_ldap, "syncInfoOID");
5876 register_ber_oid_dissector("1.3.6.1.4.1.42.2.27.8.5.1", dissect_PasswordPolicyResponseValue_PDU, proto_ldap, "passwordPolicy");
5879 /*--- End of included file: packet-ldap-dis-tab.c ---*/
5880 #line 2315 "./asn1/ldap/packet-ldap-template.c"
5882 dissector_add_uint_range_with_preference("tcp.port", TCP_PORT_RANGE_LDAP, ldap_handle);
5886 prefs_register_ldap(void)
5888 if(ssl_port != global_ldaps_tcp_port) {
5890 ssl_dissector_delete(ssl_port, ldap_handle);
5892 /* Set our port number for future use */
5893 ssl_port = global_ldaps_tcp_port;
5896 ssl_dissector_add(ssl_port, ldap_handle);
5902 * Editor modelines - http://www.wireshark.org/tools/modelines.html
5907 * indent-tabs-mode: nil
5910 * vi: set shiftwidth=2 tabstop=8 expandtab:
5911 * :indentSize=2:tabSize=8:noTabs=true: