Commit Graph

125 Commits

Author SHA1 Message Date
Bill Meier 2fb674f739 Create/use value_string_ext to reference a value-string-array.
Define an array as const.


svn path=/trunk/; revision=53334
2013-11-15 00:15:20 +00:00
Jakub Zawadzki ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Michael Mann 22760b2d2a Remove pinfo->private_data from DCERPC dissectors and instead have dcerpc_info* infomation be passed in as a function parameter. Bug 9387 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9387)
All "generated" source was manually modified (with the power of search/replace), but I believe the "source input" files have been adjusted (checked into revs 53098 and 53099) to reflect the necessary changes (with possible whitespace formatting differences).

The Microsoft compiler doesn't flag "unused function parameters", so I apologize in advance if I may have missed a few.  The "dcerpc_info* di" parameter is used in almost every function.

svn path=/trunk/; revision=53100
2013-11-06 14:31:29 +00:00
Michael Mann f69a489472 NULL check ref_nt_challenge_response and ref_lm_challenge_response. Bug 9299 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9299)
From Matthieu Patou

svn path=/trunk/; revision=52732
2013-10-21 15:39:07 +00:00
Evan Huus 95bc2da1e8 Require the NTLMSSP response contents to be long enough before we try to memcpy
it. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9182

svn path=/trunk/; revision=52213
2013-09-25 16:41:09 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Evan Huus 6df83e8078 Add _g_ to the names of functions that allocate glib memory. This is a bit more
explicit, and frees up the "generic" names (like tvb_memdup) for new signatures
that take the appropriate wmem pool.

Majority of the conversion done with sed.

svn path=/trunk/; revision=52164
2013-09-21 17:04:41 +00:00
Evan Huus 606c422d5b Zero the key in ntlmssp, because we don't otherwise fill all of it. I suspect
the tvb_memcpy on the next line should be taking more data, but I don't know
enough about the protocol to be sure. This is the least disruptive way to fix
the last valgrind error from
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8941

svn path=/trunk/; revision=52145
2013-09-19 17:39:43 +00:00
Michael Mann 9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Evan Huus 1c46818354 Convert to wmem, and as per Michael's suggestion in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9107, use zeroed memory for
ntlmssp_info structs.

svn path=/trunk/; revision=51799
2013-09-06 15:59:45 +00:00
Evan Huus 0e885e8089 Set length and contents to 0/NULL if the blob is empty. Fixes
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9107

svn path=/trunk/; revision=51798
2013-09-06 15:29:18 +00:00
Martin Kaiser 2d1b7d1e32 add casts to make my compiler (gcc 4.6.3) happy
svn path=/trunk/; revision=51790
2013-09-05 20:18:13 +00:00
Michael Mann b3f4084c4e Make "content blob" dynamically sized so it doesn't take up 20k of memory per conversation.
Add filterable expert info while we're at it.

svn path=/trunk/; revision=51787
2013-09-05 16:29:08 +00:00
Anders Broman b422c4892d From Dirk:
fix NTLMSSP Target Info Attribute dissection

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9098

svn path=/trunk/; revision=51764
2013-09-05 04:57:33 +00:00
Chris Maynard 2cb65291c1 Fix clang warnings: Value stored to '[decrypted_]offset' is never read.
svn path=/trunk/; revision=51441
2013-08-20 18:46:46 +00:00
Jeff Morriss 2df54da6e2 Move a bunch of the crypt modules and pint.h into wsutil.
This means wsutil now links against libcrypt.

Protect a bunch of the crypt header files from multiple inclusion.

svn path=/trunk/; revision=51100
2013-08-01 23:34:47 +00:00
Jeff Morriss 23d9a348a1 Fix the fuzz failure reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8941 :
Storing 2 different structures on the fd proto_data (with the same key) isn't
safe: use different keys to keep them separate.  I do wonder if both are
really necessary...

This fix can be back-ported to trunk-1.10 but not trunk-1.8 (which lacks the
key identifier for proto_data's).

svn path=/trunk/; revision=50734
2013-07-18 23:34:48 +00:00
Anders Broman b17cefcd66 From Cal Turney:
Missed p_get_proto_data() signature update in #if 0:ed code.

svn path=/trunk/; revision=49342
2013-05-16 21:00:36 +00:00
Anders Broman 85a8e304dd Add the posibillity to use a key for per-packet-data.
svn path=/trunk/; revision=49259
2013-05-12 18:11:02 +00:00
Evan Huus f2ccdd6dbf From Dirk Jagdmann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8640
Fix dissection of the NTLMSSP v2 Challenge Response. The old code would loop
over the Attributes until the end of the Response, however in reality the last
values of a Response are four 0 bytes and maybe padding. Also change the names
of the values to match those from the Microsoft specification. Also change the
name of one flags bit from unknown to "Anonymous", again according to the
Microsoft spec.

svn path=/trunk/; revision=49258
2013-05-12 14:26:37 +00:00
Anders Broman 27744ecc2d From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48337
2013-03-16 08:12:29 +00:00
Guy Harris 6b629c4d92 Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c.  Update their callers to include
<epan/show_exception.h> to get their declaration.

Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff.  Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).

Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).

Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.

Use show_exception() to report non-fatal errors, rather than doing it
yourself.
 
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.

Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.

Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.

svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
Bill Meier 96a24cc79f Fix spelling/typos found using a list of commonly misspelled words.
The misspellings were mostly in comments but some were
in text strings visible to the user.


