Commit Graph

443 Commits

Author SHA1 Message Date
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
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
Anders Broman c91a384702 Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=28356
2009-05-13 19:46:11 +00:00
Guy Harris 39630a763d Squelch a warning.
svn path=/trunk/; revision=27947
2009-04-03 17:06:20 +00:00
Guy Harris cf308a6cc0 Don't reply on an argument of -1 as the last argument of tvb_memcpy()
meaning "to the end of the tvbuff"; we'd like to get rid of the "-1
means to the end of the tvbuff" convention, as in many cases the length
comes from a 32-bit length field in the packet, and we want 0xFFFFFFFF
to be treated, even on ILP32 platforms, as meaning "2^32-1 bytes",
probably giving an exception, rather than as "to the end of the packet".

svn path=/trunk/; revision=27945
2009-04-03 16:53:40 +00:00
Tomas Kukosa 494942c9c0 Display information which OID is not implemented in expert info
svn path=/trunk/; revision=27384
2009-02-06 13:48:32 +00:00
Bill Meier c544c20956 Fix various typos and spelling errors (mostly in text strings)
svn path=/trunk/; revision=27050
2008-12-18 19:08:49 +00:00
Stig Bjørlykke eb204d1ecf Added a filter entry when dissector for OID not implemented.
svn path=/trunk/; revision=26874
2008-11-29 11:17:34 +00:00
Stig Bjørlykke 4528043ab6 Fixed decoding of multiple sequences in a sequence of implict sequence.
Removed attempt to fix number of items in indef sequence-of and set-of.

svn path=/trunk/; revision=26476
2008-10-16 10:50:12 +00:00
Stig Bjørlykke c2515c5abd Count correct number of items in indef sequence-of and set-of.
svn path=/trunk/; revision=26451
2008-10-14 16:28:54 +00:00
Bill Meier b52d95d591 #include <emem.h> not req'd
svn path=/trunk/; revision=26091
2008-08-26 01:28:50 +00:00
Stig Bjørlykke d255e44bfa From Martin Peylo (bug 2507):
The attached patch enables asn2wrs.py and packet-ber.c to decode UTCTime
according to the definitions in X.680.

svn path=/trunk/; revision=25897
2008-08-01 16:44:06 +00:00
Bill Meier 7aaadd9bec Fix some warnings reported by gcc -Wshadow ...
svn path=/trunk/; revision=25616
2008-06-27 04:52:56 +00:00
Stig Bjørlykke 28ae535b00 Removed even more "statement not reached" warnings.
svn path=/trunk/; revision=24286
2008-02-07 15:44:45 +00:00
Anders Broman 14756d9e5d Let epan/asn1.c handle real type.
svn path=/trunk/; revision=24129
2008-01-18 05:55:24 +00:00
Sake Blok 6ff98095fe From Martin Peylo (bug 2184), fix for:
The current dissection of GeneralizedTime in packet-ber does not consider all
the possibilities how this field can be constructed.

According to ITU-T X.680 this field can be encoded as
YYYYMMDDhhmmss([\.,]f{1,3})?(([+-]hhmm)|Z)?
This is a regex-like expression where each letter except the literal 'Z'
represents an ASCII encoded digit.

So far only the first 14 digits are dissected and the 15th character is put
into parentheses. This may not show all available information.



svn path=/trunk/; revision=24071
2008-01-12 12:06:56 +00:00
Jeff Morriss db8bae4fb2 When searching for EOC (because we have an indefinite length) don't stop searching just because we ran out of TVB (thus assuming that the EOC is just beyond the end of the message). Instead, try to keep going which will throw an exception (ReportedBoundsError). I had a packet which was missing the EOC (probably programmer error) and Wirshark was reporting BoundsError (Packet size limited during capture) instead of ReportedBoundsError (Malformed Packet); this patch fixes that.
svn path=/trunk/; revision=24046
2008-01-09 17:06:25 +00:00
Anders Broman de16039c51 Get rid of dissect_ber_boolean_value() and change the signature of
dissect_ber_boolean() to return a value and update asn2wrs to generate the new signature.
Regenerate all BER dissectors.

svn path=/trunk/; revision=24015
2008-01-04 16:21:07 +00:00
Anders Broman 73fee653de Get rid of ber_last_created_item(). (Final?)
svn path=/trunk/; revision=24010
2008-01-04 13:39:24 +00:00
Anders Broman 6f5a53b789 Add more debug info.
svn path=/trunk/; revision=23977
2007-12-30 00:03:10 +00:00
Stig Bjørlykke 5e1ffde520 Moved check for empty choice to make it work correctly.
svn path=/trunk/; revision=23548
2007-11-23 12:22:22 +00:00
Stig Bjørlykke 92682d51de Added handling of octet-aligned data according to direct_reference.
Implemented handling of ber_callback for tagged type octet-aligned
and arbitrary.  Renamed some functions.

svn path=/trunk/; revision=23539
2007-11-21 23:33:13 +00:00
Stig Bjørlykke 8fc83d2cf3 Improved "BER Error" messages to be more uniform.
svn path=/trunk/; revision=23501
2007-11-19 20:23:49 +00:00
Stig Bjørlykke 9233fa7578 Second try to not stop processing if length==0 in choice.
svn path=/trunk/; revision=23497
2007-11-19 17:46:11 +00:00
Stig Bjørlykke 77e69e06e1 Reverted r23485 and r23486, this was not a correct fix.
svn path=/trunk/; revision=23489
2007-11-19 07:25:06 +00:00
Stig Bjørlykke c3d985077e And dump internal ber fields for empty choice field.
svn path=/trunk/; revision=23486
2007-11-18 16:40:20 +00:00
Stig Bjørlykke ddc4d639ba As proposed by Martin Peylo:
Do not stop processing if the length of a choice has the (illegal)
value of zero.

