Commit Graph

105 Commits

Author SHA1 Message Date
Guy Harris 2d14a6f4ae Show unsigned quantities as such.
svn path=/trunk/; revision=16001
2005-09-25 09:07:41 +00:00
Guy Harris c952476658 Squelch some compiler wranings, and fix up the creation of a subset
tvbuff.

Fix indentation.

svn path=/trunk/; revision=15921
2005-09-21 01:47:46 +00:00
Gerald Combs ba83bf145f Don't try to reassemble a zero-length fragment. Add a comment to
reassemble.c about the handling of zero-length fragments.

svn path=/trunk/; revision=15899
2005-09-20 17:23:19 +00:00
Gerald Combs d2e3d45042 In the SPNEGO dissector, don't call a subdissector if we don't have a TVB.
Fixes bugs 448, 449, 451, 452, 454, 456, and 461.

Add similar TVB checks to the BER dissector.

svn path=/trunk/; revision=15869
2005-09-19 16:23:05 +00:00
Guy Harris 138e7409d3 If the tag field is a bitfield, always show it as such, otherwise always
show the value of 1 1111 as "Continued" in the bitfield and the actual
tag value in the following bytes.

Show the BER identifier data before an OID if we're showing internal BER
fields.

svn path=/trunk/; revision=15856
2005-09-18 16:54:00 +00:00
Anders Broman 7ef861a9a9 If unkown Tag's are found in a set add length.
svn path=/trunk/; revision=15853
2005-09-17 21:02:51 +00:00
Guy Harris 806a9d66ac Note problems with some values that appear in, for example, some SNMP
captures.

svn path=/trunk/; revision=15833
2005-09-16 08:30:35 +00:00
Anders Broman 1f0fec3e78 Dont't carsh if dissect_ber_null() isn't passed a hf_id.
svn path=/trunk/; revision=15797
2005-09-14 17:04:36 +00:00
Ronnie Sahlberg 4b11d44d11 for octet strings that span beyond the end of a "short" tvb, create a new subset tvb of what we have and use that instead of bailing out completely.
svn path=/trunk/; revision=15795
2005-09-14 16:04:59 +00:00
Gerald Combs a151e8cc6a If dissect_ber_octet_string() gives us a null tvb, assume we have a malformed
packet and throw an exception.  Don't pass the null tvb to tvb_length().

svn path=/trunk/; revision=15713
2005-09-07 15:40:59 +00:00
Anders Broman 6b28d6063e From Graeme Lunt:
Attached is a patch to solve the CHOICE problem for review. 

Problem was two-fold:
1) not passing original class/tag to sub-choice we had matched BER_CLASS_ANY
2) not handling a count==0 if we had matched BER_CLASS_ANY 

The patch also includes a my constructed octet string fix again.

svn path=/trunk/; revision=15698
2005-09-06 05:30:06 +00:00
Anders Broman 4e9a8fc4fa branch_taken got lost in the recent changes.
svn path=/trunk/; revision=15687
2005-09-05 16:31:24 +00:00
Gerald Combs d3d87f3c66 Normalize our hf_id checks and make sure our hf_ids are valid before we
try to use them.  This should fix bugs 399 and 401.

svn path=/trunk/; revision=15662
2005-09-01 19:35:23 +00:00
Anders Broman 2273b1b7fc MapDialougePDU.cnf
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.

svn path=/trunk/; revision=15614
2005-08-29 20:07:06 +00:00
Ronnie Sahlberg 63044dd424 In the SEQUENCE OF dissector helper
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?




svn path=/trunk/; revision=15607
2005-08-29 08:24:15 +00:00
Anders Broman f5132f8229 From Graeme Lunt:
b) dissect_ber_set() to report missing fields and handle untagged CHOICEs
c) dissect_ber_choice() to handle untagged CHOICEs (within the CHOICE)

svn path=/trunk/; revision=15597
2005-08-28 19:50:36 +00:00
Guy Harris 815f003071 When creating subset tvbuffs, set the length to the minimum of the
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.

svn path=/trunk/; revision=15595
2005-08-28 17:57:30 +00:00
Guy Harris 40bf84f711 ...and don't print a separating comma if you haven't already printed an
item.

svn path=/trunk/; revision=15572
2005-08-27 18:44:57 +00:00
Guy Harris 99ff1832d7 If you don't print an "(", don't print a ")".
svn path=/trunk/; revision=15570
2005-08-27 18:16:35 +00:00
Guy Harris 9fa5d5fd9e Fix the parenthesization of an expression.
svn path=/trunk/; revision=15514
2005-08-23 08:01:46 +00:00
Anders Broman 6d52a0369a From Graeme Lunt:
Zero length elements (e.g. an empty SET) the logic is slightly wrong in get_ber_length().

Make SET work.


svn path=/trunk/; revision=15508
2005-08-22 05:49:09 +00:00
Ronnie Sahlberg a34e7e3d03 removal of even more sprintf
svn path=/trunk/; revision=15457
2005-08-20 02:33:33 +00:00
Guy Harris 8fe4435694 Set "hoffset" before using it.
svn path=/trunk/; revision=15416
2005-08-19 01:56:14 +00:00
Anders Broman 1e1df99990 From Tim Endean:
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.