svn path=/trunk/; revision=47899
2013-02-26 04:42:26 +00:00
Bill Meier 1823aa007c it's ==> its & its ==> it's as needed.
svn path=/trunk/; revision=47891
2013-02-26 01:06:19 +00:00
Guy Harris 29715ccc8f How can I get a new tvbuff that starts at an offset within a given
tvbuff and runs to the end of the tvbuff?  Let me count the ways....

Replace a bunch of different ways of doing that (some incorrect, in that
they're not properly handling tvbuffs where the captured and reported
lengths are different) with tvb_new_subset_remaining().

svn path=/trunk/; revision=47751
2013-02-19 23:17:07 +00:00
Bill Meier d3a7f4b817 Use '#if 0 ... #endif' rather than /** ... **/ to comment out
unused hf[] entries (which I should have done in the first place).

svn path=/trunk/; revision=47390
2013-01-31 18:31:28 +00:00
Bill Meier 0960e508e4 Comment out cases of unused hf array entries found by checkhf.
svn path=/trunk/; revision=47302
2013-01-26 18:54:53 +00:00
Balint Reczey 335d6ca7e2 Prevent copying longer than expected NTLM SSP key
svn path=/trunk/; revision=47248
2013-01-24 09:34:54 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Jakub Zawadzki 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +00:00
Bill Meier a9bb084310 Fix (minor ?) memory leak;
General cleanup:
 - use expert...() instead of a 'printf()';
 - #include <stdio.h> only if debug enabled;
 - remove unneeded variable initializations;
 - localize some variables;
 - reformat hf[] entries;
 - use consistent whitespace formatting.

svn path=/trunk/; revision=44545
2012-08-16 19:58:29 +00:00
Bill Meier cf706ca547 From Stefan Metzmacher: Updates for the SMB2/3
This patches add some missing things for SMB2/3 and support for decryption
of SMB3 traffic

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7645

From me: Change an initializer from C99 to C89 style (since the
 Microsoft compiler doesn't support C99).

svn path=/trunk/; revision=44542
2012-08-16 17:03:07 +00:00
Bill Meier 638d74d43f Use val_to_str_const() where appropriate;
Also (for a few files):
- create/use some extended value strings;
- remove unneeded #include files;
- remove unneeded variable initialization;
- re-order fcns slightly so prefs_reg_handoff...() at end, etc

svn path=/trunk/; revision=44438
2012-08-10 22:55:02 +00:00
Pascal Quantin d6959d2715 As suggested by Richard Sharpe in http://www.wireshark.org/lists/wireshark-dev/201207/msg00111.html :
Make the NTLMSSP Unknown message type string more explicit

svn path=/trunk/; revision=43713
2012-07-14 18:31:08 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Pascal Quantin 86dd3248f6 Avoid using C99 '%hh' length modifier
svn path=/trunk/; revision=42904
2012-05-29 21:51:52 +00:00
Guy Harris c972b866b5 Use C89-style comment rather than C++/C99-style comment.
svn path=/trunk/; revision=40965
2012-02-11 02:45:58 +00:00
Ronnie Sahlberg bec3996bb7 NTLM show the decrypted data buffer in a separate tab
from Matthieu Patou <mat@matws.net>

svn path=/trunk/; revision=40958
2012-02-11 02:06:45 +00:00
Ronnie Sahlberg d0f5a1842b NTLM print the whole string, not just half the string
from Matthieu Patou <mat@matws.net>

svn path=/trunk/; revision=40957
2012-02-11 02:05:57 +00:00
Ronnie Sahlberg 00cebab4aa NTLM: clear the nt_password_unicode buffer.
from Matthieu Patou <mat@matws.net>

svn path=/trunk/; revision=40956
2012-02-11 02:04:36 +00:00
Ronnie Sahlberg 9b24fe2822 NTLM make it easier to activate/deactivate debugging code in NTLM
from Matthieu Patou <mat@matws.net>

svn path=/trunk/; revision=40955
2012-02-11 02:03:20 +00:00
Ronnie Sahlberg 30e8d6371d NTLM: If we encounter an NTLM blob that is bigger than out fixed maxbuffer,
log a warning to the user.

from Matthieu Patou <mat@matws.net>

svn path=/trunk/; revision=40954
2012-02-11 02:01:47 +00:00
Ronnie Sahlberg bc359fc18f NTLMv2 blobs can be bigger than 256 bytes. Set the limite to 10k for now.
From Matthieu Patou <mat@matws.net>

svn path=/trunk/; revision=40953
2012-02-11 01:59:55 +00:00
Jörg Mayer 2097912587 Rename crypt-xxx to xxx
svn path=/trunk/; revision=40511
2012-01-15 12:29:44 +00:00
Bill Meier 4a976f1be7 Use tvb_new_child_real_data() instead of tvb_new_real_data() + tvb_set_child_real_data_tvbuff().
svn path=/trunk/; revision=40173
2011-12-13 04:01:33 +00:00
Bill Meier 30cee99009 Fix a number of proto_tree_add_item() encoding args.
svn path=/trunk/; revision=39774
2011-11-09 17:33:18 +00:00
Bill Meier d7a1840204 Replace use of tvb_get_ephemeral_faked_unicode() by use of tvb_get_ephemeral_unicode_string();
Fix encoding arg as needed.

svn path=/trunk/; revision=39530
2011-10-23 22:58:45 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Bill Meier 126aa85393 Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, FT_STRINGZ, FT_UINT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified
    then use ENC_ASCII.
 2. For all but FT_UINT_STRING, always use ENC_NA
    (replacing any existing True/1/FALSE/0
    /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN).



svn path=/trunk/; revision=39426
2011-10-15 18:46:26 +00:00