svn path=/trunk/; revision=23485
2007-11-18 16:20:51 +00:00
Graeme Lunt 4a285928bb Changed to use the the packet-ber EXTERNAL decoding (into the ASN1 context).
Uses the ber_callback mechanism to call the rtse oid callbacks, rather than the default ber oid callback list.
A couple of fixes to packet-ber.c to mark [in]direct references as present and call the ber_callback if it has been specified.


svn path=/trunk/; revision=23450
2007-11-14 20:57:55 +00:00
Anders Broman 524db0a082 From Florent DROUIN:
Since the use of the function 'dissect_ber_tagged_type' for DialoguePortion,
the file tcap.cnf must be updated to remove the decoding of the tag and length.
This decoding is now done in the new function 'dissect_ber_tagged_type'.

The file tcap.cnf has been updated to take into account this change. 
But this leads to a change in tcap.asn too, for the definition of the
ExternalPDU.
I think this part of the ASN1 file is specific to Wireshark and can be
modified.

In the meantime, I did update the DEBUG part for packet_ber.c  for the function
(dissect_ber_tagged_type)

svn path=/trunk/; revision=23442
2007-11-13 21:59:53 +00:00
Anders Broman dbcabb1938 Get rid of most of the legacy oid stuff.
svn path=/trunk/; revision=23333
2007-11-01 22:07:43 +00:00
Anders Broman 9492700608 Change:
get_oid_str_name() -> oid_resolved_from_string()
get_oid_name() -> oid_resolved_from_encoded()

svn path=/trunk/; revision=23331
2007-11-01 19:36:39 +00:00
Anders Broman 7329ae8ac6 Use oid_add_from_string for adding names.
fix compil of gsmmap and inap.
Note xcopy of gsmmap does not work(rename packet-gsm_map -> packet-gsmmap ?)

svn path=/trunk/; revision=23325
2007-10-31 23:11:15 +00:00
Anders Broman 1950ffc214 Apply the small performance enhancment patches for:
- if offset is 0, tvb_length is the same as tvb_length_remaining, just faster.
Replace 
- col_append_fstr() with faster  col_append_str() 
- col_add_str() with col_set_str()
when it's safe

svn path=/trunk/; revision=23252
2007-10-23 05:50:00 +00:00
Luis Ontanon bcd55f4c8e replace oid_to_str_buf() and oid_to_str()
fix a potential buffer overflow due to a very liberal estimate by oid_repr_len()


svn path=/trunk/; revision=22659
2007-08-25 17:29:55 +00:00
Luis Ontanon 00c5e48a17 get users of oid_resolv to use the new oids, rollout packet-snmp.c
svn path=/trunk/; revision=22651
2007-08-25 01:14:24 +00:00
Jörg Mayer 93f5beda89 Warning fixes
svn path=/trunk/; revision=22629
2007-08-24 10:20:22 +00:00
Jörg Mayer 733f78043e The ber header was missing from the object, resulting in
invalid saved certificates.

svn path=/trunk/; revision=22628
2007-08-24 08:12:39 +00:00
Jörg Mayer b312e64f6a get_ber_length doesn't need the tree argument, get rid of it.
Rebuild asn1 dissectors.

svn path=/trunk/; revision=22627
2007-08-24 07:12:04 +00:00
Graeme Lunt d36abc4549 Handle unknown Universal and BMP strings.
svn path=/trunk/; revision=22551
2007-08-18 17:39:44 +00:00
Stig Bjørlykke 93a9ea7879 Improved dumping of unexpected data when dissector for OID not implemented.
svn path=/trunk/; revision=22517
2007-08-15 22:34:56 +00:00
Anders Broman 57592cb2aa http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1739
Fro Stig Bjørlykke:
1. BER: Added support for empty indef SET
2. RTSE: Added fragment length in COL_INFO
3. IMF: Use correct hf_id for extension value
4. DOP: Fix typo in COL_INFO oid name

svn path=/trunk/; revision=22492
2007-08-13 16:41:16 +00:00
Tomas Kukosa b104611590 remove unused variable
svn path=/trunk/; revision=22407
2007-07-26 14:31:38 +00:00
Tomas Kukosa 82ea2908f1 - export some ASN.1 functions from libwireshark
- fill-in actx->created_item in dissect_ber_object_identifier()

svn path=/trunk/; revision=22406
2007-07-26 14:00:48 +00:00
Tomas Kukosa 6659588f60 - get rid of anonymous unions
- move some structures from packet-per and packet-q932-ros to asn1.h

svn path=/trunk/; revision=22295
2007-07-13 11:25:53 +00:00
Anders Broman 379d320b8b From Stig Bjørlykke:
This patch adds an option to packet-ber to show unexpected tags/data as unknown BER.  It also fixes some offset/length combinations when adding the error message to the tree.

svn path=/trunk/; revision=22244
2007-07-05 13:14:25 +00:00
Anders Broman 442538ce0b Fix a typo.
svn path=/trunk/; revision=22171
2007-06-23 15:31:37 +00:00
Anders Broman 9af02b5130 Change actx->external.direct_reference to be the OID string.
Use it in BER direct reference to call the OID dissector.

svn path=/trunk/; revision=22097
2007-06-14 05:17:07 +00:00
Stephen Fisher bcfc3b9468 Get the Unix buildbots going again
svn path=/trunk/; revision=22086
2007-06-13 06:22:43 +00:00
Anders Broman 58f01d87cc Preparations for updated CMIP dissector:
- Export AE-title from ACSE
- Start REAL dissection(unfinished).

svn path=/trunk/; revision=22083
2007-06-12 21:29:27 +00:00
Anders Broman 5a2fb14332 Add some opcodes and mark func as _U_ in packet-ber.c
svn path=/trunk/; revision=22032
2007-06-03 21:10:29 +00:00
Anders Broman 4393bceae5 INAP:
- Use (some) IN CS4 asn1 files Q.1248.1 Q.1248.2 Q.1248.3

