aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ber.c
AgeCommit message (Collapse)AuthorFilesLines
2005-09-01Normalize our hf_id checks and make sure our hf_ids are valid before wegerald1-36/+44
try to use them. This should fix bugs 399 and 401. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15662 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-29MapDialougePDU.cnfetxrab1-0/+2
Fix a typo. packet-ber.c packet-acse.c packet-cmip.c - Add OID(s) packet-ses.c Fix export of a value string and change names to the ones used in the protocol spec. Replace PRES dissector with an asn2eth generated one. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15614 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-29In the SEQUENCE OF dissector helpersahlberg1-16/+22
Only count the number of items in the SEQUENCE OF IFF we have the full TVB containing the entire blob. Dont count the items if the tvb is "short" since then this would just lead to a [short frame] before a single item in the SEQUENCE OF has been dissected. Do we really need to count the items and create a FT_UINT field with the number of items at all? Then count the items as we are calling the subdissectors and append the '# item[s]' text to the FT_NONE items after we finished the loop? git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15607 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-28From Graeme Lunt:etxrab1-163/+140
b) dissect_ber_set() to report missing fields and handle untagged CHOICEs c) dissect_ber_choice() to handle untagged CHOICEs (within the CHOICE) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15597 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-28When creating subset tvbuffs, set the length to the minimum of theguy1-18/+37
desired reported length and the remaining length, so we don't throw an exception at tvbuff creation time if we don't have all the desired data - we want to throw the exception at dissection time, so we can dissect the data we do have. Use "tvb_ensure_bytes_exist()" to force exceptions to be thrown. When "dissect_unknown_ber()" is called from "call_ber_oid_callback()", we're handing it a newly-created tvbuff, so the offset in that tvbuff should be zero. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15595 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-27...and don't print a separating comma if you haven't already printed anguy1-1/+2
item. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15572 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-27If you don't print an "(", don't print a ")".guy1-3/+6
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15570 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-23Fix the parenthesization of an expression.guy1-1/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15514 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-22From Graeme Lunt:etxrab1-22/+24
Zero length elements (e.g. an empty SET) the logic is slightly wrong in get_ber_length(). Make SET work. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15508 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-20removal of even more sprintfsahlberg1-2/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15457 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-19Set "hoffset" before using it.guy1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15416 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-18From Tim Endean:etxrab1-20/+22
Small patch to ber.c The tcap dissector has been updated to use this length. I have not tested other asn.1 dissectors to ensure that they correctly use the indefinite encoding flag instead of the length value returning zero. There may also be some problems when re-assembly is needed, but the ability to deal with indefinite length is much more useful. For developers the get_ber_length now returns the length of the pdu including the EOC, where you have dissectors that use packet-ber.c the eoc may need to be dealt with separately. The tcap dissector has had numerous changes to make it less cluttered, and the useful feature of the previous version where a dialogue could be filtered out by selecting either the source or destination transaction ID has been incorporated into this version. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15414 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-18Tim's patches for packet-ber for extra testing (works ok with my and with ↵sahlberg1-358/+461
Anders captures) Anders' beginnings of a new dissect_ber_set() function git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15402 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-11Add checks for infinite loops. Fixes recent Buildbot failures.gerald1-2/+21
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15292 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-08various code cleanup:ulfl1-2/+1
-use g_snprintf instead of sprintf and snprintf -use g_strdup_printf where appropriate -remove #include "snprintf.h" (as only g_snprintf should be used) -replace some more alloc/realloc/calloc/free with their glib pendants git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15264 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-05More char -> const char warning fixesjmayer1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15222 f5534014-38df-0310-8fa8-9805f1628bb7
2005-07-29Cast away some (otherwise unremovable, and harmless, in this case)guy1-4/+4
warnings. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15135 f5534014-38df-0310-8fa8-9805f1628bb7
2005-07-28packet_ber has for some time been doing sanity checking of the BER Length fieldssahlberg1-4/+4
that they are not longer than the reported length of the tvb. this triggers some bugs since in packet-ber we are a bit too lax in setting reported_length of the tvb_new_subset() tvb. this cause short kerberos packets to not be decoded at all and the same for other short asn based packets as well. fix some of these instances. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15127 f5534014-38df-0310-8fa8-9805f1628bb7
2005-07-28char -> const char warning fixesjmayer1-5/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15126 f5534014-38df-0310-8fa8-9805f1628bb7
2005-07-26From Maynard, Chris :etxrab1-2/+2
The attached patches, generated via svn diff , correct various compiler & lint warnings, among them: lemon.c(2582) : warning C4090: '=' : different 'const' qualifiers packet-ber.c(212) : warning C4018: '<=' : signed/unsigned mismatch packet-ber.c(228) : warning C4018: '>=' : signed/unsigned mismatch packet-bootp.c(2112) : warning C4018: '<' : signed/unsigned mismatch packet-iscsi.c(801) : warning C4018: '>=' : signed/unsigned mismatch git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15085 f5534014-38df-0310-8fa8-9805f1628bb7
2005-07-21change the symbol dissect_ber_CHOICE back into dissect_ber_choicesahlberg1-8/+8
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14980 f5534014-38df-0310-8fa8-9805f1628bb7
2005-07-09Fix up a bunch of arguments to "dissect_ber_identifier()" to match itsguy1-10/+11
current signature ("class" is a "gint8 *", not a "guint8 *", and "tag" is a "gint32 *", not a "guint32 *"). Re-generate the dissectors from the ASN.1 and the .cnf files in the cases where the arguments were fixed in a .cnf file. Give some dissectors the right svn:keywords and svn:eol-style settings. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14885 f5534014-38df-0310-8fa8-9805f1628bb7
2005-07-01beter displaying of true/false strings in dissect_ber_bitstring()kukosa1-4/+7
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14828 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-29be more careful when attempting to dissect an unknown ber field not to read ↵sahlberg1-2/+9
beyond the end and triggering a [malformed packet] also prettify the error when finding "unknown" entries inside a SEQUENCE to make it easier to track down what went wrong. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14814 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-27fix two bugs when updating offset incorrectly that could lead to an infinite ↵sahlberg1-2/+2
loop when trying to decode an unknown ber structure git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14799 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-26prettify ftam by puttign the command name in the info columnsahlberg1-3/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14759 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-26make dissect_ber_choice take a guint* that will return thesahlberg1-8/+20
index of the branch taken or -1 to make prettifications easier to implement. change the signature of dissect_ber_choice and rename it to dissect_ber_CHOICE to catch all occurences of the use of this function update asn2eth to use the new name/signature update all occurences of this function to the new name and new signature. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14758 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-24 for unknown GraphicStringsahlberg1-0/+7
just decode them as an octet string and say in the decode pane this is an unknown GraphicString git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14742 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-24fix to ber NULL handlingsahlberg1-12/+16
1, make it actually show the hf field when present 2, make it handle imlicit_tag properly git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14741 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-22update to packet-bersahlberg1-24/+209
1, start making indefinite length constructions actually work 2, when attempting to decode an unknown BER octet sequence, do not generate [malformed packet] just because the length does not make sense and might point outside the tvb. it might just be that there are implicit tags in the asn1 specification and that it is just impossible to decode the octet stream without knowledge of the asn. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14728 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-21the maximum ASN OID length is 256 bytes and there is a define to control this.sahlberg1-1/+7
fix bug251 and all other occurances where an oid string passed to packet_ber_object_identifier() is not defined as foo[MAX_OID_STR_LEN] git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14720 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-09From Tim Endean:etxrab1-0/+2
Check for tvb. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14592 f5534014-38df-0310-8fa8-9805f1628bb7
2005-06-07From Tim Endean:etxrab1-4/+16
- I have had to make some changes to packet-ber to allow for PRIVATE and APPLICATION tags. - Both ANSI and ITU variants supported without configuration. - Asn.1 dissectors can now register using an OID value as well as an SSN, the oid it tried first. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14572 f5534014-38df-0310-8fa8-9805f1628bb7
2005-05-30From Steve Grubb: Initialize a variable. Fixes part of bug 217.gerald1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14493 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-28Usage of oid_to_str() in PER and BER helperskukosa1-29/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14217 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-27NULL type decoders for PER and BERkukosa1-0/+25
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14201 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-22Define a maximum OID string length, and use it in a lot of places. Fixes agerald1-4/+4
buffer overflow found while fuzz testing. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14169 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-22Squelch a valgrind warning.gerald1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14162 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-21from Olivier Jsahlberg1-6/+9
bugfix for IMPLICIT NULL in BER sequences and gsmmap updates git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14160 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-20Add a tree parameter to get_ber_length() so thatsahlberg1-7/+15
IF the length seems bogus, like longer than the reported tvb_length we add a helpful text item to the tree and generate a [malformed packet] change all callers of get_ber_length to the new signature. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14145 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-15In dissect_ber_bitstring32(), make sure tmp_tvb is properly initialized.gerald1-2/+2
Fixes bug 32. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14092 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-14In dissect_ber_integer(), generate a warning if the integer length isgerald1-2/+6
invalid instead of throwing an assertion. Fixes bug 25. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14080 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-14Add another passel of tvb_ensure_bytes_exist()s. Fixes bug 24.gerald1-0/+9
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14079 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-14Add a tvb_ensure_bytes_exist() to dissect_ber_octet_string(). Fixes buggerald1-0/+1
23. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14078 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-13In dissect_ber_octet_string_wcb(), make sure out_tvb is non-NULL beforegerald1-5/+5
trying to use it so that we don't throw an assertion. Fixes bug 22. Do the same thing in dissect_ber_GeneralString(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14065 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-13Add a couple of tvb_ensure_bytes_exist() calls to fix bug 12.gerald1-0/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14064 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-31Fix a couple of "proto_tree_add_text()" calls to pass the right arguments.guy1-2/+9
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13989 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-30Improve some debug messages.etxrab1-4/+11
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13980 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-30From Timsahlberg1-0/+1
small bugfix for packet-ber.c if packet is malformed, prevent dereferenceing a null pointer git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13976 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-24From Jacques Olivier:etxrab1-3/+23
Here is a patch that: * packet-ber.c: - Fixes handling tags longer than one octet (in "packet-ber.c:get_ber_identifier") which consists of replacing "if (t & 0x80) break;" by "if (!(t & 0x80)) break;" - Add debug info on the identifier when debug is enabled (I don't know if we want to keep this, but I find it useful) - printf's a warning when packet-ber hits a constructed type (to remind that we eventually have to handle this) - Add the display of unknown BER octet strings (this one was already submitted along with the initial Camel dissector but didn't got included) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13895 f5534014-38df-0310-8fa8-9805f1628bb7