Commit Graph

73 Commits

Author SHA1 Message Date
Guy Harris b70ed7093e Before checking for SASL security stuff, make sure the bytes you're
going to check exist.

Doing so arranges that "tvb_reported_length_remaining(tvb, offset) is >=
5 (unless the reported length is less than the data length, but that
"shouldn't happen").  Instead of comparing "tvb_get_ntohl(tvb, offset) -
4" against "tvb_reported_length_remaining(tvb, offset)", which runs the
risk of giving a bogus answer if "tvb_get_ntohl(tvb, offset)" is < 4,
compare "tvb_get_ntohl(tvb, offset) against
"tvb_reported_length_remaining(tvb, offset)-4", as the latter is
guaranteed to be > 0 (and cast the latter expression to get rid of the
signed/unsigned comparison warning that caused me to notice this issue
in the first place).

svn path=/trunk/; revision=9738
2004-01-19 22:58:59 +00:00
Ronnie Sahlberg c270a9a035 Update to CLDAP
dissect the CLDAP netlogon rpc call

svn path=/trunk/; revision=9730
2004-01-19 10:54:06 +00:00
Guy Harris 7993e1aa2e From Ronnie Sahlberg: if the GSSAPI token is empty, don't dissect it.
svn path=/trunk/; revision=9344
2003-12-18 18:18:50 +00:00
Ronnie Sahlberg 93ad968e12 update to ldap.
some implementations specify GSSAPI in the bind call.
the encapsulation seems to be the same as GSS-SPNEGO so handle it the same way

svn path=/trunk/; revision=9169
2003-12-04 08:13:27 +00:00
Ronnie Sahlberg 6073e3b265 Not all LDAP PDUs are aligned to the start of a TCP segment.
If we failed to dissect the GSS-SPNEGO blob it probably means that the segment
is somewhere in the middle of an LDAP PDU.

Just bail out and stop dissecting the PDU instead of aborting ethereal completely
using g_assert() since this is not really a pathological error, its just something that can and will happen normally.

svn path=/trunk/; revision=8925
2003-11-10 07:44:47 +00:00
Ronnie Sahlberg 7b14d3a754 In some captures we might have already established and BOUND LDAP
session where GSS-SPNEGO is used.
If we havent seen the BIND call ethereal would assume it is
vanilla non-GSS-SPNEGO LDAP and would fail to decode the packet.

Add heuristics to the LDAP dissector so that
IF the first 4 bytes of the LDAP PDU looks like ity could be a length field
and IF the fifth byte has the value 0x60
then assume what we have is GSS-SPNEGO and assume this and all further commands on this session is GSS-SPNEGO as well.

svn path=/trunk/; revision=8904
2003-11-07 04:03:44 +00:00
Ronnie Sahlberg 3a88f0ceba Update to LDAP and TCP
LDAP messages that span multiple segments will throw an exception unless we have reassembly enabled.

Update TCP so that IF an exception was thrown that we still pick up any hints
provided by the subdissector about where the next PDU starts.

Update LDAP so that it will rpovide hints to TCP about where the next LDAP PDU starts in the sequence number space.

Thus now ethereal can find and dissect LDAP PDUs that starts somewhere in the middle of a TCP segment.

svn path=/trunk/; revision=8895
2003-11-06 09:18:46 +00:00
Guy Harris 83dd8480b8 A "GHashFunc()" returns a "guint", not a "gint".
svn path=/trunk/; revision=8887
2003-11-05 20:10:00 +00:00
Ronnie Sahlberg f16f83b154 update for LDAP
measure the response time for some LDAP commands and
add a service response time dialog for it

svn path=/trunk/; revision=8885
2003-11-05 09:04:17 +00:00
Guy Harris e956aac299 Sigh. I think I once tried making the last argument to "col_set_str()"
be a "const gchar *", and it ended up being like pulling a thread out of
a sweater - more things had to change, which meant still more things had
to change, and I might've even run into something that didn't change
very well at all.  (Or perhaps that was constifying something else.)

For now, we just cast away the constness in calls to "col_set_str()";
the column code won't actually overwrite the string.