BER/asn2wrs:
-  Add basic support for EmbeddedPDVType

svn path=/trunk/; revision=22031
2007-06-03 19:58:59 +00:00
Anders Broman d197031761 Change implicit tag handling for SEQUENCE OF and fix a cut'n paste error.
svn path=/trunk/; revision=22006
2007-05-30 19:00:50 +00:00
Anders Broman ddb6768db2 Update the EXTERNAL dissection code(still unfinished).
svn path=/trunk/; revision=21893
2007-05-22 21:15:00 +00:00
Anders Broman dca634c4de Prepare for the use of the new -X parameter for BER encoded protocols.
svn path=/trunk/; revision=21889
2007-05-22 16:17:54 +00:00
Anders Broman f08cd1e5e3 actx in the rest of dissect_ber..()l
svn path=/trunk/; revision=21773
2007-05-15 05:49:43 +00:00
Ronnie Sahlberg fc5ce01ee4 replace an incorrect '{' with ';' in the ber header file
change the signature for dissect_ber_external_type() to only provide the 
parameter actx once


svn path=/trunk/; revision=21756
2007-05-13 22:19:04 +00:00
Anders Broman 0bc558f88d actx in ber_external
svn path=/trunk/; revision=21755
2007-05-13 22:01:17 +00:00
Anders Broman 0a0a913a01 Try to make the buildbot happy.
svn path=/trunk/; revision=21754
2007-05-13 21:54:45 +00:00
Anders Broman c01f382974 Second step in introducing asn context to BER dissectors just like in PER.
svn path=/trunk/; revision=21753
2007-05-13 20:58:29 +00:00
Anders Broman fd108518ed _U_ mark some parameters and a forgotten file.
svn path=/trunk/; revision=21706
2007-05-07 05:35:45 +00:00
Anders Broman 4c692a62b6 Start introducing actx to ber functions.
svn path=/trunk/; revision=21705
2007-05-06 22:34:05 +00:00
Graeme Lunt 2e96e3fe55 Separate field for the elements of a constructed OCTET STRING.
svn path=/trunk/; revision=21695
2007-05-06 08:18:44 +00:00
Anders Broman 334177b096 Show BER internal fields in external type in ACSE, update a comment in packet-ber.c.
svn path=/trunk/; revision=21685
2007-05-04 20:27:43 +00:00
Guy Harris 2447ba1de6 Once is enough. :-)
That should get rid of warnings in packet-ber.c; add it to the list of
clean dissectors, to try to keep it clean.

svn path=/trunk/; revision=21684
2007-05-04 18:56:59 +00:00
Anders Broman 98cb9db12d Split out asn1 common functions. Start of BER EXTERNAL.
svn path=/trunk/; revision=21670
2007-05-03 21:52:57 +00:00
Anders Broman fdb44d8bb4 Show internal ber fields for tagged type if pref. set.
svn path=/trunk/; revision=21668
2007-05-03 19:56:13 +00:00
Luis Ontanon 49e49452dd fix warnings in debug code
svn path=/trunk/; revision=21652
2007-05-02 20:37:25 +00:00
Anders Broman 83f17c25a7 Revert some private experiments checked in by misstake.
svn path=/trunk/; revision=21609
2007-04-28 14:47:43 +00:00
Anders Broman 2630b817b0 From Gavin Heer:
Here's a patch that decodes MMS(Manufacturing Messaging
Specification) when transported over COTP/TPKT/TCP.  Previously, MMS would only be decoded if the OSI Presentation Layers were present. Now MMS/COTP/TPKT/TCP is dissected.
With a change to use more functions from packet-ber

svn path=/trunk/; revision=21608
2007-04-28 14:38:53 +00:00
Guy Harris f010b46419 decode_as_dt's argument points to a dissector table name, so it should be
a const pointer.

svn path=/trunk/; revision=21529
2007-04-23 16:49:24 +00:00
Guy Harris 1bc049906a Add some GCC warnings to the standard set, and add some others to the
--enable-extra-gcc-checks set.

If we turn on -pedantic, try turning on -Wno-long-long as well, so that
it's not *so* pedantic that it rejects the 64-bit integral data types
that we explicitly require.

Constify a bunch of stuff, and make some other changes, to get rid of
warnings.

Clean up some indentation.

svn path=/trunk/; revision=21526
2007-04-23 10:59:26 +00:00
Guy Harris c5beaef29e "call_ber_syntax_callback()" isn't used outside packet-ber.c, isn't
declared in any header file, and isn't in epan/libwireshark.def; make it
static, to squelch compiler warnings.

svn path=/trunk/; revision=21518
2007-04-23 00:32:04 +00:00
Anders Broman 5954b97ac4 Add EXTERNAL to the value string and add comments about UNIVERSAL tags.
svn path=/trunk/; revision=21479
2007-04-20 13:54:56 +00:00
Jeff Morriss 00cf2ec89c Frame numbers are unsigned, print them as such
svn path=/trunk/; revision=21443
2007-04-16 04:52:51 +00:00
Ronnie Sahlberg d5d5159b6d From Sebastien Tandel
fixes for various compiler warnings

svn path=/trunk/; revision=21210
2007-03-26 11:06:26 +00:00
Anders Broman ecbf96d04e From Stig Bjørlykke:
When dumping elements in a constructor in dissect_unknown_ber the last element is not put in the correct subtree, because the while- loop does not include the header length when checking for the end.

svn path=/trunk/; revision=20984
2007-03-06 21:03:27 +00:00
Bill Meier 103bf29730 Continuing the tradition: squelch some compiler warnings ....
svn path=/trunk/; revision=20866
2007-02-19 22:29:23 +00:00
Graeme Lunt 38515fbf22 From X.690 8.6.2.3
"If the bitstring is empty, there shall be no subsequent octets, and the initial octet shall be zero." 