svn path=/trunk/; revision=15414
2005-08-18 21:36:59 +00:00
Ronnie Sahlberg dc2f29288a Tim's patches for packet-ber for extra testing (works ok with my and with Anders captures)
Anders'  beginnings of a new dissect_ber_set() function

 

svn path=/trunk/; revision=15402
2005-08-18 08:37:31 +00:00
Gerald Combs 699bd0fa60 Add checks for infinite loops. Fixes recent Buildbot failures.
svn path=/trunk/; revision=15292
2005-08-11 15:35:17 +00:00
Ulf Lamping 0dc9fb3d4a various code cleanup:
-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

svn path=/trunk/; revision=15264
2005-08-08 18:50:39 +00:00
Jörg Mayer 2b2506f0f6 More char -> const char warning fixes
svn path=/trunk/; revision=15222
2005-08-05 13:10:58 +00:00
Guy Harris c8fc6a8e76 Cast away some (otherwise unremovable, and harmless, in this case)
warnings.

svn path=/trunk/; revision=15135
2005-07-29 03:27:59 +00:00
Ronnie Sahlberg 34c10c4c7e packet_ber has for some time been doing sanity checking of the BER Length fields
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.


svn path=/trunk/; revision=15127
2005-07-28 08:18:18 +00:00
Jörg Mayer 34493e8f9e char -> const char warning fixes
svn path=/trunk/; revision=15126
2005-07-28 07:53:38 +00:00
Anders Broman 9c99a261f0 From Maynard, Chris :
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


svn path=/trunk/; revision=15085
2005-07-26 09:52:06 +00:00
Ronnie Sahlberg 0ca30abe65 change the symbol dissect_ber_CHOICE back into dissect_ber_choice
svn path=/trunk/; revision=14980
2005-07-21 21:12:09 +00:00
Guy Harris 34ae8c850f Fix up a bunch of arguments to "dissect_ber_identifier()" to match its
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.

svn path=/trunk/; revision=14885
2005-07-09 02:58:07 +00:00
Tomas Kukosa abc732f855 beter displaying of true/false strings in dissect_ber_bitstring()
svn path=/trunk/; revision=14828
2005-07-01 13:48:52 +00:00
Ronnie Sahlberg 226c5a56ab be more careful when attempting to dissect an unknown ber field not to read 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.



svn path=/trunk/; revision=14814
2005-06-29 08:00:55 +00:00
Ronnie Sahlberg 05f9375d55 fix two bugs when updating offset incorrectly that could lead to an infinite loop when trying to decode an unknown ber structure
svn path=/trunk/; revision=14799
2005-06-27 11:43:18 +00:00
Ronnie Sahlberg e55dcb785e prettify ftam by puttign the command name in the info column
svn path=/trunk/; revision=14759
2005-06-26 06:16:03 +00:00
Ronnie Sahlberg 3a51ba4293 make dissect_ber_choice take a guint* that will return the
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.



svn path=/trunk/; revision=14758
2005-06-26 05:48:50 +00:00
Ronnie Sahlberg 0392684ab7 for unknown GraphicString
just decode them as an octet string and say in the decode pane this is an unknown GraphicString



svn path=/trunk/; revision=14742
2005-06-24 10:03:20 +00:00
Ronnie Sahlberg 7f08072192 fix to ber NULL handling
1, make it actually show the hf field when present
2, make it handle imlicit_tag properly


svn path=/trunk/; revision=14741
2005-06-24 08:57:41 +00:00
Ronnie Sahlberg 299ce87bfe update to packet-ber
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.



svn path=/trunk/; revision=14728
2005-06-22 09:58:46 +00:00
Ronnie Sahlberg 33f4400f83 the maximum ASN OID length is 256 bytes and there is a define to control this.
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]

svn path=/trunk/; revision=14720
2005-06-21 09:38:59 +00:00
Anders Broman 89ddd6077a From Tim Endean:
Check for tvb.

svn path=/trunk/; revision=14592
2005-06-09 04:28:13 +00:00
Anders Broman 86a56ba7cc From Tim Endean:
- 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.


svn path=/trunk/; revision=14572
2005-06-07 05:49:06 +00:00
Gerald Combs 651ee9a2fe From Steve Grubb: Initialize a variable. Fixes part of bug 217.
svn path=/trunk/; revision=14493
2005-05-30 20:51:36 +00:00
Tomas Kukosa 46a168734a Usage of oid_to_str() in PER and BER helpers
svn path=/trunk/; revision=14217
2005-04-28 09:54:03 +00:00
Tomas Kukosa 94dffebd6c NULL type decoders for PER and BER
svn path=/trunk/; revision=14201
2005-04-27 14:17:14 +00:00
Gerald Combs 082651c83e Define a maximum OID string length, and use it in a lot of places. Fixes a
buffer overflow found while fuzz testing.

svn path=/trunk/; revision=14169
2005-04-22 21:17:13 +00:00
Gerald Combs 8d914c66fd Squelch a valgrind warning.
svn path=/trunk/; revision=14162
2005-04-22 04:10:44 +00:00