Commit Graph

280 Commits

Author SHA1 Message Date
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Anders Broman bb0eefd834 Fix a cut-n-paste error.
svn path=/trunk/; revision=34866
2010-11-14 14:13:52 +00:00
Anders Broman 2c042dcd15 Use value_string_ext.
svn path=/trunk/; revision=34845
2010-11-11 21:18:15 +00:00
Stig Bjørlykke 34d9ef736b Added an expert info for illegal integer length.
svn path=/trunk/; revision=34820
2010-11-09 12:17:11 +00:00
Stig Bjørlykke c56ac0d6db Removed calls to proto_item_set_expert_flags(), as this will be called
in expert_add_info_format().

svn path=/trunk/; revision=34819
2010-11-09 12:15:55 +00:00
Jeff Morriss e17b9ccec1 Rev 29427 added packet_add_new_data_source() with a comment indicating that
the data source does not need to be allocated if (!tree).

Rev 30158 took the if (!tree) check out indicating that the check was invalid.

So: (since packet_add_new_data_source() now only calls add_new_data_source()),
remove packet_add_new_data_source().

svn path=/trunk/; revision=34717
2010-10-30 16:00:30 +00:00
Guy Harris 17d4d51b7d Make the third argument to a UAT copy callback a size_t (not that any of
the callbacks we have use that argument - is it really needed?).

svn path=/trunk/; revision=34694
2010-10-29 21:11:33 +00:00
Martin Mathieson 9d87437659 Add volatile in several places to gcc warnings.
svn path=/trunk/; revision=34526
2010-10-15 18:41:12 +00:00
Stig Bjørlykke 2b34ed288b Avoid getting BoundsError when trying to decode OCTET STRING or
unknown primitive as constructed ASN.1 BER encoded data.

svn path=/trunk/; revision=34520
2010-10-15 11:10:20 +00:00
Stig Bjørlykke 7c3f2513ee Remove unneeded includes.
svn path=/trunk/; revision=34289
2010-09-30 19:20:59 +00:00
Stig Bjørlykke 65e0721f71 Constructed octet strings may contain zero encodings.
(X.690 chapter 8.7.3)

svn path=/trunk/; revision=34284
2010-09-30 06:19:32 +00:00
Gerald Combs 4c74418400 Attempt to fix the stack overflow reported at
http://seclists.org/bugtraq/2010/Sep/87 .

Unfortunately no one from the NCNIPC pen test team has contacted us or
provided a sample capture so the fix hasn't been verified.

svn path=/trunk/; revision=34111
2010-09-13 18:49:55 +00:00
Stig Bjørlykke 16db2dd4f5 Check if using tree before adding the octet string.
svn path=/trunk/; revision=34055
2010-09-03 08:44:00 +00:00
Stig Bjørlykke 598b89ab7f Added a check for constructed octet string to avoid a loop.
This fixes bug 5154.

svn path=/trunk/; revision=33949
2010-08-27 11:55:14 +00:00
Stig Bjørlykke 8b6c6a3dbf Display constructed octet strings with correct hf_id.
Show octet string fragments as for reassembly.

svn path=/trunk/; revision=33910
2010-08-24 15:08:07 +00:00
Gerald Combs 3a5ba15b4d Rename a variable. "tmp_len" was too similar to "tmp_length".
svn path=/trunk/; revision=33506
2010-07-13 22:49:17 +00:00
Gerald Combs 041cd31c9e Revert get_ber_length() back to r32530, which removes all of the changes
back to and including my attempt to make it iterative. Move its guts
back into try_get_ber_length() and add a recursion level check.

This should fix CVE-2010-2284 and preserve existing behavior without
introducing any new regressions (such as bug 5000).

svn path=/trunk/; revision=33505
2010-07-13 22:41:34 +00:00
Gerald Combs cfe9b05691 Add length checks.
svn path=/trunk/; revision=33488
2010-07-12 17:30:14 +00:00
Gerald Combs edb7f000dc Assume that if we have more than 500 levels of nested indefinite lengths
we have a malformed packet.