The BER dissector marked empty bitstrings as "Padding", but they are now marked as "Empty". 

http://www.wireshark.org/lists/wireshark-dev/200702/msg00574.html


svn path=/trunk/; revision=20834
2007-02-17 14:23:09 +00:00
Graeme Lunt c09afc2db6 This patch adds some new features to the BER dissector:
- Added option to decode OCTET STRINGs as BER encoded data
- Added decoding of unknown VisibleString and GeneralString
- Some code cleanup

http://www.wireshark.org/lists/wireshark-dev/200702/msg00482.html


svn path=/trunk/; revision=20831
2007-02-17 11:10:02 +00:00
Graeme Lunt 74fa87ddb2 Small fix for incorrect column use when dissecting a BER file.
svn path=/trunk/; revision=20709
2007-02-04 12:00:25 +00:00
Anders Broman c16c8a9bee From Graeme Lunt:
The problem was that when dissecting the set, if a sub-dissector didn't consume any bytes it was assumed that the correct field hadn't been matched.
This fix matches the field if the sub-dissector consumes no bytes and we know that the length of the field is zero. This is only allowed on the first pass when we are not matching ANYs.
I think this is a fairly safe fix - I've tried it with some other ASN.1

I've also changed dissect_ber_octet_string() to show the zero length fields in the dissection. This shows the fields as "<MISSING>" which is not quite the right explanation as the field is definitely present. Something like "<EMPTY>" or "<ZERO LENGTH>" may be better - but I'm not sure of the reasoning behind "<MISSING>".

svn path=/trunk/; revision=20429
2007-01-14 20:54:39 +00:00
Graeme Lunt 7d3a4e9264 New protocol dissector for PKCS#12 - Personal Information Exchange Syntax.
Generally found within a file (.p12 or .pfx) or as a directory attribute (userPKCS12 from iNetOrgPerson).

Wiki page and sample file to follow.


svn path=/trunk/; revision=20416
2007-01-13 15:26:13 +00:00
Graeme Lunt 2fd7d2c620 New "decode as ..." feature for BER-encoded files (WTAP_FILE_BER).
A BER-encoded file can be dissected as one of a number of registered syntaxes (registered using register_ber_syntax_dissector()). 
Syntaxes may also be associated with OIDs (or other strings) using register_ber_oid_syntax(). 

A default syntax with which to dissect a BER-encoded file is determined from its filename (extension). For example, ".cer" and ".crt" files will be dissected as "Certificate".


svn path=/trunk/; revision=20414
2007-01-13 12:59:27 +00:00
Anders Broman c9bbf1b510 Packet-ber:
Handle the following type of construct
CDMATargetMAHOInformation ::= SEQUENCE {
	targetCellID			[3] IMPLICIT TargetCellID,
	cdmaPilotStrength		[65] IMPLICIT CDMAPilotStrength,
	cdmaTargetOneWayDelay	[61] IMPLICIT CDMATargetOneWayDelay
	}

CDMATargetMAHOList ::= SEQUENCE OF [135] IMPLICIT CDMATargetMAHOInformation

ansi_map:
- Correct an Enummeration
- add Missing OPTIONAL to Tags
- Handle parameter if it's one or two octets long.

svn path=/trunk/; revision=20386
2007-01-10 22:59:40 +00:00
Anders Broman fda137ce6a Fix tag > 0x1f
svn path=/trunk/; revision=20333
2007-01-06 20:21:30 +00:00
Anders Broman cf919a1adb Remove an unused variable.
svn path=/trunk/; revision=20173
2006-12-19 22:28:20 +00:00
Anders Broman ea86134eaf From Florent Drouin:
Introduce the support for "expert info" in the BER decoding module.
It is usefull if you have to analyze long capture files, containing few malformed messages.

With changes to make it compile with MSVC6.

svn path=/trunk/; revision=20152
2006-12-19 22:04:22 +00:00
Graeme Lunt e15d91a592 General updates to:
*) Remove maximum LDAP PDU size check - they can get large with either large attributes (e.g. CRLs, SPIFs) or with lots of results (see http://www.wireshark.org/lists/wireshark-users/200610/msg00197.html). The max size preference is also removed.
*) Support for dissecting LDAP controls including server side sorting and paged results. A new BER function is introduced to see if there is a dissector for a given OID.
*) Remove reference to removed BER preference in the LDAP reassembly preference.
*) Mark a LDAPURL as a URL


svn path=/trunk/; revision=19792
2006-11-04 09:14:54 +00:00
Guy Harris e9a7c32e2d Squelch a compiler warning.
svn path=/trunk/; revision=19474
2006-10-10 08:12:04 +00:00
Anders Broman 299469d48d Handle Zero length SEQUENCE and SEQUENCE OF.
svn path=/trunk/; revision=19318
2006-09-24 21:04:53 +00:00
Graeme Lunt 914d48e098 Fix to show all the internal tokens. when configured, when dissecting an unknown piece of BER.
svn path=/trunk/; revision=19289
2006-09-22 17:39:02 +00:00
Gerald Combs 8b315480f1 In new_format_oid(), handle a zero-length OID.
Fix a bug introduced recently in packet-rpc.c.

Replace DISSECTOR_ASSERT() with THROW(ReportedBoundsError) in my recent 
checkins, since fuzz-test.sh sets WIRESHARK_ABORT_ON_DISSECTOR_BUG.

