aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ber.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-28Squelsh warnings.etxrab1-4/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40025 f5534014-38df-0310-8fa8-9805f1628bb7
2011-11-22Move some comments around to make it more boilerplate like.jake1-35/+35
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39992 f5534014-38df-0310-8fa8-9805f1628bb7
2011-11-19Get rod of " warning: identifier ‘class’ conflicts with C++ keyword"etxrab1-134/+134
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39945 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-30Increase the size of a unknown INTEGER to FT_INT64 to be able to showstig1-1/+1
negative integers and integers up to MAXINT64. We still don't support integers between MAXINT64 and MAXUINT64, which would be 9 bytes long. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39673 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-16Do some conversions of proto_tree_add_item() 'encoding' arg.wmeier1-1/+1
(previously missed). 57 FT_BOOLEAN: FALSE-->ENC_BIG_ENDIAN 31 FT_BOOLEAN: TRUE-->ENC_LITTLE_ENDIAN 10 FT_BYTES: ENC_BIG_ENDIAN-->ENC_NA 1 FT_BYTES: ENC_LITTLE_ENDIAN-->ENC_NA 21 FT_BYTES: FALSE-->ENC_NA 2 FT_BYTES: TRUE-->ENC_NA 2 FT_IPXNET: ENC_BIG_ENDIAN-->ENC_NA 6 FT_IPv6: ENC_BIG_ENDIAN-->ENC_NA 1 FT_IPv6: FALSE-->ENC_NA 6 FT_NONE: ENC_BIG_ENDIAN-->ENC_NA 19 FT_NONE: FALSE-->ENC_NA 3 FT_NONE: TRUE-->ENC_NA 1 FT_STRING: ENC_BIG_ENDIAN-->ENC_ASCII|ENC_NA 1 FT_STRING: ENC_LITTLE_ENDIAN-->ENC_ASCII|ENC_NA 5 FT_STRING: FALSE-->ENC_ASCII|ENC_NA 1 FT_STRING: TRUE-->ENC_ASCII|ENC_NA 4 FT_STRINGZ: ENC_NA-->ENC_ASCII|ENC_NA 8 FT_STRINGZ: FALSE-->ENC_ASCII|ENC_NA 1 FT_INT32: FALSE-->ENC_BIG_ENDIAN 1 FT_INT32: TRUE-->ENC_LITTLE_ENDIAN 11 FT_UINT8: 0-->ENC_BIG_ENDIAN 111 FT_UINT8: FALSE-->ENC_BIG_ENDIAN 17 FT_UINT8: TRUE-->ENC_LITTLE_ENDIAN 1 FT_UINT16: 0-->ENC_BIG_ENDIAN 68 FT_UINT16: FALSE-->ENC_BIG_ENDIAN 18 FT_UINT16: TRUE-->ENC_LITTLE_ENDIAN 4 FT_UINT24: FALSE-->ENC_BIG_ENDIAN 70 FT_UINT32: FALSE-->ENC_BIG_ENDIAN 1 FT_UINT32: TRUE-->ENC_LITTLE_ENDIAN 4 FT_UINT64: FALSE-->ENC_BIG_ENDIAN 1 FT_UINT64: TRUE-->ENC_LITTLE_ENDIAN 1 FT_UINT_STRING: FALSE-->ENC_ASCII|ENC_BIG_ENDIAN git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39442 f5534014-38df-0310-8fa8-9805f1628bb7
2011-09-26Get rid of check_col, while at it set ENC.etxrab1-24/+20
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39146 f5534014-38df-0310-8fa8-9805f1628bb7
2011-08-29Add an expert info warning for integers encoded with too many octets.stig1-1/+16
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38771 f5534014-38df-0310-8fa8-9805f1628bb7
2011-08-16Allow the dissection of BER/DER carried over a TCP transport usinggal1-1/+3
"Decode As..." git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38560 f5534014-38df-0310-8fa8-9805f1628bb7
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