svn path=/trunk/; revision=33480
2010-07-09 17:07:34 +00:00
Jeff Morriss 4e76ef92cb For: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4984#c4 : In try_get_ber_length() don't let a negative length make us go backwards. This should eliminate a possible infinite loop and appears to /help/ limit the depth of recursion.
svn path=/trunk/; revision=33471
2010-07-07 22:00:44 +00:00
Jeff Morriss c24f16ad44 Fix infinite recursion reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4984 : In try_get_ber_length() make sure we move forward before recursing.
svn path=/trunk/; revision=33464
2010-07-07 15:52:09 +00:00
Gerald Combs a7df969fb1 Have get_ber_length() set the length to 0 by default. This restores behavior
that was lost recently.

svn path=/trunk/; revision=33402
2010-07-01 16:35:37 +00:00
Graeme Lunt 852d60ca7e When determining a BER length, make sure the BER identifier was marked as constructed if an indefinite length is encountered.
This helps prevent a stack overflow problem reported in Bug 4951.


svn path=/trunk/; revision=33383
2010-06-30 10:06:21 +00:00
Stig Bjørlykke e777398d4f Added expert info for illegal bitstring padding and when bits are set
in the padded area.

svn path=/trunk/; revision=33382
2010-06-30 09:09:18 +00:00
Bill Meier 9427f9f2c3 Hack to prevent checkAPIs.pl from complaining about missing const in
'static value_string syntax_names[...]' 

svn path=/trunk/; revision=33365
2010-06-29 03:43:17 +00:00
Gerald Combs a9650cd851 Don't try to use a NULL tvb in call_ber_oid_callback(). Fixes bug 4950.
svn path=/trunk/; revision=33363
2010-06-29 00:44:41 +00:00
Gerald Combs a514fe61c3 tvb_get_ptr() may not return a valid string. Must I break out the
picture of the cow again?

svn path=/trunk/; revision=33361
2010-06-28 23:11:48 +00:00
Gerald Combs dd4e194304 Make sure dissect_ber_integer() always sets a value.
svn path=/trunk/; revision=33358
2010-06-28 22:13:53 +00:00
Stig Bjørlykke 1c81c60477 Search in user defined oid syntax table before built-in oid table in
call_ber_oid_callback(), so the user can override the defaults in the
"OID Tables".

svn path=/trunk/; revision=33355
2010-06-28 19:06:16 +00:00
Gerald Combs e2c79ddfd0 It looks like dissect_ber_octet_string() is called with the expectation
that out_tvb will always be set (the H.248 dissector does this, at
least). Make sure we do so. Do the same for
dissect_ber_constrained_octet_string().

svn path=/trunk/; revision=33354
2010-06-28 17:26:07 +00:00
Graeme Lunt 342fc4cfb4 After a nudge from Stig (thanks Stig), convert the OID configuration from
GKeyFile (which is not available on Sparc Solaris) to a User Accessible 
Table(UAT). 
This also allows the user to manage the configuration from the Wireshark GUI 
and select the associated syntax from a drop down list.


svn path=/trunk/; revision=33344
2010-06-28 09:33:04 +00:00
Graeme Lunt 14d5a86ee5 The version of glib on Solaris 10 (2.4?) does not support GKeyFile which was
introduced in 2.6. Disable oid table if GKeyFile is not available. 


svn path=/trunk/; revision=33303
2010-06-23 14:26:19 +00:00
Graeme Lunt 1fce0a0ac2 Configuration to allow the definition of an OID name and associated syntax.
It allows the user to:
* Add names and/or syntaxes for OIDs that Wireshark doesn't natively understand
* Override the built-in OID names (e.g. change 'id-at-organization' to 'o')
* Use a special syntax, "ASN.1", that allows a value associated with an OID 
  to be dissected as "unknown ber". (This is a effectively a selective 
  version of the "Decode unexpected tags as BER encoded data" BER option.)

The configuration file is a glib key-value file, with the dotted OID used as
the group, and two keys defined, "name" and "syntax".

A configuration option is added to the BER preferences page. A single 
configuration file may be specified, or a directory may be specified. If a 
directory is specified, then the files with a ".oid" extension will be loaded.

An example configuration file:

[2.5.21.5]
name=attributeTypes
syntax=ASN.1
[2.5.21.6]
name=objectClasses
[2.5.21.7]
name=nameForms
[1.2.840.10040.4.3]
name=id-dsa-with-sha1
[2.5.4.6]
name=c
[2.5.4.10]
name=o
[2.5.4.11]
name=ou
[2.5.4.3]
name=cn
[1.3.32.0.2.0.4.66]
name=Unknown OID
syntax=PrintableString
[0.9.2342.19200300.100.1.10]
name=unknown dn
syntax=DistinguishedName