svn path=/trunk/; revision=18693
2006-07-09 22:12:02 +00:00
Gerald Combs 974c67ec86 Catch another infinite loop. Fixes bug 985.
svn path=/trunk/; revision=18686
2006-07-08 01:40:53 +00:00
Gerald Combs ec75c41241 Fix our loop checks.
svn path=/trunk/; revision=18683
2006-07-07 20:11:06 +00:00
Gerald Combs 58e634a3ef Fix another infinite loop. Remove redundant code.
svn path=/trunk/; revision=18681
2006-07-07 15:13:11 +00:00
Gerald Combs f2d83a530e Catch an infinite loop.
svn path=/trunk/; revision=18672
2006-07-06 16:47:50 +00:00
Gerald Combs a4c816cfc3 Fix an infinite loop in dissect_ber_tagged_type(). Fix up whitespace.
svn path=/trunk/; revision=18668
2006-07-05 21:33:01 +00:00
Guy Harris a3099ba15c Get rid of an unused variable.
svn path=/trunk/; revision=18626
2006-07-01 00:10:03 +00:00
Ronnie Sahlberg d0aae6dd3e from metze
prettify dissection of filters containing substring and extensiblematch



svn path=/trunk/; revision=18617
2006-06-29 21:04:37 +00:00
Tomas Kukosa 56d7db0c08 remove functions register_ber_oid_name() and get_ber_oid_name() from packet-ber.c, they were only OID but not BER related
use add_oid_str_name() and get_oid_str_name() instead of them

svn path=/trunk/; revision=18595
2006-06-28 14:19:08 +00:00
Tomas Kukosa f0f319acf1 - BER_MAX_OID_STR_LEN removed and replaced with MAX_OID_STR_LEN
- x411 and dop regenerated
- dissect_ber_tagged_type() prepared (support in asn2wrs will follow)

svn path=/trunk/; revision=18468
2006-06-15 07:46:07 +00:00
Ronnie Sahlberg 2f95f76a1e fix tcp reassembly to work again for
ldap   and ldap+sasl


remove a recent ber length validation in packet-ber.c that cant work and breaks reassembly  and also makes all ber pacvket sspanning multiple segments show up as malformed packets.



svn path=/trunk/; revision=18465
2006-06-14 11:51:25 +00:00
Ronnie Sahlberg ecdde88d46 from tim endean
handle the "broken" case when someone sends an indefinite length that is 0.



svn path=/trunk/; revision=18407
2006-06-09 21:09:57 +00:00
Ronnie Sahlberg feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00
Graeme Lunt ab19b927c8 "Field Information" context menu item that will bring up a web page reference to a field type of FT_OID
svn path=/trunk/; revision=18125
2006-05-10 19:50:54 +00:00
Graeme Lunt abefaf32bf Basic Encoding Rules (BER) encoded file reading. Not really a packet trace format but still useful for dissecting arbitrary BER/DER ASN.1.
svn path=/trunk/; revision=18110
2006-05-08 19:56:36 +00:00
Graeme Lunt 759203ed61 Preference to disable BER length sanity check (needed for asn2eth LDAP dissector).
svn path=/trunk/; revision=18056
2006-05-01 09:26:40 +00:00
Graeme Lunt 011ced394c Support for Session Extended User Data and IMPLICIT APPLICATION tagged bitstrings
svn path=/trunk/; revision=17726
2006-03-25 16:32:46 +00:00
Jaap Keuter 09f2ccdca3 Fix bug 819: make sure to always return a tvb pointer.
svn path=/trunk/; revision=17656
2006-03-17 11:46:07 +00:00
Ronnie Sahlberg 6ea1f1a77c coverity bug 68
prevent a very very long loop


svn path=/trunk/; revision=17625
2006-03-14 07:47:19 +00:00
Gerald Combs 172556500d Remove MIN and MAX defines, which GLib provides.
svn path=/trunk/; revision=17551
2006-03-09 16:00:33 +00:00
Jaap Keuter 3b2760d2df Catch negative return value, leading to near infinite loop.
Filed as coverity bug 136.

svn path=/trunk/; revision=17498
2006-03-07 15:22:57 +00:00
Ronnie Sahlberg 590d27a8c0 add new dissect_ber_integer64() that can handle 8,16,24,32 and 64bit integers.
use proto_tree_add_[u]int[8,16,24,32,64]() instread of proto_tree_add_item()
since BER integers may well be encoded in less bytes than the type requires.
(i do not think the old code with proto_tree_add_item() could have handleded negative values very well    or at all.)




svn path=/trunk/; revision=17425
2006-02-28 09:39:53 +00:00
Ronnie Sahlberg b63bc8410a fix bug 400
the choice dissector didnt sometimes use the correct next_tvb.
based on a bogus variable    'first_pass'   that was added as a qad solution to some weird CMIP problem.





svn path=/trunk/; revision=17142
2006-02-02 08:34:59 +00:00
Jörg Mayer 1900bf87fc done:
packet-ntp.c: Rather confused and incorrect use of g_snprintf return value
packet-pim.c: whitespace change
packet-icmpv6.c: g_snprintf takes trailing \0 into account, fix off by 1 error
packet-clnp.c: Fix incorrect use of g_snprintf return value
packet-isakmp.c: g_snprintf takes trailing \0 into account
packet-tr.c: Fix incorrect use of g_snprintf return value
packet-radius.c: Fix incorrect use of g_snprintf return value
packet-radius.h: constify a string variable
packet-ldap.c: The return value isn't needed, so don't use it incorrectly
packet-tcp.c: Fix incorrect use of g_snprintf return value
packet-windows-common.c: Remove unneeded DISSECTOR_ASSERT
packet-smb-sidsnooping.c: g_snprintf takes trailing \0 into account
packet-pvfs2.c: g_snprintf takes trailing \0 into account
packet-ptp.c: Remove #include snprintf
packet-ppp.c: Fix incorrect use of g_snprintf return value
packet-ospf.c: Fix incorrect use of g_snprintf return value
packet-mip6.c: snprintf -> g_snprintf
packet-bootp.c: Remove a commented out bad use of g_snprintf
packet-ber.c: snprintf -> g_snprintf, g_snprintf takes trailing \0 into account

