Commit Graph

253 Commits

Author SHA1 Message Date
Stefan Metzmacher 419ee94172 packet-smb2: setup decryption keys for kerberos session setups
Change-Id: I1a641da6f85e047984631c4dec158718fd7d011d
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/365
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-07 06:56:33 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Stefan Metzmacher 5d0be58cb5 packet-smb2: register a dissector on top of smb_direct
Change-Id: I6a87c57d513af9c8ce9dff783988f7242f5257d0
Old-Change-Id: If52130f7f9e9783a8ecc8b8b3c01d86a02e4f946
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/57
Reviewed-by: Evan Huus <eapache@gmail.com>
(cherry picked from commit cd9f6e077f)
Reviewed-on: https://code.wireshark.org/review/390
2014-02-25 21:59:58 +00:00
Guy Harris 75015e4351 Can't register in a non-existent dissector table.
This will have to wait until the SMB Direct dissector is actually
committed.  There's no point in getting a bunch of "OOPS: dissector
table "smb_direct" doesn't exist" messages every time you run Wireshark
or TShark.

Change-Id: I9772eb3f119822fbeaa78876570798d49bb4cab9
Reviewed-on: https://code.wireshark.org/review/382
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-02-25 19:55:25 +00:00
Stefan Metzmacher cd9f6e077f packet-smb2: register a dissector on top of smb_direct
Change-Id: If52130f7f9e9783a8ecc8b8b3c01d86a02e4f946
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/57
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-25 17:58:54 +00:00
Alexis La Goutte 2516e54202 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I695824b95f5e8978c2b58c4e98471d1ed204d686
Reviewed-on: https://code.wireshark.org/review/60
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-01-31 15:56:18 +00:00
Stefan Metzmacher 848546ece8 packet-smb2: dissect SMBDirect Buffer Descriptors
Change-Id: Ie91c19078a92f36044b4eee55c3228e3257bf45d
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/53
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-01-31 14:25:52 +00:00
Stefan Metzmacher 6167a0f6ed packet-smb2: fix lease epoch fields
Bug: 9703

Change-Id: I1955360adaee53846f084434c59180d715e19fcd
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-01-29 17:42:51 +00:00
Volker Lendecke fc216102e3 smb2: Lease Epoch is only 16 bit
See [MS-SMB2] 2.2.14.2.12

Bug: 9703

Change-Id: Ia9c9c658bd5020e0dad84fc74617fed60ce7df06
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-01-29 17:41:31 +00:00
Volker Lendecke 05a7306482 smb2: Fix a typo
Bug: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9703

Change-Id: I8ebb20a48e1131fcf14ee55e5e1822a8dcd713d2
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-01-29 11:34:47 +01:00
Jakub Zawadzki deb2b236f2 Add missing includes
svn path=/trunk/; revision=54332
2013-12-21 17:23:17 +00:00
Anders Broman 7a5d4ed4da - Make local functions static.
- Forward declaration of register functions.

svn path=/trunk/; revision=53941
2013-12-11 19:46:38 +00:00
Bill Meier 04cdccdb83 - Create/use several extended value_strings
(sort associated value_string arrays as needed);

- Use new VALUE_STRING_LIST mechanism/macros to
  create enums and value_string arrays for:
    WERR_errors, DOS_errors, SRV_errors, and HRD_errors;

- Declare certain global value_string arrays as static (local)
  and use global extended value_strings to reference same;
    (e.g., ms_coiuntry_codes value_string_array)

- Rename SMBE_... defs used in several different value_string arrays
  to prevent potential name collisions:
   ( e.g., for SRV_errors: SMBE_... ==> SMBE_SRV_...)
   Done for value_string arrays: DOS_errors, SRV_errors, HRD_errors;

- WERR_errors value_string array:
    Note that WERR associated defs no longer exist in the latest samba doserr.h.
    (The WERR_errors defs were originally generated from the samba doserr.h).
    For now: WERR_errors kept as is.

- ToDo: Fix PIDL-generated dcerpc dissectors to use NT_errors_ext
        and WERR_errors_ext extended value_strings.