svn path=/trunk/; revision=8174
2003-08-17 00:52:03 +00:00
Tim Potter 50765130a6 Put CLDAP instead of LDAP in COL_INFO for LDAP over UDP.
svn path=/trunk/; revision=8161
2003-08-12 20:14:05 +00:00
Guy Harris 275c1a3a7e From Bernd Leibing: catch another place where we weren't checking
whether the domain name was null before putting it into the Info column.

svn path=/trunk/; revision=8114
2003-07-31 18:09:08 +00:00
Guy Harris 657700ca0d "read_string()" can return a null pointer for the string, so check for
that.

svn path=/trunk/; revision=8103
2003-07-30 08:08:52 +00:00
Guy Harris 1cd5aad5eb Put in an XXX comment about the code to remember the number of results
between the LDAP_RES_SEARCH_ENTRY and LDAP_RES_SEARCH_RESULT messages
depending on those messages occurring in the same frame.

svn path=/trunk/; revision=8044
2003-07-18 06:12:43 +00:00
Tim Potter f4950ee8d6 COL_INFO goodies for ldap dissector:
- display DN in COL_INFO for bindi, search and add requests
  - display errors in COL_INFO for all replies
  - for search entries, display the number of results returned
  - display the message type in the "top level" protocol item

svn path=/trunk/; revision=8021
2003-07-14 23:47:32 +00:00
Tim Potter 8a8ea353c8 The Windows 2000 global catalog is LDAP on TCP port 3268, as per IANA assigned
port numbers document.

svn path=/trunk/; revision=7961
2003-07-03 01:52:11 +00:00
Tim Potter 5a0b626674 Dissect LDAPv3 search result references (s4.5.3 in rfc 2251).
svn path=/trunk/; revision=7959
2003-07-02 04:03:27 +00:00
Guy Harris 5e1c267688 Each LDAP message gets a top-level LDAP tree of its own; there's no need
for a subtree for the message.

svn path=/trunk/; revision=7814
2003-06-09 07:45:36 +00:00
Guy Harris 5c6ec9109d From Jean-Baptiste Marchand: fix typo in value_string table for LDAP
message types.

svn path=/trunk/; revision=7595
2003-04-29 02:15:32 +00:00
Guy Harris 0c743e4338 From Tony Schene: after freeing saved authentication mechanism strings
in the "auth_info_items" list, and free all the items in that list, we
need to null out the pointer to that list to indicate that it's been
emptied out.

svn path=/trunk/; revision=7563
2003-04-25 21:19:10 +00:00
Guy Harris c9488831e2 From Jean-Baptiste Marchand: put the LDAP message ID and message type
into the protocol tree as visible fields.

svn path=/trunk/; revision=7515
2003-04-21 07:58:16 +00:00
Guy Harris a32fd64663 Don't dissect SASL stuff as GSS_Wrapped unless we're actually using
GSS-SPNEGO.

svn path=/trunk/; revision=6693
2002-11-28 07:01:30 +00:00
Guy Harris 35eefef60a Handle GSS_Wrap header information as well as context-level tokens. A
call to "gssapi_init_oid()" supplies both dissectors for context-level
tokens and GSS_Wrap header information; the latter dissector should
return the number of bytes of header information, so that if the header
information and the message for the protocol that's using GSSAPI are
treated as a single blob of data (as is the case with LDAP, but not with
DCE RPC, for example), the dissector for the protocol using GSSAPI knows
where to start dissecting.

We associate a pointer to the entire data structure for the OID, not the
handle for context-level token dissector for the OID, with conversations
and frames.

Make the dissector for NTLMSSP verifiers be the handler for GSS_Wrap
stuff for NTLMSSP, and add support for GSS_Wrap stuff for Kerberos.

Support SASL GSS-SPNEGO wrapping of LDAP messages.  (XXX - this should
really check for GSS-SPNEGO.)

svn path=/trunk/; revision=6692
2002-11-28 06:48:42 +00:00
Guy Harris bf261bb4e6 Try to handle LDAP messages encapsulated inside a SASL security layer.
Reorganize the desegmentation to match a bit more closely the
desegmentation code in "tcp_dissect_pdus()" (eventually, we should see
if we can just use that code).