2do:

     52 packet-ieee80211.c: 2DO
      2 packet-nfs.c: 2DO - too many side effects
     33 packet-bgp.c: 2DO
     18 packet-dns.c: 2DO
     14 packet-dcm.c: 2DO
     13 packet-x11.c: 2DO
     11 packet-kerberos.c: 2DO
     10 packet-diameter.c: 2DO
      9 packet-snmp.c: 2DO
      9 packet-pgm.c: 2DO
      7 packet-nbns.c: 2DO
      6 packet-fcswils.c: 2DO
      5 packet-wccp.c: 2DO
      5 packet-cops.c: 2DO
      4 packet-wtp.c: 2DO


svn path=/trunk/; revision=17038
2006-01-16 07:59:44 +00:00
Anders Broman 7980c9295e From Graeme Lunt:
Here is a patch for packet-ber.c that only includes the upgraded dissect_unknown_ber()

svn path=/trunk/; revision=16798
2005-12-14 20:45:15 +00:00
Guy Harris a770b7b647 "get_oid_name()" can return a null pointer; don't try to add the name if
it does.

svn path=/trunk/; revision=16735
2005-12-08 23:21:26 +00:00
Guy Harris aaf8a3060d Clean up indentation.
For OID fields of type FT_STRING, put back the code to append the OID
name.  (Ultimately, we should probably convert them all to type FT_OID.)

svn path=/trunk/; revision=16734
2005-12-08 11:27:14 +00:00
Tomas Kukosa a5bfb48c2f OBJECT IDENTIFIER name resolution moved to oid_resolv.c
svn path=/trunk/; revision=16699
2005-12-06 11:45:55 +00:00
Anders Broman e74a09cd01 If we don't have the OID name let the SNMP dissector try to get it from the MIB:s
svn path=/trunk/; revision=16680
2005-12-05 17:24:19 +00:00
Tomas Kukosa dcae7d303f new field type FT_OID for OBJECT IDENTIFIERs
svn path=/trunk/; revision=16652
2005-12-02 13:16:58 +00:00
Guy Harris d25e4c8e0f Fix typoes in comments.
Update a comment, and get rid of a commented-out unused variable.

Use "get_ber_identifier()" and "get_ber_length()", rather than
"dissect_ber_identifier()" and "dissect_ber_length()", if we're just
fetching the values, rather than dissecting them.  As we're just
fetching the values, if we get an error, put the identifer and length
into the protocol tree (if we've enabled that) with
"dissect_ber_identifier()" and "dissect_ber_length()".

Properly declare class and tag variables as signed.

svn path=/trunk/; revision=16602
2005-11-26 04:16:40 +00:00
Guy Harris 12ae3bba4d Don't crash if a null OID pointer is passed to
"call_ber_oid_callback()".  (Arguably, the caller of
"call_ber_oid_callback()" should check for that, and report that a
presumably-required field is missing.)

svn path=/trunk/; revision=16544
2005-11-18 10:06:47 +00:00
Tomas Kukosa 3b770d5c7c - dissect_ber_object_identifier() returns value as tvb
- new dissect_ber_object_identifier_str() function
 - BER dissectors adapted and regenerated

svn path=/trunk/; revision=16501
2005-11-14 10:02:31 +00:00
Ronnie Sahlberg ce341ab40f add decoding of some more universal types for the opportunistic decode of unknown ber blobs.
svn path=/trunk/; revision=16343
2005-10-27 11:27:40 +00:00
Ronnie Sahlberg 3824015b82 remove a strcpy call
svn path=/trunk/; revision=16237
2005-10-16 00:36:43 +00:00
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
Ronnie Sahlberg b95490206d from Olivier J
bugfix for IMPLICIT NULL in BER sequences
and gsmmap updates



svn path=/trunk/; revision=14160
2005-04-21 21:37:23 +00:00
Ronnie Sahlberg 20a4d3257e Add a tree parameter to get_ber_length() so that
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.



svn path=/trunk/; revision=14145
2005-04-20 08:35:47 +00:00
Gerald Combs 7c5083489f In dissect_ber_bitstring32(), make sure tmp_tvb is properly initialized.
Fixes bug 32.

svn path=/trunk/; revision=14092
2005-04-15 14:18:08 +00:00
Gerald Combs adbc8b86b5 In dissect_ber_integer(), generate a warning if the integer length is
invalid instead of throwing an assertion.  Fixes bug 25.

svn path=/trunk/; revision=14080
2005-04-14 20:16:35 +00:00
Gerald Combs 3008014ed7 Add another passel of tvb_ensure_bytes_exist()s. Fixes bug 24.
svn path=/trunk/; revision=14079
2005-04-14 20:01:14 +00:00
Gerald Combs a6b24ceaaa Add a tvb_ensure_bytes_exist() to dissect_ber_octet_string(). Fixes bug
23.

svn path=/trunk/; revision=14078
2005-04-14 19:53:27 +00:00
Gerald Combs d357c745a6 In dissect_ber_octet_string_wcb(), make sure out_tvb is non-NULL before
trying to use it so that we don't throw an assertion.  Fixes bug 22.
Do the same thing in dissect_ber_GeneralString().

svn path=/trunk/; revision=14065
2005-04-13 21:20:23 +00:00
Gerald Combs e3bd36c2d5 Add a couple of tvb_ensure_bytes_exist() calls to fix bug 12.
svn path=/trunk/; revision=14064
2005-04-13 20:59:39 +00:00
Guy Harris 93692fa5aa Fix a couple of "proto_tree_add_text()" calls to pass the right arguments.
svn path=/trunk/; revision=13989
2005-03-31 23:48:08 +00:00
Anders Broman dfdff5a70c Improve some debug messages.
svn path=/trunk/; revision=13980
2005-03-30 19:09:48 +00:00
Ronnie Sahlberg 95d12a0bc6 From Tim
small bugfix for packet-ber.c if packet is malformed, prevent dereferenceing a null pointer


svn path=/trunk/; revision=13976
2005-03-30 09:18:25 +00:00
Anders Broman 6211456ece From Jacques Olivier:
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)