----

The list of known syntaxes is shown in the "Decode As ..." dialog when 
examining a BER file.


svn path=/trunk/; revision=33300
2010-06-23 11:28:59 +00:00
Graeme Lunt eef8c02bd7 Bug 3597 - implicit octet string that is constructed causes PRES/FTAM dissect failure
Introduced some state to remember last dissected Tag/Length so that they can be recalled if an IMPLICIT tag is encountered and stripped. This allows its to be determined if the value has a constructed value - and so can be reassembled.

In this case, it is a IMPLICIT constructed OCTET STRING at the presentation layer.

Many thanks to Fred Gruman for identifying - and apologies for the delay in commiting.


svn path=/trunk/; revision=33048
2010-06-02 14:42:57 +00:00
Graeme Lunt 3644d0faa7 Updated get_ber_length to handle multiple nested indefinite length encodings.
svn path=/trunk/; revision=33046
2010-06-02 13:33:37 +00:00
Gerald Combs 20914ee220 Make get_ber_length() iterative instead of recursive so we don't overrun the
stack. Discovered by J. Oquendo.

svn path=/trunk/; revision=32922
2010-05-23 23:42:58 +00:00
Stig Bjørlykke dc4ecbf172 Do not give a warning for not implemented OID if value is a "NULL tag".
svn path=/trunk/; revision=32530
2010-04-21 10:05:19 +00:00
Stig Bjørlykke 8f5c4683ea Added an option to try decoding unknown primitives as BER encoded data.
svn path=/trunk/; revision=31740
2010-01-30 17:44:45 +00:00
Stig Bjørlykke 9b2f05da33 Don't try decode an empty octetstring as BER.
svn path=/trunk/; revision=31589
2010-01-20 12:47:26 +00:00
Stig Bjørlykke 174de72350 Moved expert info for bitstring size constraints below bit values.
Enabled bitstring minimum length size check.

svn path=/trunk/; revision=31564
2010-01-19 08:54:13 +00:00
Stig Bjørlykke 6ff81c8f6a Change group for "Unknown bit(s)" expert info to Undecoded.
svn path=/trunk/; revision=31563
2010-01-19 08:11:23 +00:00
Stig Bjørlykke 10466c4bbe Add expert info to unknown bitstring bits when having a named_bits table.
svn path=/trunk/; revision=31554
2010-01-18 20:08:56 +00:00
Anders Broman c4dd31cd87 From Didier Gautheron:
col_clear.diff 
Remove calls to col_clear :
- called twice.
- before functions which also clear the column
- by replacing col_clear + col_append_xxx with col_add_xxx
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4394

svn path=/trunk/; revision=31517
2010-01-13 20:25:10 +00:00
Stig Bjørlykke 6a433058f9 Added check for SIZE constraints in bit-string.
svn path=/trunk/; revision=31447
2010-01-05 11:38:33 +00:00
Stig Bjørlykke e73a89d91a Added option (-C) to check for SIZE constraints in octet-string, integer,
enumerated, sequence-of and set-of types.

Added BER functions to check for SIZE constraints and give expert info warnings.

svn path=/trunk/; revision=31309
2009-12-18 15:18:31 +00:00
Bill Meier 5d68a812ab Fix memory leak: re-init defragmentation tables each time a capture file is (re) opened.
svn path=/trunk/; revision=30589
2009-10-17 21:42:51 +00:00
Anders Broman f0aaa035a4 From Gerasimos Dimitriadis:
TCAP problem with indefinite length 'components' SEQ OF.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4053

svn path=/trunk/; revision=30319
2009-10-04 19:25:46 +00:00
Kovarththanan Rajaratnam 8b515e9340 Switch a bunch of dissectors over to using tvb_new_subset_remaining()
svn path=/trunk/; revision=29446
2009-08-16 12:36:22 +00:00
Kovarththanan Rajaratnam 5d5a5442d6 Don't guard col_set_str (COL_RES_DL_SRC/COL_RES_DL_DST) with col_check
svn path=/trunk/; revision=29343
2009-08-09 07:14:16 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00