svn path=/trunk/; revision=6676
2002-11-27 04:59:56 +00:00
Guy Harris a1c648718a From Jason Greene:
This patch fixes decoding of the newSuperior attribute of an
	LDAPv3 modrdn request.  The current implementation attempts to
	decode the attribute as an LDAPDN (Octext String, 0x4), when its
	definition is actually Context 0 (0x80).

svn path=/trunk/; revision=6672
2002-11-25 19:20:44 +00:00
Guy Harris 99a0902ae1 From Ronald Henderson: in LDAP dissector, handle Sequence Of header
being split across TCP segments.

svn path=/trunk/; revision=6618
2002-11-12 21:37:35 +00:00
Guy Harris 8b5beb7817 If we see SASL authentication in a bind request, attach to the
conversation a data structure containing the authentication type and
mechanism, and use that to dissect the credentials in subsequent bind
responses.

Call the bind request and response dissectors regardless of whether
we're building a protocol tree or not, so that we call the
authentication subdissectors.

"read_string()" doesn't return anything through the string-pointer
argument if the string is zero-length; handle those cases.

svn path=/trunk/; revision=6241
2002-09-09 23:41:12 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Guy Harris 1fba4891a1 Dissect SASL credentials.
svn path=/trunk/; revision=6087
2002-08-26 09:21:54 +00:00
Tim Potter 5529d0e598 Dissect udp port 389 which is connectionless LDAP as implemented by
Microsoft.  It would be nice if this proto was called CLDAP in the protocol
field - maybe later.

svn path=/trunk/; revision=6041
2002-08-21 02:18:34 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will
hopefully not cause any problems under MSVC++, as those files using
struct timeval still include wtap.h, which still includes winsock2.h.

svn path=/trunk/; revision=5932
2002-08-02 23:36:07 +00:00
Guy Harris 76e8a255f6 Note that not all attribute values are text strings.
svn path=/trunk/; revision=5406
2002-05-06 02:12:36 +00:00
Guy Harris d5f04f86bf Get rid of an unused variable.
svn path=/trunk/; revision=5060
2002-03-31 22:17:37 +00:00
Guy Harris 2c3d2f6db0 Report ASN.1 BER parsing errors closer to the point at which they're
detected, so we do a better job of reporting the item with the problem.

svn path=/trunk/; revision=4853
2002-03-03 01:26:01 +00:00
Guy Harris dae2c9c510 As there's nothing to dissect for LDAP_REQ_UNBIND, set "ret" to
ASN1_ERR_NOERROR, as you can't have a dissection error if you've
dissected nothing.

When dissecting a Bind reply, set "ret" to the return value of
"dissect_ldap_response_bind()", so errors get reported properly.

svn path=/trunk/; revision=4851
2002-03-02 21:51:52 +00:00
Guy Harris 09ed04f29b Don't check the message type if it's not of class ASN1_APL; instead,
just display the message type and body as an error.

If the message type isn't a type we dissect, display the "Unknown
message type" entry with the right offset and length.

svn path=/trunk/; revision=4850
2002-03-02 21:28:19 +00:00
Guy Harris c6a1c88214 Treat LDAP_REQ_UNBIND as a request with nothing in it, not as an unknown
request type.

Put the request types in order in the switch statement.

svn path=/trunk/; revision=4849
2002-03-02 21:07:31 +00:00
Guy Harris 1504859258 Have the routines that supply a pointer to a newly-constructed item
always set that pointer if they return ASN1_ERR_NOERROR.  Have the
routines that call them use the value only if the routine returns
ASN1_ERR_NOERROR.  Don't bother setting the pointer before calling the
routine.

Report unknown modify operation types.

svn path=/trunk/; revision=4834
2002-03-01 03:02:36 +00:00
Guy Harris d8a08e186c Add a routine to "asn1.c" to translate ASN1_ERR_ values to strings. Use
that in the SNMP dissector.

Check the return values of ASN.1 routines in the LDAP dissector, and
have all the subroutines in that disesctor that can return error
indications return ASN1_ERR_ values.