- Add editor modelines to a few files.

- Make whitespace changes.


svn path=/trunk/; revision=53614
2013-11-27 16:30:20 +00:00
Michael Mann e2df7c83cb Move dceprc_procedure_name from packet_info to dcerpc_info. Doesn't appear to be "used" by dissectors, just stored (for help in debugging?).
svn path=/trunk/; revision=53552
2013-11-24 20:55:55 +00:00
Bill Meier a848b341ac Create/use extended-value-strings to reference certain value-strings;
Constify a character array;
Fix a typo in a coment;
Tweak some whitespace;

svn path=/trunk/; revision=53360
2013-11-16 02:53:12 +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
Bill Meier 0ad98563a2 From didier gautheron: remove redundant or use faster col_xxx functions
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster.
- same for  replace col_append_fstr and col_append_str
- remove col_clear() when it's redundant:
    + before a col_set/col_add if the dissector can't throw an exception.
- replace col_append() after a col_clear() with faster col_add... or col_set

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


svn path=/trunk/; revision=52948
2013-10-29 14:09:20 +00:00
Michael Mann 1e0405a3a3 Remove SMB's use of private_data and just pass the data through all of the dissection functions
svn path=/trunk/; revision=52856
2013-10-25 23:59:30 +00:00
Cal Turney 4ae53bc208 Reorder all of the bitmask trees according to its endianess from highest to lowest order bit.
These consist of the following bitmask fields: 
[packet-smb.c] 'Create Flags', 'Access Mask', 'File Attributes', 'Share Access', 'Create Options',
               'Security Flags', 'Optional Support'(in TreeConnect AndX responses), and "Quota Flags"
[packet-smb2.c] 'Flags', 'Session Flags', 'Security mode', and 'Interface Capabilities'.

[packet-smb.c] Made the tfs_file_attribute_xxx true_false_string values less verbose and more compact.

[packet-smb2.c] Changed all references to "RMDA" to RDMA".

[packet_smb.c] In dissect_qfi_SMB_FILE_NETWORK_OPEN_INFO() (GetInfo response) changed "Unknown Field"
               to "Reserved" (See capture 'DMtrace2.cap' frame 20023).

svn path=/trunk/; revision=52623
2013-10-15 16:41:29 +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
Pascal Quantin da8240ef60 emem -> wmem (except uat or init routines)
svn path=/trunk/; revision=52087
2013-09-15 21:36:37 +00:00
Evan Huus be2ebb1934 Remove unused variables, fix typos.
svn path=/trunk/; revision=52046
2013-09-15 02:26:20 +00:00
Michael Mann b38ee917b1 Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly.
The script didn't catch as many as I would have liked, but it's a start.

The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum.

svn path=/trunk/; revision=52045
2013-09-15 01:48:30 +00:00
Evan Huus 771668d630 Register a wmem callback to free the glib hash tables used in SMB2 conversation
structs. Fixes the most egregious of the memory leaks (around 300KB) from
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9120

svn path=/trunk/; revision=51873
2013-09-09 17:51:30 +00:00
Evan Huus e3eb3456ff In SMB2 dissector, make sure pinfo->private_data is pointing to an SMB struct
before calling an SMB helper function which expects it. Fixes the primary error
in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9120

svn path=/trunk/; revision=51865
2013-09-09 12:16:18 +00:00
Jeff Morriss 565211c938 As pointed out in https://www.wireshark.org/lists/wireshark-dev/201307/msg00250.html :
r51066 should have also updated the hf_ variable name, comments, and a couple
of data structures.

(I don't know this protocol so these changes are basically a half-educated
global search-n-replace.)

svn path=/trunk/; revision=51080
2013-08-01 16:03:55 +00:00
Jeff Morriss fbbeebe054 From Richard Sharpe:
It's not Command Sequence Number but Message ID.

https://www.wireshark.org/lists/wireshark-dev/201307/msg00242.html

