Commit Graph

108 Commits

Author SHA1 Message Date
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
Bill Meier 4e57694d4a Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39288
2011-10-06 03:35:44 +00:00
Bill Meier 94f36ca4ff Use ENC_NA as encoding for proto_tree_add_item() calls which directly reference an hf item (in hf[] with types:
FT_NONE
   FT_BYTES
   FT_IPV6
   FT_IPXNET
   FT_OID

Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN

svn path=/trunk/; revision=39260
2011-10-04 22:44:31 +00:00
Graeme Lunt 779206012c Microsoft Credential Security Support Provider (CredSSP) support.
Used by direct approach RDP for NTLMSSP authentication under SSL. 



svn path=/trunk/; revision=39196
2011-09-30 15:21:16 +00:00
Bill Meier 4c46725c2c Fix vi "modeline" so it works;
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5748

svn path=/trunk/; revision=39074
2011-09-21 16:28:53 +00:00
Stig Bjørlykke 5359494b1f Second try to move crc routines to libwsutil.
This time keep the tvb routines in epan.

Now we can use common crc routines outside epan.

svn path=/trunk/; revision=38810
2011-08-31 09:00:54 +00:00
Stig Bjørlykke 71f903b956 Revert r38800, as the crc routines contains some tvb functions.
svn path=/trunk/; revision=38803
2011-08-30 14:17:40 +00:00
Stig Bjørlykke 4132d40e50 Move all crc routines to libwsutil.
This way we can use the crc routines in wiretap.

svn path=/trunk/; revision=38800
2011-08-30 13:46:42 +00:00
Jeff Morriss 7ad71a2d78 Treat TVBs as opaque: use the accessor functions instead of accessing the fields
directly.

svn path=/trunk/; revision=37420
2011-05-27 01:57:33 +00:00
Bill Meier c0922b93b6 Don't assign to a variable which is then not referenced: Coverity 998 [UNUSED].
svn path=/trunk/; revision=37340
2011-05-20 20:41:23 +00:00
Guy Harris 96e2a4ffea According to MS-NLMP, the "version" field in the NTLMSSP blobs is
present only if the NTLMSSP_NEGOTIATE_VERSION flag is set in the flags
field, and that appears to be true in at least one capture I've seen.

svn path=/trunk/; revision=37197
2011-05-17 02:29:43 +00:00
Guy Harris 0f1503ef8a Fix cut-and-pasteo.
svn path=/trunk/; revision=37196
2011-05-17 01:38:28 +00:00
Stig Bjørlykke 9ec9b1ccb9 Pass pointers to structs instead of struct values to create_ntlmssp_v2_key.
Coverity 567.

svn path=/trunk/; revision=36248
2011-03-22 12:12:04 +00:00
Jeff Morriss 33f116a46d Restore pinfo->private_data after an exception was thrown by a subdissector.
This is necessary in case a subdissector had changed it but was unable to
restore it (due to the exception).

Remove check_col().

svn path=/trunk/; revision=34436
2010-10-08 17:48:22 +00:00
Bill Meier bd4da13134 #if 0 an used function
svn path=/trunk/; revision=34355
2010-10-03 19:49:15 +00:00
Bill Meier 107e909761 Make a number of functions static;
Rename two g_... functions so as to not be in GLib namespace;
Move proto_register... to just before proto_reg_handoff...
Reformat some lines;
More Whitespace cleanup.

svn path=/trunk/; revision=34354
2010-10-03 19:43:14 +00:00
Bill Meier f5962f094e Whitespace & formatting cleanup;
Use #if 0/#endif instead of /* */ to comment out code in a few places.

svn path=/trunk/; revision=34351
2010-10-03 18:51:38 +00:00
Bill Meier 8af9d02b8c Refactor dissection of CHALLENGE target-info & AUTHENTICATE ntlmv2-response attributes:
- decode all attributes as specified in MS-NLMP;
 - use common code for target-info and ntlmv2 attribute dissection;
Add filter for the "version" field;
Remove some obsolete #if 0'd code.

svn path=/trunk/; revision=34350
2010-10-03 18:23:46 +00:00