svn path=/trunk/; revision=13895
2005-03-24 14:21:30 +00:00
Ronnie Sahlberg fbf762bda5 update asn2eth and all generated dissectors to new dissect_ber_boolean that takes a implicit_tag parameter
svn path=/trunk/; revision=13479
2005-02-23 08:57:47 +00:00
Anders Broman a4db2eb570 In case of "faulty" BER tag:s return tvb = NULL
svn path=/trunk/; revision=13208
2005-01-30 17:48:18 +00:00
Ronnie Sahlberg d5ed983336 change the incorrect BER_UNI_TAG_TeletextString into BER_UNI_TAG_TeletexString
svn path=/trunk/; revision=12743
2004-12-13 11:59:48 +00:00
Ronnie Sahlberg 8afae320de update of the asn2eth compiler to use the types ber_[choice|sequence]_t instead of ber_[choice|sequence]
regenerated all dissectors


fixed the choice/sequence struct to use unsigned entities for class and tag
(to reduce some compiler warning and because it should be signed quantities)



svn path=/trunk/; revision=12740
2004-12-13 08:15:34 +00:00
Ronnie Sahlberg 97f465c157 make the unknown_ber helper try to dissect NumericString and ENUMERATED when it encounters them
svn path=/trunk/; revision=12733
2004-12-12 22:59:43 +00:00
Ronnie Sahlberg 896737c467 update the helper for BER GeneralizedTime to handle implicit tag and update all dissectors using GeneralizedTime
svn path=/trunk/; revision=12732
2004-12-12 22:47:24 +00:00
Ronnie Sahlberg 4490217530 update to the ber CHOICE helper to make it handle (i hope) a CHOICE inside a CHOICE properly.
svn path=/trunk/; revision=12731
2004-12-12 22:19:00 +00:00
Ronnie Sahlberg 0e528dc7a1 updates from tomas and anders
create some missing makefiles for autogenerated dissectors

finish the transition to the new ber integer dissetor helper signature
and regenerate all ber dissectors



svn path=/trunk/; revision=12724
2004-12-12 01:14:03 +00:00
Ronnie Sahlberg dab0fabcad remove the function with the old signature for ber integer dissection
svn path=/trunk/; revision=12723
2004-12-12 00:24:21 +00:00
Ronnie Sahlberg f07b25895b when creating a new subset tvb for a field for further dissection by child dissectors, then if the original tvb is short and doesnt contain enough data, try to create a new subset tvb with as much data we do have instead of just bailing out.
svn path=/trunk/; revision=12623
2004-11-30 03:39:34 +00:00
Ronnie Sahlberg 222ba89923 update dissection of unknown blobs to try to dissect even more stuff.
svn path=/trunk/; revision=12605
2004-11-25 22:27:52 +00:00
Ronnie Sahlberg 43045f122d updates to prettify a bit when attempting to dissect an unknown blob
svn path=/trunk/; revision=12604
2004-11-25 21:30:38 +00:00
Guy Harris 6ec445bfe4 Set the length of the tvbuff to be handed to the subdissector
appropriately (minimum of reported length and length of data left
in the parent).

svn path=/trunk/; revision=12569
2004-11-21 23:02:36 +00:00
Ronnie Sahlberg c47d1f0aa6 with the autogenerated export conformance files we need a small change to packet-ber.c
asn2eth  generates exports for CHOICE as of BER_CLASS_UNI  while the handgenerated ones specified the calss as BER_CLASS_ANY.

make dissect_ber_sequence()  look at the tag as well and if -1 its a wildcard and anything goes.



svn path=/trunk/; revision=12559
2004-11-21 10:34:08 +00:00
Ronnie Sahlberg 2ba488f839 When we have a BER blob but we dont have the dissector for that oid implemented in ethereal (yet),
call a new function to start dissecting what unknown fields we can dissect.

Currently only PrintableString and INTEGER implemented but it will be easy to add other BER Universal types as needed later



svn path=/trunk/; revision=12544
2004-11-18 10:46:27 +00:00
Ronnie Sahlberg 27df480915 make SEQUENCE OF understand a sequence of ANY
svn path=/trunk/; revision=12526
2004-11-14 09:45:04 +00:00
Ronnie Sahlberg 20697638ac make octet string also allow for utf8strings
svn path=/trunk/; revision=12524
2004-11-14 08:50:37 +00:00
Ronnie Sahlberg bb0cf08d8c Major update of the ber helpers to fix a lot of bugs and make the handling of implicit_tags more sane.
It worked reasonably well   mainly, I suspect, due to implicit tags are reasonably uncommon in the dissectors we have already implemented and that the bugs were masking eachothers.


my regression tests (limited test samples though) decodes this new one exactly the same as the old one.


As a bonus by not changing anythiong in the decode  is that now it is possible to get dissection of implice items to work properly,  hence CMIP
(and also x509 Extensions work now)


make heaps of dissector helpers implicit_tag  aware.

change asn2eth to generate code to call the implicit_tag aware integer dissector helper.


