Commit Graph

23 Commits

Author SHA1 Message Date
Guy Harris 3937e6b70e Fix the type of the "integer" argument to "asn1_uint32_value_decode()",
as per a note by Michael Lum.

svn path=/trunk/; revision=8924
2003-11-09 22:57:52 +00:00
Guy Harris 860376a9ab From Samuel Qu, Michael Lum, and Jeff Morriss: TCAP support, and
"asn_id_decode1()" variant of "asn_id_decode()".

svn path=/trunk/; revision=8586
2003-10-02 06:13:29 +00:00
Guy Harris ebd1b7a744 From Matthijs Melchior: In "asn1_string_value_decode()", put in a
trailing '\0', to simplify use of the resulting data as a C string.

svn path=/trunk/; revision=8313
2003-08-29 19:13:28 +00:00
Guy Harris 0caeb12499 From Matthijs Melchior: when setting "eoc" in "asn1_bits_decode()", get
the offset from before the byte with the number of unused bits is
fetched, so that we count that byte.

svn path=/trunk/; revision=7920
2003-06-24 06:05:47 +00:00
Guy Harris 57958693a1 Expand some comments.
Do the "tvb_ensure_bytes_exist()" check, and the check for a zero-length
bit string, in the code to process a bit string.

svn path=/trunk/; revision=7659
2003-05-10 02:00:41 +00:00
Guy Harris 4b4b030e51 From Matthijs Melchior: fix "asn1_bits_decode()", and make its API more
closely resemble that of other decode routines.

svn path=/trunk/; revision=7589
2003-04-28 00:31:26 +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
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 73ef5a2753 WinPcap 2.3's <pcap.h> includes <packet32.h>, and WinPcap 2.3's
<packet32.h> includes <winsock2.h>; we include that rather than
<winsock.h>, to avoid errors due to conflicting declarations in
<winsock.h> and <winsock2.h>.

svn path=/trunk/; revision=5742
2002-06-23 10:32:36 +00:00
Guy Harris 3a407d9567 From Chris Waters: don't use "bool" as a variable name or structure
member, as it's a C++ keyword.

svn path=/trunk/; revision=5677
2002-06-16 00:53:20 +00:00
Guy Harris b6e941027f Add a "tvb_ensure_bytes_exist()", which is like "tvb_bytes_exist()" only
it throws the appropriate exception if the bytes don't exist.  Use it in
the GIOP and ASN.1 code to check whether the bytes to be copied to a
buffer exist before allocating the buffer.

Make "check_offset_length_no_exception()" check for an overflow, so that
it can be used in "tvb_ensure_bytes_exist()" and do all the checking
that the code "tvb_ensure_bytes_exist()" replaces did.

Make "get_CDR_wchar()" return a "gint", so that if the length octet it
fetched has a value between 128 and 255, the length can be returned
correctly.

Fix some comments not to specify the exception thrown by various
routines that can throw various exceptions.

svn path=/trunk/; revision=5453
2002-05-13 01:24:47 +00:00
Guy Harris de0d26aea7 Fix another problem found by the PROTOS captures - in
"asn1_string_value_decode()", don't pass "g_malloc()" an argument of 0,
as "g_malloc()" will return NULL in that case, and the callers of
"asn1_string_value_decode()" aren't necessarily prepared for a null
argument.

svn path=/trunk/; revision=4876
2002-03-05 09:18:58 +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 20c4601ef8 Be more paranoid, and check to make sure the length of the string or OID
isn't so large as to cause the end offset to wrap around.

svn path=/trunk/; revision=4766
2002-02-21 02:05:53 +00:00
Guy Harris 5f04fd0379 Throw in some sanity checking to make sure a bogus length in an ASN.1
string or OID data type doesn't cause us to hand a bogus length to a
memory allocator.

svn path=/trunk/; revision=4765
2002-02-20 22:46:21 +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 b0e06bd8d1 Tvbuffify the ASN.1 code and the Kerberos, LDAP, and SNMP dissectors.
Clean up some problems that revealed.

svn path=/trunk/; revision=3301
2001-04-15 07:30:03 +00:00
Guy Harris 60f9476740 Rename "asn1_octet_string_value_decode()" to
"asn1_string_value_decode()", as it can be used for various character
string types as well.

Turn "asn1_octet_string_decode()" into "asn1_string_decode()", which
takes an additional argument giving the tag expected for the string in
question, and make "asn1_octet_string_decode()" a wrapper around it.

Clean up the ASN.1 dissection in the Kerberos dissector, making more use
of the code in "asn1.c", wrapping more operations up in macros, and
doing some more type checking.

Use "REP" rather than "RESP" in names and strings; "REP" is what the
Kerberos spec uses.

Make the routines in the Kerberos dissector not used outside that
dissector static.

Fix some problems with the dissection of strings in the Kerberos
dissector (it was extracting the data from the wrong place in the
packet).

In Kerberos V5, the "kvno" item in the EncryptedData type is optional;
treat it as such.

Treat integers as unsigned in the Kerberos dissector.

svn path=/trunk/; revision=2777
2000-12-24 09:10:12 +00:00
Guy Harris 5a8b587fc6 In "asn1_oid_value_decode()", set "size" directly from "enc_len", rather
than setting "eoc" from "asn1->pointer" and "enc_len" and then setting
"size" from "eoc" and "asn1->pointer", to make it clearer how it's being
set.

svn path=/trunk/; revision=2090
2000-06-26 00:08:48 +00:00
Guy Harris 0b5adee493 Note that we may want to add support for the constructed encoding of
octet strings, as well as the primitive encoding (if we ever run into a
protocol where the constructed encoding is allowed).

svn path=/trunk/; revision=1751
2000-03-27 08:26:23 +00:00
Gilbert Ramirez 339d67b043 Merge in the final code to make Ethereal run on Win32, compiled
with MSVC 6.0 and 'nmake', the make tool that comes with MSVC.

It compiles, links, and runs. It doesn't run correctly. There's a problem
when reading files. I'm getting short reads.  I'm not linking in zlib or
libsnmp because it first needs to be debugged.

I changed the plugin code to use gmodule instead of libltdl, but the
Unix build still links ethereal against libltdl. I'll fix that tonight; sorry
about leaving it in such a sad state, but I wanted to check in this code
before I left work on a Friday night. Ethereal still works, but the
building is less than optimal.

svn path=/trunk/; revision=1479
2000-01-15 00:23:13 +00:00
Guy Harris 78b64f0262 Make the SNMP dissector use the ASN.1 code, rather than the SNMP library
code, to dissect SNMP PDUs; use the SNMP library code only to translate
OIDs into strings.

Put into the ASN.1 code an annoying hack to cope with the fact that UCD
SNMP makes an OID out of "u_long"s whilst CMU SNMP makes it out of
"u_int"s - have the ASN.1 code make it out of "subid_t"s, and typedef
"subid_t" appropriately depending on the SNMP library you have.

Eventually, we should be able to use "libsmi" instead of a full-blown
SNMP library, and thus possibly work around various aggravations with
the SNMP libraries.

svn path=/trunk/; revision=1280
1999-12-10 09:49:29 +00:00
Guy Harris af8888e47c Check in the ASN.1 code for reference purposes, although the SNMP
dissector doesn't use it yet - Nathan Neulinger might use it for a
Kerberos 5 dissector, and it might be of use for other dissectors as
well.

svn path=/trunk/; revision=1215
1999-12-05 07:50:01 +00:00