svn path=/trunk/; revision=51066
2013-07-31 13:30:29 +00:00
Michael Mann dfa2156e30 Remove check_col() and the occasional tree.
svn path=/trunk/; revision=49923
2013-06-14 02:50:46 +00:00
Anders Broman 81e80f2c0b From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48355
2013-03-17 16:48:47 +00:00
Evan Huus ee744dd8c7 Allocate zeroed memory instead of manually zeroing some of the fields. We were
missing a few anyways.

Fixes the rest of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8456

Also, add modelines.

svn path=/trunk/; revision=48236
2013-03-10 22:02:07 +00:00
Anders Broman 97c4bc6292 Use explicit casts.
svn path=/trunk/; revision=48212
2013-03-09 10:09:58 +00:00
Alexis La Goutte f6019d9d88 Make checkAPIs Happy
svn path=/trunk/; revision=48211
2013-03-09 09:45:28 +00:00
Alexis La Goutte a4eb0a12ed From Jose Pico via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8377 NEW FEATURE IMPLEMENTED: SMB2 SUPPORT FOR EXPORT->OBJECTS->SMB
Added functionality:
- SMB2 support for Export->Objects->SMB
- support for SMB_COM_CREATE, SMB_COM_OPEN, SMB_COM_READ and SMB_COM_WRITE commands
- Ability to choose between File Id and full file name as identifier for file re-building. Implemented as an option under Edit->Preferences->Protocols->SMB and Edit->Preferences->Protocols->SMB2.

Other minor changes and fixes:
- Full filename in file
- Inclusion of IP of SMB server when treeid name (i.e. hostname) is not known
- UTF-8 filenames encoding before passing them to Export Object Window
- Re-written insert_chunk function of export_object_smb.c to make it easier to debug
- Fixed of an error in insert_chunk function of export_object_smb.c (the verification of next free_chunk was always skipped after deleting one free_chunk).
- Removed duplicated code by inserting the function feed_eo_smb in packet-smb.c and packet-smb2.c
- Changed the label of Export->Objects->SMB menu into Export->Objects->SMB/SMB2

svn path=/trunk/; revision=48210
2013-03-09 08:44:14 +00:00
Jakub Zawadzki 26c04f86b0 Use AF_ defines from <epan/aftypes.h>
svn path=/trunk/; revision=47850
2013-02-24 09:38:22 +00:00
Martin Kaiser 38a73a32f3 include the wsutil/wsgcrypt.h instead of including gcrypt.h directly
svn path=/trunk/; revision=47802
2013-02-21 18:23:29 +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
Pascal Quantin 794183609d Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8164 :
Clarify content of StructureSize field

svn path=/trunk/; revision=46994
2013-01-07 23:08:25 +00:00
Pascal Quantin 7d8ab07431 Fix some errors found by fix-encoding-args.pl script
svn path=/trunk/; revision=46933
2013-01-04 17:35:46 +00:00
Alexis La Goutte 0d40765d08 From Richard Sharpe via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8074 SMB2 file_info_0f is actually FileFullEaInformation
[MS-FSCC].pdf section 2.4.15 gives us the correct format of the structure currently know and file_info_0f.

The unknown byte is actually the second byte of the EA Value Len.

svn path=/trunk/; revision=46562
2012-12-16 15:34:33 +00:00
Pascal Quantin 79f67d319e Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7790 :
Add missing offset increment after displaying minimum count

svn path=/trunk/; revision=45823
2012-10-28 20:59:04 +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 dee4443809 Add data parameter to dissector_try_heuristic
svn path=/trunk/; revision=44871
2012-09-11 08:26:48 +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 1b8e41afab General cleanup of whitespace formatting.
svn path=/trunk/; revision=44543
2012-08-16 18:06:57 +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
Michael Mann a3db9aedfb bugfix minor memory leaks with GString use
svn path=/trunk/; revision=44514
2012-08-15 13:55:29 +00:00
Pascal Quantin c299201935 Fix a few Clang warnings (dead increment, dead assignment)
svn path=/trunk/; revision=44082
2012-07-27 21:58:26 +00:00
Michael Mann 0d4eafb04d Update display filter names per Bug 2794. Part 1 of many.
svn path=/trunk/; revision=43907
2012-07-22 03:06:37 +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