Put in the beginnings of checks for ASN.1 dissection errors.
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 31 Mar 2000 10:22:24 +0000 (10:22 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 31 Mar 2000 10:22:24 +0000 (10:22 +0000)
commitb33af548ddbad3b725b8dc03006f47c015ba2ae4
tree81635d6fa885890d4dd145cda1c23c2558234761
parent39ed5a5c51b0cc7965cce92105103b14757b1ebe
Put in the beginnings of checks for ASN.1 dissection errors.

The "present" choice in the type Filter is, in LDAP V2,
AttributeType, and, in LDAP V3, it's AttributeDescription.  Both of
those are just LDAPString, which is, in turn, OCTET STRING, so it should
be required to have the primitive representation (unless and until we
add support for the constructed representation of octet strings - but
RFC 1777, the LDAP V2 spec, says

   (2)  Bitstrings and octet strings and all character string types
        will be encoded in the primitive form only.

and RFC 2251, the LDAP V3 spec, says

   (2) OCTET STRING values will be encoded in the primitive form only.

so we shouldn't ever see it with the constructed representation), and be
parsed with "asn1_octet_string_value_decode()", as, by that point, we've
already dissected the ASN.1 id and length.

Put the bind authorization type into the protocol tree before switching
on the type, so that it goes in even if it's not something we yet
dissect, and actually pass it as an argument to "proto_tree_add_item()"
(alas, "proto_tree_add_item()" is a varargs function, so this error
couldn't have been detected by the compiler).

When not constructing a protocol tree, quit "dissect_ldap()" after
dissecting the first operation - we don't need to dissect the others.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1768 f5534014-38df-0310-8fa8-9805f1628bb7
packet-ldap.c