Have the routines that can supply a pointer to a newly-created
protocol-tree item use the right type for items ("proto_item *", not
"proto_tree *", even though they are, at least currently, typedefs for
the same type), and use "proto_item" for the type of the item a pointer
to which is passed to those routines.

Before calling those routines, set the item pointer to null, in case the
routine fails.

Don't check the return value of "parse_filter_strings()" against -1 -
that routine can't return -1.

svn path=/trunk/; revision=4833
2002-03-01 02:48:10 +00:00
Guy Harris eb2d6593dc Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls in
arguments to "proto_tree_add_text()", and to "proto_tree_add_XXX()" calls
that add FT_NONE or FT_PROTO items to the protocol tree, with -1.

Replace some calls to "tvb_length()" or "tvb_length_remaining()" with
calls to "tvb_reported_length()" and "tvb_reported_length_remaining()",
as those give the actual length of the data in the packet, not just the
data that happened to be captured.

svn path=/trunk/; revision=4605
2002-01-24 09:20:54 +00:00
Guy Harris ee5ca25d31 Include files from the "epan" directory and subdirectories thereof with
"epan/..." pathnames, so as to avoid collisions with header files in any
of the directories in which we look (e.g., "proto.h", as some other
package has its own "proto.h" file which it installs in the top-level
include directory).

Don't add "-I" flags to search "epan", as that's no longer necessary
(and we want includes of "epan" headers to fail if the "epan/" is left
out, so that we don't re-introduce includes lacking "epan/").

svn path=/trunk/; revision=4586
2002-01-21 07:37:49 +00:00
Guy Harris d520b16754 Give each LDAP packet its own top-level protocol tree item. (This also
means if there are no complete LDAP packets in a TCP segment, there is
no LDAP top-level protocol tree item, which is as it should be.)

svn path=/trunk/; revision=4539
2002-01-14 03:01:13 +00:00
Guy Harris cbd0ae1706 Add support for TCP desegmentation.
svn path=/trunk/; revision=4538
2002-01-14 02:50:28 +00:00
Guy Harris 23319ff023 Move the pointer to the "column_info" structure in the "frame_data"
structure to the "packet_info" structure; only stuff that's permanently
stored with each frame should be in the "frame_data" structure, and the
"column_info" structure is not guaranteed to hold the column values for
that frame at all times - it was only in the "frame_data" structure so
that it could be passed to dissectors, and, as all dissectors are now
passed a pointer to a "packet_info" structure, it could just as well be
put in the "packet_info" structure.

That saves memory, by shrinking the "frame_data" structure (there's one
of those per frame), and also lets us clean up the code a bit.

svn path=/trunk/; revision=4370
2001-12-10 00:26:21 +00:00
Guy Harris bced8711f6 Make "dissector_add()", "dissector_delete()", and "dissector_change()"
take a dissector handle as an argument, rather than a pointer to a
dissector function and a protocol ID.  Associate dissector handles with
dissector table entries.

svn path=/trunk/; revision=4308
2001-12-03 04:00:26 +00:00
Gilbert Ramirez 6de396c4a8 Fix the rest of the signed/unsigned comparison warnings.
svn path=/trunk/; revision=4088
2001-10-26 18:28:17 +00:00
Guy Harris 8412393197 From Joerg Mayer: explicitly fill in all members of a
"header_field_info" structure, including the ones that are later set by
the routines to register fields.

svn path=/trunk/; revision=3561
2001-06-18 02:18:27 +00:00
Guy Harris 9862028929 Only set the Info column to an error indication if we haven't already
put a packet description there.

svn path=/trunk/; revision=3405
2001-05-08 19:50:29 +00:00
Guy Harris 2b5bf3b6dc Additional LDAP checks for invalid packets, from Scott Renfro.
svn path=/trunk/; revision=3404
2001-05-08 19:46:32 +00:00
Guy Harris 88383c28a2 Get rid of an unused variable, and fix a typo in a comment.
svn path=/trunk/; revision=3302
2001-04-15 07:35:26 +00:00