From 422bca98883c11c76da95e66a97311b2b4fc7e02 Mon Sep 17 00:00:00 2001 From: Bill Meier Date: Wed, 12 Nov 2008 23:55:52 +0000 Subject: Small changes related to proto_reg_handoff; Use find_dissector; Initialize saved tcp_port pref properly; This should fix a possble bug wherein LDAP over SSL would not be dissected properly. (I don't have a test capture to verify this fix). svn path=/trunk/; revision=26764 --- asn1/ldap/packet-ldap-template.c | 19 +++++++++---------- epan/dissectors/packet-ldap.c | 21 ++++++++++----------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c index faae11ed79..0dfcb7ec16 100644 --- a/asn1/ldap/packet-ldap-template.c +++ b/asn1/ldap/packet-ldap-template.c @@ -210,12 +210,12 @@ static guint global_ldaps_tcp_port = TCP_PORT_LDAPS; static guint tcp_port = 0; static guint ssl_port = 0; -static dissector_handle_t gssapi_handle = NULL; -static dissector_handle_t gssapi_wrap_handle = NULL; -static dissector_handle_t ntlmssp_handle = NULL; -static dissector_handle_t spnego_handle = NULL; -static dissector_handle_t ssl_handle = NULL; -static dissector_handle_t ldap_handle = NULL; +static dissector_handle_t gssapi_handle; +static dissector_handle_t gssapi_wrap_handle; +static dissector_handle_t ntlmssp_handle; +static dissector_handle_t spnego_handle; +static dissector_handle_t ssl_handle; +static dissector_handle_t ldap_handle ; void prefs_register_ldap(void); /* forward declaration for use in preferences registration */ @@ -2145,13 +2145,10 @@ void proto_reg_handoff_ldap(void) { dissector_handle_t cldap_handle; - ldap_handle = create_dissector_handle(dissect_ldap_tcp, proto_ldap); + ldap_handle = find_dissector("ldap"); - dissector_add("tcp.port", global_ldap_tcp_port, ldap_handle); dissector_add("tcp.port", TCP_PORT_GLOBALCAT_LDAP, ldap_handle); - ssl_dissector_add(global_ldaps_tcp_port, "ldap", TRUE); - cldap_handle = create_dissector_handle(dissect_mscldap, proto_cldap); dissector_add("udp.port", UDP_PORT_CLDAP, cldap_handle); @@ -2163,6 +2160,8 @@ proto_reg_handoff_ldap(void) ssl_handle = find_dissector("ssl"); + prefs_register_ldap(); + /* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dsml/dsml/ldap_controls_and_session_support.asp */ oid_add_from_string("LDAP_PAGED_RESULT_OID_STRING","1.2.840.113556.1.4.319"); oid_add_from_string("LDAP_SERVER_SHOW_DELETED_OID","1.2.840.113556.1.4.417"); diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c index 4b3a9f4249..ea96928656 100644 --- a/epan/dissectors/packet-ldap.c +++ b/epan/dissectors/packet-ldap.c @@ -393,12 +393,12 @@ static guint global_ldaps_tcp_port = TCP_PORT_LDAPS; static guint tcp_port = 0; static guint ssl_port = 0; -static dissector_handle_t gssapi_handle = NULL; -static dissector_handle_t gssapi_wrap_handle = NULL; -static dissector_handle_t ntlmssp_handle = NULL; -static dissector_handle_t spnego_handle = NULL; -static dissector_handle_t ssl_handle = NULL; -static dissector_handle_t ldap_handle = NULL; +static dissector_handle_t gssapi_handle; +static dissector_handle_t gssapi_wrap_handle; +static dissector_handle_t ntlmssp_handle; +static dissector_handle_t spnego_handle; +static dissector_handle_t ssl_handle; +static dissector_handle_t ldap_handle ; void prefs_register_ldap(void); /* forward declaration for use in preferences registration */ @@ -5226,13 +5226,10 @@ void proto_reg_handoff_ldap(void) { dissector_handle_t cldap_handle; - ldap_handle = create_dissector_handle(dissect_ldap_tcp, proto_ldap); + ldap_handle = find_dissector("ldap"); - dissector_add("tcp.port", global_ldap_tcp_port, ldap_handle); dissector_add("tcp.port", TCP_PORT_GLOBALCAT_LDAP, ldap_handle); - ssl_dissector_add(global_ldaps_tcp_port, "ldap", TRUE); - cldap_handle = create_dissector_handle(dissect_mscldap, proto_cldap); dissector_add("udp.port", UDP_PORT_CLDAP, cldap_handle); @@ -5244,6 +5241,8 @@ proto_reg_handoff_ldap(void) ssl_handle = find_dissector("ssl"); + prefs_register_ldap(); + /* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dsml/dsml/ldap_controls_and_session_support.asp */ oid_add_from_string("LDAP_PAGED_RESULT_OID_STRING","1.2.840.113556.1.4.319"); oid_add_from_string("LDAP_SERVER_SHOW_DELETED_OID","1.2.840.113556.1.4.417"); @@ -5301,7 +5300,7 @@ proto_reg_handoff_ldap(void) /*--- End of included file: packet-ldap-dis-tab.c ---*/ -#line 2212 "packet-ldap-template.c" +#line 2211 "packet-ldap-template.c" } -- cgit v1.2.3