aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ber.c
AgeCommit message (Collapse)AuthorFilesLines
2011-05-20Add #include <stdlib.h> to files which reference fcns declared in stdlib.h;wmeier1-0/+1
(In many cases I previously incorrectly removed the #include <stdlib.h>). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37334 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-27From Yaniv Kaul:etxrab1-10/+4
Fix 'set but not used' errors that GCC 4.6 emits. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36892 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-06Fixed blurb for BER Error.stig1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36495 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-06Made "BER Error" filterable.stig1-51/+55
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36494 f5534014-38df-0310-8fa8-9805f1628bb7
2011-03-30remove two pointless const in castssahlberg1-1/+1
coverity 580 and 581 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36407 f5534014-38df-0310-8fa8-9805f1628bb7
2011-03-04Fix warningkukosa1-2/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36139 f5534014-38df-0310-8fa8-9805f1628bb7
2011-03-04Check only first 14 digits of GeneralizedTime which are fixed, next parts ↵kukosa1-2/+5
are optional git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36138 f5534014-38df-0310-8fa8-9805f1628bb7
2011-02-17Fix some Visual C++ analysis warnings.gerald1-2/+10
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35988 f5534014-38df-0310-8fa8-9805f1628bb7
2011-02-14Put error messages and expert info for illegal UTCTime elements as astig1-18/+20
subtree on the UTCTime element. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35945 f5534014-38df-0310-8fa8-9805f1628bb7
2011-01-30Introduce "Fragment count" filter element for all protocols doing reassembly.stig1-0/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35705 f5534014-38df-0310-8fa8-9805f1628bb7
2011-01-03Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5537 :morriss1-1/+1
Don't go modifying the bitstring if its length is 0 (meaning that there is only the NULL terminator). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35342 f5534014-38df-0310-8fa8-9805f1628bb7
2011-01-02Note that this is ultimately not necessarily the right fix.guy1-0/+8
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35331 f5534014-38df-0310-8fa8-9805f1628bb7
2011-01-02For those cases where we interpret the contents of an OCTET STRING,guy1-4/+115
which could be of arbitrary length - even if it's not supposed to be! - as a value of some other type, by adding them as a registered field, first check to make sure the length of the field is appropriate for the type and, if not, show a dissection error, rather than showing a dissector-bug assertion when we call proto_tree_add_item(). This fixes a bunch of dissector-bug assertions that show up with malformed BER-encoded packets. Also, fix a typo, and expand a comment. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35330 f5534014-38df-0310-8fa8-9805f1628bb7
2010-12-20Rename the routines that handle dissector tables with unsigned integerguy1-1/+1
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.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35224 f5534014-38df-0310-8fa8-9805f1628bb7
2010-11-14Fix a cut-n-paste error.etxrab1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34866 f5534014-38df-0310-8fa8-9805f1628bb7
2010-11-11Use value_string_ext.etxrab1-8/+14
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34845 f5534014-38df-0310-8fa8-9805f1628bb7
2010-11-09Added an expert info for illegal integer length.stig1-1/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34820 f5534014-38df-0310-8fa8-9805f1628bb7
2010-11-09Removed calls to proto_item_set_expert_flags(), as this will be calledstig1-49/+0
in expert_add_info_format(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34819 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-30Rev 29427 added packet_add_new_data_source() with a comment indicating thatmorriss1-1/+1
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(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34717 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-29Make the third argument to a UAT copy callback a size_t (not that any ofguy1-1/+1
the callbacks we have use that argument - is it really needed?). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34694 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-15Add volatile in several places to gcc warnings.martinm1-4/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34526 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-15Avoid getting BoundsError when trying to decode OCTET STRING orstig1-10/+18
unknown primitive as constructed ASN.1 BER encoded data. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34520 f5534014-38df-0310-8fa8-9805f1628bb7
2010-09-30Remove unneeded includes.stig1-3/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34289 f5534014-38df-0310-8fa8-9805f1628bb7
2010-09-30Constructed octet strings may contain zero encodings.stig1-3/+6
(X.690 chapter 8.7.3) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34284 f5534014-38df-0310-8fa8-9805f1628bb7
2010-09-13Attempt to fix the stack overflow reported atgerald1-13/+25
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34111 f5534014-38df-0310-8fa8-9805f1628bb7
2010-09-03Check if using tree before adding the octet string.stig1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34055 f5534014-38df-0310-8fa8-9805f1628bb7
2010-08-27Added a check for constructed octet string to avoid a loop.stig1-1/+6
This fixes bug 5154. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33949 f5534014-38df-0310-8fa8-9805f1628bb7
2010-08-24Display constructed octet strings with correct hf_id.stig1-13/+82
Show octet string fragments as for reassembly. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33910 f5534014-38df-0310-8fa8-9805f1628bb7
2010-07-13Rename a variable. "tmp_len" was too similar to "tmp_length".gerald1-4/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33506 f5534014-38df-0310-8fa8-9805f1628bb7
2010-07-13Revert get_ber_length() back to r32530, which removes all of the changesgerald1-61/+29
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). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33505 f5534014-38df-0310-8fa8-9805f1628bb7
2010-07-12Add length checks.gerald1-2/+18
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33488 f5534014-38df-0310-8fa8-9805f1628bb7
2010-07-09Assume that if we have more than 500 levels of nested indefinite lengthsgerald1-3/+16
we have a malformed packet. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33480 f5534014-38df-0310-8fa8-9805f1628bb7
2010-07-07For: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4984#c4 : In ↵morriss1-15/+20
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33471 f5534014-38df-0310-8fa8-9805f1628bb7
2010-07-07Fix infinite recursion reported in ↵morriss1-56/+57
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4984 : In try_get_ber_length() make sure we move forward before recursing. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33464 f5534014-38df-0310-8fa8-9805f1628bb7
2010-07-01Have get_ber_length() set the length to 0 by default. This restores behaviorgerald1-5/+5
that was lost recently. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33402 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-30When determining a BER length, make sure the BER identifier was marked as ↵gal1-10/+16
constructed if an indefinite length is encountered. This helps prevent a stack overflow problem reported in Bug 4951. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33383 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-30Added expert info for illegal bitstring padding and when bits are setstig1-1/+13
in the padded area. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33382 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-29Hack to prevent checkAPIs.pl from complaining about missing const inwmeier1-1/+3
'static value_string syntax_names[...]' git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33365 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-29Don't try to use a NULL tvb in call_ber_oid_callback(). Fixes bug 4950.gerald1-0/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33363 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-28tvb_get_ptr() may not return a valid string. Must I break out thegerald1-2/+2
picture of the cow again? git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33361 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-28Make sure dissect_ber_integer() always sets a value.gerald1-0/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33358 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-28Search in user defined oid syntax table before built-in oid table instig1-4/+5
call_ber_oid_callback(), so the user can override the defaults in the "OID Tables". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33355 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-28It looks like dissect_ber_octet_string() is called with the expectationgerald1-4/+6
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(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33354 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-28After a nudge from Stig (thanks Stig), convert the OID configuration from gal1-106/+105
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33344 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-23The version of glib on Solaris 10 (2.4?) does not support GKeyFile which wasgal1-0/+15
introduced in 2.6. Disable oid table if GKeyFile is not available. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33303 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-23Configuration to allow the definition of an OID name and associated syntax.gal1-7/+131
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33300 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-02Bug 3597 - implicit octet string that is constructed causes PRES/FTAM ↵gal1-12/+76
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33048 f5534014-38df-0310-8fa8-9805f1628bb7
2010-06-02Updated get_ber_length to handle multiple nested indefinite length encodings.gal1-38/+20
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33046 f5534014-38df-0310-8fa8-9805f1628bb7
2010-05-23Make get_ber_length() iterative instead of recursive so we don't overrun thegerald1-22/+56
stack. Discovered by J. Oquendo. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32922 f5534014-38df-0310-8fa8-9805f1628bb7
2010-04-21Do not give a warning for not implemented OID if value is a "NULL tag".stig1-1/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32530 f5534014-38df-0310-8fa8-9805f1628bb7