svn path=/trunk/; revision=12520
2004-11-14 05:10:44 +00:00
Ronnie Sahlberg 2e13664c4b add new integer dissector helper that is aware of implicit tags
svn path=/trunk/; revision=12519
2004-11-13 14:16:06 +00:00
Ronnie Sahlberg a638e3681b fix bug in handling an optional item
svn path=/trunk/; revision=12518
2004-11-13 10:06:15 +00:00
Anders Broman f1b5065273 Make it possible to print name of OID strings for PER coded OID:s as well.
svn path=/trunk/; revision=12496
2004-11-09 06:49:35 +00:00
Ronnie Sahlberg ee310edcda fix call_ber_iod_callback() to move offset past the end of the current blob.
svn path=/trunk/; revision=12436
2004-10-30 01:54:40 +00:00
Ronnie Sahlberg bef8e01fcd fix small bug that gets offset confused for CHOICE { } OPTIONAL if there were no arms that matched
svn path=/trunk/; revision=12425
2004-10-28 11:35:43 +00:00
Anders Broman 0510221c29 Make it possible to register a string for an OID in the hash table.
svn path=/trunk/; revision=12412
2004-10-27 19:59:44 +00:00
Ronnie Sahlberg 97a6dc74e7 make SEQUENCE OF and CHOICE handle indefinite length encodings
svn path=/trunk/; revision=12382
2004-10-24 03:51:27 +00:00
Ronnie Sahlberg de1bcd5d88 make the SEQUENCE dissection helper understand and handle Indefinite Length
svn path=/trunk/; revision=12319
2004-10-16 12:53:09 +00:00
Guy Harris 518f7926b7 Constify more pointer arguments.
svn path=/trunk/; revision=12265
2004-10-11 18:34:54 +00:00
Guy Harris 3acb84d24a Make the "asn_namedbit *" argument to "dissect_ber_bitstring()" a
"const" pointer.

svn path=/trunk/; revision=12247
2004-10-08 21:14:33 +00:00
Guy Harris c5c8453097 "dissect_ber_sequence()" doesn't modify the "ber_sequence" structure
passed to it; make that argument a const pointer.

svn path=/trunk/; revision=12244
2004-10-08 20:24:23 +00:00
Guy Harris bbe7f89742 Move prefs.c and prefs.h into the epan subdirectory.
svn path=/trunk/; revision=12115
2004-09-27 22:55:15 +00:00
Ronnie Sahlberg 53912ffc47 fix bug in handling of offset for integers longer than 4 bytes
svn path=/trunk/; revision=12092
2004-09-25 02:44:45 +00:00
Guy Harris c68f62210f Add "tvb_get_ntoh64()" and "tvb_get_letoh64()" routines to fetch 64-bit
integers.

Make FT_INT64 and FT_UINT64 add numerical values, rather than byte-array
values, to the protocol tree, and add routines to add specified 64-bit
integer values to the protocol tree.

Use those routines in the RSVP dissector.

svn path=/trunk/; revision=11796
2004-08-22 00:31:58 +00:00
Ronnie Sahlberg ce6804616e add some algorithm oid's to x509af(for the time being)
(only those that take no parameters for the time being)

create a dummy ber oid callback for callbacks that are NULL


svn path=/trunk/; revision=11565
2004-07-29 09:52:14 +00:00
Ronnie Sahlberg 70d7bbebd0 prettify the oid printing of ber oid's
svn path=/trunk/; revision=11564
2004-07-29 09:32:13 +00:00
Ronnie Sahlberg 34b6e90f3e for very large integers, print them in hex thats better than nothing
but we can not filter on them anymore


svn path=/trunk/; revision=11563
2004-07-29 08:41:51 +00:00
Ronnie Sahlberg e7172b423b add nice text item for the case when we could not find the dissector for a specific OID/attribute to make it easier to see where we have missed implementing something.
svn path=/trunk/; revision=11491
2004-07-23 23:12:31 +00:00
Ronnie Sahlberg 52d5646696 inside dissect_ber_sequence() we know the expected length of the field that follows.
use this and create a new tvbsubset so that
1, reading too much data is flagged as MALFORMED PACKET indicating a bug in the dissector (or a packet that IS malformed)
2, this also implicitely passes the length of the data through the ber.oid dissector handle in case we want to pick it up later.



svn path=/trunk/; revision=11490
2004-07-23 23:06:38 +00:00
Ronnie Sahlberg 73f560c866 register ber oid functions through a special function in packet-ber.c which also takes (still unused) the name of the oid
so that sometime later it will be easy to add code to add the name of the oid to the dissection.



svn path=/trunk/; revision=11478
2004-07-23 07:08:14 +00:00
Ronnie Sahlberg 283807bf4b dissect the x509if/Name all the way down to the AttributeTypeAndDistinguishedValue structure but not the structure itself.
we are getting there, slow but steady


svn path=/trunk/; revision=11468
2004-07-22 10:05:59 +00:00
Ronnie Sahlberg dcea6b49c6 get rid of the nasty ber specific oid->callback table and reimplement the functionality using a dissector table instead i.e. the proper way.
svn path=/trunk/; revision=11457
2004-07-21 11:13:03 +00:00
Ronnie Sahlberg a9c3e27415 Small update to AlgorithmIdentifier.
Allow the TYPE field to match ANY type of BER construct.


svn path=/trunk/; revision=11441
2004-07-20 10:45:11 +00:00
Ronnie Sahlberg 723d3dbe44 Add the new protocols CMS, X509AF, X509IF, X509CE and X509SAT
to the ethereal build.

The dissections are semi-useful  but incomplete.
The big problem still remaining is the x509if  Name object not being 
dissected properly   thus causing the dissection to get out of sync/fail
halfway through the certificate structure.


work in progress but already semi-useful.


svn path=/trunk/; revision=11440
2004-07-20 09:11:40 +00:00
Gilbert Ramirez 669db206cb Move dissectors to epan/dissectors directory.
Also move ncp222.py, x11-fields, process-x11-fields.pl,
make-reg-dotc, and make-reg-dotc.py.

Adjust #include lines in files that include packet-*.h
files.

svn path=/trunk/; revision=11410
2004-07-18 18:06:47 +00:00