Commit Graph

327 Commits

Author SHA1 Message Date
Pascal Quantin 6baa1b544c Remove Nmake build system
Change-Id: I3bd474f3cda9667dec66426b5729449953df3e61
Reviewed-on: https://code.wireshark.org/review/15777
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2016-06-15 19:21:57 +00:00
Gerald Combs dfc545d8f2 Test: Revert debugging output.
Revert "Test: Make capture_step_stdin more verbose." and "Test: more
suite-capture debugging." Tests on the Windows 8.1 builder have been
passing since recommended OS updates were installed on the 24th.

This reverts commits 7f710ef2b5 and
f52c3c468a.

Change-Id: I7cf10a38ba001426baea5fc76a34610c3a26ced2
Reviewed-on: https://code.wireshark.org/review/15590
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-05-27 18:44:10 +00:00
Gerald Combs 37df3400dc Test: capture_step_stdin updates.
In capture_step_stdin, print information about our test capture if we
fail.

Change-Id: I046f9d22b1bb2d52d96926f50379ab51e6279eb3
Reviewed-on: https://code.wireshark.org/review/15125
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-04-26 21:58:12 +00:00
Gerald Combs 7f710ef2b5 Test: more suite-capture debugging.
Change-Id: I94967aeabdf2786868c3f7fce9e95633332d4948
Reviewed-on: https://code.wireshark.org/review/15123
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-04-26 20:52:08 +00:00
Gerald Combs f52c3c468a Test: Make capture_step_stdin more verbose.
Add some verbosity to the stdin capture test. Hopefully this will shed
some light on the Windows 8 builder failures.

Change-Id: Ife2bbbaeed7a1e4a7ddd1c1f86322ba25d154f4c
Reviewed-on: https://code.wireshark.org/review/15122
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-04-26 19:22:57 +00:00
Guy Harris 256a7be13e The dissector for HTTP-over-SSL is now called "http-over-ssl", not just "http".
The "http" dissector is what's used for protocols other than TCP, SCTP,
and SSL/TLS.

Change-Id: Ib5138d3a082f1017b7ef190e5128a21eb9a49e92
Reviewed-on: https://code.wireshark.org/review/14947
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-17 06:39:01 +00:00
Guy Harris 954afef645 There are two separate IP-over-Infiniband encapsulations.
pcap files and snoop files have different headers, so there's no
IP_OVER_IB encapsulation type, there are separate types for pcap and
snoop.

Change-Id: I00146e478d05bb11c634df0c386329db8de5635d
Reviewed-on: https://code.wireshark.org/review/14774
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-02 07:41:34 +00:00
João Valverde aedc4af6c1 Use absolute path for test suite TEST_OUTDIR
Error out if it can't be created.

Change-Id: I1a087f0e0cc064be7a417b9a2e66cf3c940e02fa
Reviewed-on: https://code.wireshark.org/review/14565
Reviewed-by: João Valverde <j@v6e.pt>
2016-03-23 15:15:22 +00:00
Guy Harris c9c0effa4b Try putting the output directly into the error message.
When the tests are run in the buildbot, messages such as

	Error during test execution: see {pathname}

aren't very useful.

Change-Id: I4509ea58c162c264c316358019a1cbc01cd93e31
Reviewed-on: https://code.wireshark.org/review/14135
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-25 03:24:18 +00:00
Guy Harris f31449076c Initial support for FreeBSD USB captures.
(There's also work needed in libpcap; that's also in progress.)

Change-Id: Iff5a34c139a000865e2d78cc17a4af5ff24fb44b
Reviewed-on: https://code.wireshark.org/review/14025
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-20 11:12:48 +00:00
Guy Harris 4e85b62ae5 Allow test of the -D and -L options to succeed or fail with a permissions error.
We cannot easily predict what will happen, given the configuration of
the OS, the permissions on files, the availability of extcap devices,
the version of libpcap/WinPcap/NPcap (present or future), etc., etc.,
etc..  Allow those tests to succeed (as would be the case if you have
the necessary permissions) or fail with a non-command-line-syntax error
(as would be the case if you don't have the necessary permissions), but
not to fail with a command-line syntax error.

Change-Id: I76af898d5f146fcf3507c06f101acb578085e6fa
Reviewed-on: https://code.wireshark.org/review/13957
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-15 20:17:54 +00:00
Vasil Velichckov d5c1449d1b [text2pcap] Fix parsing of hash sign at the end of the line
Change-Id: I4ff1ef28aba353fd7548cb5c0603fc29479aa854
Reviewed-on: https://code.wireshark.org/review/13294
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-04 05:13:16 +00:00
Cedric Izoard 6991149557 [airpdcap] Add support to decrypt TDLS traffic
- When scanning for keys, check for TDLS action frames
  (need to have TLDS response or confirm to derive the key)
- When deriving PTK, also check MIC to ensure the key has been correctly
  computed.
- As SA is between two STAs (and not STA and AP), store highest MAC
  address in sa.bssid, and the other one in sa.sta
  => Add new function (AirPDcapGetSaAddress) that will check for TDLS
  case.
- Add test in decryption suite

Bug: 11312
Change-Id: Ieccb6a23a0ffbf3b705dac9b67c856ae2d3eeca9
Reviewed-on: https://code.wireshark.org/review/13664
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-04 04:54:30 +00:00
Alexis La Goutte a57c3bcc87 suite-decrypt: fix mixed indent (use tabs)
Change-Id: I80f2afb6e0cc44af6466fa255e91a40b29c4ca13
Reviewed-on: https://code.wireshark.org/review/13685
Reviewed-by: cedric izoard <cedric.izoard@ceva-dsp.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-03 12:38:21 +00:00
Alexis La Goutte a47c850d50 suite-mergecap: fix indent (use tabs)
Change-Id: I9b3fb7d09d8dc90366167b1072dcdd4efc6f0516
Reviewed-on: https://code.wireshark.org/review/13684
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-03 12:36:46 +00:00
Alexis La Goutte 05384709a0 Suite test: fix modelines for bash script (emac)
c-basic-offset -> sh-basic-offset

Change-Id: I16b19b608fbdb7f0408f7c31871fae746c8c4f50
Reviewed-on: https://code.wireshark.org/review/13683
Reviewed-by: cedric izoard <cedric.izoard@ceva-dsp.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-03 12:35:30 +00:00
Pascal Quantin 699c61f3db Update Lua tests after g9eda2fa
Change-Id: I3e9849afc8df9d81d0d9e0a4eaa9800d9c1ce8ec
Reviewed-on: https://code.wireshark.org/review/13517
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-01-24 21:49:12 +00:00
Cedric Izoard 9b1e318b8e test: Add test in decryption test suite for 802.11w
- Add a test to check decryption of management frames

Bug: 11995
Change-Id: I588d0f17b9e5efc841266b9dae4764e5e931be3f
Reviewed-on: https://code.wireshark.org/review/13259
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-14 03:15:35 +00:00
Guy Harris e01f8fb3ad Explicitly specify the template for the mktemp command.
Not all versions of mktemp support omitting the template; in particular,
the one provided by some BSD-flavored OSes don't.

Change-Id: I657e002559dce165c677a473aa10bb17cc506037
Reviewed-on: https://code.wireshark.org/review/12592
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-13 18:05:36 +00:00
Gerald Combs 4454fb02c7 Ping on Windows isn't necessarily IPv4-only.
The default prefix policy on modern versions of Windows prefers IPv6.
This in combination with the fact that our ping target (www.wireshark.org)
currently has both A and AAAA records might result in ICMPv6 traffic
instead of ICMPv4. Update the capture test suite accordingly.

Change-Id: I5c88f24fb9458526ffd44c5003f09247b6999ce7
Reviewed-on: https://code.wireshark.org/review/12553
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-12-12 01:52:54 +00:00
Guy Harris 0c6c08a60a Change Lua tests to reflect the disappearance of WTAP_ENCAP_IEEE_802_11_AIROPEEK.
The old global tests don't work; get rid of them.  Fix the values of the
Lua globals in the new test, and get rid of IEEE_802_11_AIROPEEK.

(Yes, if you have a Lua script that depends on IEEE_802_11_AIROPEEK
being defined, or that depends on the values of the Wiretap
encapsulations not changing, it breaks.  Fix it.)

Change-Id: I245c1c0c3ba1c450f7950c754624c51b5564848a
Reviewed-on: https://code.wireshark.org/review/12210
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-26 21:34:24 +00:00
Alexander Wetzel 9cd66b270c WPA (IEEE802.11) decryption function cleanups
- Updated AirPDcapPacketProcess function description
 - Try to return better error codes
 - Remove broken/useless return of keys from AirPDcapRsna4WHandshake

Change-Id: I1e4e0a76f6d1307e11c0466f17935dd7030561e1
Reviewed-on: https://code.wireshark.org/review/12033
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-25 21:00:59 +00:00
Guy Harris 95fd55e56b For now, call the finish routine in Lua file writers "close".
If we ever change the way file writers work, in a fashion incompatible
with the existing way they work, we'll also rename this member - and get
rid of checks for earlier versions of the Lua interface.

Change-Id: I64065944fa31371f5249cafd930c18f180ad7299
Reviewed-on: https://code.wireshark.org/review/11879
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-16 19:18:15 +00:00
Guy Harris 3425b5bc48 Update tests to reflect Lua file API change (write_close -> write_finish).
Change-Id: I7288cd3660dfd14be95dc42910faed47eca8226b
Reviewed-on: https://code.wireshark.org/review/11661
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-09 20:01:06 +00:00
Alexander Wetzel cb3dd958af WPA/WPA2 decoding fixes and improvements
- start decoding when we have eapol1+2 packets
  Do not insist on a complete captured handshake, decode what we can.

- more robust way to detect eapol #2 packets
  At least Win 10 is violating the spec on rekey by setting the secure
  bit in #2. Unpatched version shows and handles #2 as #4, breaking
  decoding after rekey.

- fixed eapol rekey key handling
  Inital patch (see https://code.wireshark.org/review/8268)
  is adding redundant keys, since it scans all the time
  and not only once.

- ignore tailing garbage after eapol sections in frame
  See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9065#c8

Included testcase to test decode for incomplete handshakes and eapol2
packets with secure bit set on rekey.

Ping-Bug: 9065
Change-Id: Id775088db9b5aaa80da9efdeed6902d024b5c0cd
Reviewed-on: https://code.wireshark.org/review/11484
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-11-09 11:28:14 +00:00
Vasil Velichckov 8201711e80 text2pcap: Add test suite
Use the pcap captures from test/captures/ and
- Get information for the input pcap file with capinfos
- Generate an ASCII hexdump with text2pcap
- Convert the ASCII hexdump back to pcap using text2pcap
- Get information for the output pcap file with capinfs
- Check that file type, encapsulation type, number of packets and data size
  in the output file are the same as in the input file

Change-Id: I659204fb0a46e9cd99d03eb666f55fac95ae053e
Reviewed-on: https://code.wireshark.org/review/11042
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-15 14:00:04 +00:00
Graham Bloice 009b40ba06 Fix tests to allow selection of suite 10
The tests only allowed a single character suite selection, which
prevented suite 10 from being run on its own.

Modified test.sh to now require a newline in addition to the input
so that a 2 digit number can be entered.

Also fixed test display to remove illusion that an individual step
could be run.  Only whole suites can be run.

Change-Id: I4dee0ec6a8e1f34fa443a6a0a3f2d52a73146e54
Reviewed-on: https://code.wireshark.org/review/10676
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2015-09-28 20:28:25 +00:00
Jeff Morriss 3ff5afd541 Add a test to verify we pre-allocated enough hf entries.
This way we'll know as soon as we drop below the pre-allocated limit. As
suggested by Graham on https://code.wireshark.org/review/10601

Change-Id: Ieeb14bdcf991d7a67c30787c97ca24ebb35d1763
Reviewed-on: https://code.wireshark.org/review/10627
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-09-23 20:09:39 +00:00
Hadriel Kaplan 6fb6edeaf1 Get the windows buildbot working for mergecap test suite
Change-Id: Ic9351b9bb8df85086eee3ab21908a2f9a04db767
Reviewed-on: https://code.wireshark.org/review/10141
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-08-20 01:39:53 +00:00
Hadriel Kaplan 0bdf518b1e Try to debug merge test suite failure on windows buildbot
This change will be undone once the problem is found.

Change-Id: Ica9cfe31b4e30fad2bb9de508af61baa1c455cc1
Reviewed-on: https://code.wireshark.org/review/10136
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-08-19 20:28:44 +00:00
Hadriel Kaplan dcaa64a050 Mergecap: add test suite for various merging scenarios
Add a test suite for mergecap (and indirectly capinfos I guess).
This is not exhaustive, but it's a start.

Change-Id: I9442b4c32e31a74b1673961ad6ab50821441de3e
Reviewed-on: https://code.wireshark.org/review/10082
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-19 04:27:42 +00:00
Hadriel Kaplan 963b0c919e Lua: add the 1.12.x Lua API to the globals verification test suite
Change-Id: I698fc75dc915ea007b2f7762f0041dbb6dd1d8d3
Reviewed-on: https://code.wireshark.org/review/9764
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-07-24 01:10:34 +00:00
Guy Harris 5b9d61f3b9 Remove the debugging output; it's now attached to the bug.
Change-Id: I6a9252d2841fc44c6fdb6bd27517d60570afbae0
Reviewed-on: https://code.wireshark.org/review/9695
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-17 21:40:24 +00:00
Guy Harris ecd3017b73 In the p < q test, first run tshark -V, to see the full dissection.
Change-Id: I7d82d34369d192e7da7d554f44f448e1613f850f
Reviewed-on: https://code.wireshark.org/review/9694
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-17 20:28:44 +00:00
Guy Harris 354f8e31cb Dump the output of tshark in the p < q decryption test.
See what it prints on Windows.

Change-Id: Id35d87595543eca3e5b5d80dbe9a7639e0a85994
Reviewed-on: https://code.wireshark.org/review/9693
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-17 18:41:10 +00:00
Guy Harris 5a51b8bff8 Don't discard the echo command's output.
Change-Id: I957a0c1beeae4bbd8c32ed05f30525becaf37e95
Reviewed-on: https://code.wireshark.org/review/9682
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-17 07:57:41 +00:00
Guy Harris 520315f890 OK, that didn't do it - print the command again.
Too bad DEC used / as an option character and Bell Labs chose it as a
pathname separator.

Change-Id: Ie58ba79476e0f24e408fae55f6c5eaff3ffb11fa
Reviewed-on: https://code.wireshark.org/review/9680
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-17 07:14:02 +00:00
Guy Harris 57520afe1e Generate key paths as UN*X paths and then run them through cygpath.
In the decryption_step_ssl_rsa_pq - and the
decryption_step_ssl_master_secret test - duplicate the code used to
generate TEST_KEYS_DIR, so that we construct a UN*X-style path and then,
if we're running on Windows, map the UN*X-style path, which is a Cygwin
path, to the equivalent Windows-style path, and pass that to TShark on
the command line.

Bug: 11372
Change-Id: I442a30c4c954540a05942ed70ec3687941428a96
Reviewed-on: https://code.wireshark.org/review/9675
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-17 04:42:25 +00:00
Guy Harris f82df51911 Temporarily log the command that's failing.
Trying to debug the problem.

Change-Id: I26f78e49556cb1d40f0c8ddbfd58f058dceb0e77
Reviewed-on: https://code.wireshark.org/review/9674
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-17 02:40:16 +00:00
Peter Wu 45812a51a3 test: fix RSA decryption test under Windows
TEST_KEYS_DIR already contains a trailing slash. Windows does not like
forward slashes, so drop the additional slash to fix tests under
Windows.

Fixes: v1.99.8rc0-417-g85f8a99
Bug: 11372
Change-Id: Ief794977281b70549369c344a193f4d48bcc1776
Reviewed-on: https://code.wireshark.org/review/9668
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-16 23:36:18 +00:00
Peter Wu 85f8a99f35 ssl-utils: fix failing decryption for some RSA keys
Reported at
https://ask.wireshark.org/questions/43788/struggling-to-decrypt-ssl

"u" requirement is documented at
https://www.gnupg.org/documentation/manuals/gcrypt/RSA-key-parameters.html#RSA-key-parameters

Add regression test (key is generated manually with p and q swapped and
qInv recalculated).

Change-Id: I5505ddcdb54bb47d7a58867b8c3e53fcc0f66dde
Reviewed-on: https://code.wireshark.org/review/9573
Tested-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-07-15 21:31:44 +00:00
Hadriel Kaplan 281055af9c Lua: add functions for more field information
Add Lua functions so a plugin can introspect field information, such
as the type of field, flags, tvb, etc. Also add a couple of Tvb and
ByteArray methods. And cleanup the TreeItem code a little.

Change-Id: I7b58ce589ace91cce14b8abccd01ceabb63e2653
Reviewed-on: https://code.wireshark.org/review/6500
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-07-09 01:49:11 +00:00
Guy Harris be67f53686 Exit with the exit status of the command we ran.
Also, expand a comment.

Change-Id: Icbb8ead02f55087f3ac09747fe518f211d488172
Reviewed-on: https://code.wireshark.org/review/9057
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-23 17:16:12 +00:00
Guy Harris 7cdd22f422 Try to catch TShark crashing and get a stack trace.
It's currently crashing in the Solaris buildbot when we do "tshark -v";
hopefully this will give us something more useful than

  test.sh: line 144: 21543 Abort                   (core dumped) $TSHARK -v

  "Version information" Failed!
  Failed to print version information
  Binary file ./core matches

as a diagnostic.

Change-Id: I278c8dd9f6acf5ddfa83bc0a7f3f7a3c48577ac2
Reviewed-on: https://code.wireshark.org/review/9052
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-23 07:21:49 +00:00
Guy Harris 5472e4d6e9 Debugging printf.
The buildbot printed "expr: syntax error", presumably from this, but
that oh-so-descriptive error message doesn't indicate what the problem
is, and just about any string should be valid as the left-hand operand
of the : operator.

Change-Id: I1140522357b8df07e4183bf0eb8c5fa9fbe275e4
Reviewed-on: https://code.wireshark.org/review/8827
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-08 01:10:28 +00:00
Pascal Quantin 8da4d22631 Fix decryption test suite on Windows
Change-Id: Ib8207d56a7e064855ce1444c927913c9c9258788
Reviewed-on: https://code.wireshark.org/review/8766
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-04 21:34:07 +00:00
Kevin Grigorenko 5f9a52dc95 SSL: Add support for private key password when decrypting
SSL traffic from tshark with -o ssl.keys_list.


For example, as used in a new test also added in this commit:

-o "ssl.keys_list: 127.0.0.1,9131,http,$TEST_KEYS_DIR/key.p12,WebAS"

Change-Id: Ia6960fa4ae88182277f6d22d84ec9170ea74d54e
Reviewed-on: https://code.wireshark.org/review/8746
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-06-04 15:49:45 +00:00
Guy Harris f1c375d006 Try to handle the executable being a libtool wrapper.
Change-Id: I8fd2b4445707029ea24ad3c02804c0bf8fcedd15
Reviewed-on: https://code.wireshark.org/review/8406
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-11 20:29:34 +00:00
Guy Harris f4c2d3b740 Remove trailing whitespace.
Change-Id: Ibdb899ddcaa88579aa2dc3c842d016a1ac164e2a
Reviewed-on: https://code.wireshark.org/review/8404
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-11 19:24:13 +00:00
Guy Harris 5a9d065f1b Skip past env and its environment-variable arguments.
Change-Id: Ic0bec27e5884a1e5db8e98e6d84b677ae8b2d377
Reviewed-on: https://code.wireshark.org/review/8403
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-11 19:23:05 +00:00
Guy Harris c9ec0be83f Try to get a stack trace from core dumps.
Change-Id: I66d853391f29acfb026d3c246adba9bdf6a4dc36
Reviewed-on: https://code.wireshark.org/review/8400
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-11 17:19:22 +00:00
Guy Harris 0617b1a0aa When piping tshark to something else, run it with run_and_catch_crashes.
That got the crash information in the WPA EAPOL Rekey test; use it for
all other tests where, otherwise, the crash information would be lost.

Change-Id: I230b7952b6d79ebf6dc003747dc05328616ef7c2
Reviewed-on: https://code.wireshark.org/review/8394
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-11 00:00:46 +00:00
Guy Harris c8394b8b6f Fix pathname used to run run_and_catch_crashes.
Change-Id: Ib8bbee1906c89decd16f3ea0ea5f78c9337e5f43
Reviewed-on: https://code.wireshark.org/review/8393
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-10 21:45:19 +00:00
Guy Harris 42611db19a Try wrapping some tshark invocations in a script to catch crashes.
Add a script that takes a command as an argument and runs it in a
subshell, so that said subshell will catch any signals from it and
report it.

This would be done for commands that aren't the last command in the
pipeline, as, given that the exit status of a pipeline is the exit
status of the last command in the pipeline, there's no guarantee that
the shell will bother to pick up the exit status of earlier commands in
the pipeline.

Use that for the tshark in the WPA EAPOL Rekey test, so it at least can
report the signal (on Solaris, SIGSEGV means, among other things,
"dereferenced a pointer pointing out of the address space" and SIGBUS
means, among other things, "dereferenced a misaligned pointer on
SPARC").  Maybe we can make the script also fire up a debugger if it
finds a core dump (and a debugger) and get a stack trace.

Change-Id: I4188190a1f1a4d3afc4719d886161ee56bd89d8b
Reviewed-on: https://code.wireshark.org/review/8392
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-10 21:18:53 +00:00
deagol 1439eb6778 IEEE 802.11: 802.1X (WPA-EAP) rekeying support
This patch extends the existing decryption support for WPA to also
handle rekeys by checking each decrypted packet for a 4-way-handshake.

Rekeys can be used for WPA-PSK, but are more common with WPA-Enterprise
(WPA-EAP).

For decrypting WPA-EAP secured packets the user must provide all used PMK's
of the connection (aka PSK's) as WPA-PSK 32 byte hex values to wireshark
via the existing interface.
(The capture must have all 4-way-handshakes included also, starting with
the first unencrypted one.)

Every decrypted unicast packet will habe the used PMK and TK shown in the
CCMP/TKIP section below the key index in the GUI. Group packets will display the
GTK instead.

Additionally this fixes a small issue with group rekey handling, so every packet
can be selected in the GUI in random order, removing the need to manually find
the correct group keying packets prior to that.

It was tested primary with WPA-CCMP, but TKIP is also working.

One section in the code touch bluetooth 802.1X support. It should do
exactly the same, but will now also examine all decypted packets for rekeys.

Ping-Bug: 11172
Change-Id: I19d055581fce6268df888da63485a48326046748
Reviewed-on: https://code.wireshark.org/review/8268
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-08 04:27:49 +00:00
Gerald Combs 9670f05384 Add ftsanity.py to the unit tests.
Change-Id: Ib480d8be5f66c70a4213af27acee94016fbf974b
Reviewed-on: https://code.wireshark.org/review/7855
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-30 21:02:21 +00:00
Gerald Combs f074647d2b Add a test-programs target everywhere.
Add a "test-programs" target to each toolchain which builds each unit
test executable. "test-programs" must now be built before running
the unit test suite.

Change-Id: I9317a1e305d987f244c4bd8b4a7f05d11fed7090
Reviewed-on: https://code.wireshark.org/review/7673
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-13 22:41:40 +00:00
Gerald Combs b255d8a1a1 CMake: Update wslua build and test.
Process wslua/CMakeLists.txt using add_subdirectory instead of
include. Generate files in the build directory instead of the source
directory.

Copy lua scripts to DATAFILE_DIR instead of DATAFILE_DIR/lua. That's
where init.lua looks for console.lua.

Always set WIRESHARK_RUN_FROM_BUILD_DIRECTORY when testing. We
presumably want to test our source files and not files which may or
may not be in the system path.

When we're running from the build directory look for lua scripts in both
the Autotools and CMake build locations.

Change-Id: Ic15ab8c58ff1b170d000c9b3e0a329af2ec44b7b
Reviewed-on: https://code.wireshark.org/review/7590
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-12 16:37:51 +00:00
Gerald Combs 95ce3928de Fix the Lua FPM dissector test.
In the FPM dissector test, only check the fields produced by the
frame and FPM dissectors.

Change-Id: I212afb8a8a4a7a9aa54391b0d5971b982b819395
Reviewed-on: https://code.wireshark.org/review/7643
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Graham Bloice <graham.bloice@trihedral.com>
2015-03-12 10:44:14 +00:00
Gerald Combs cac102eee3 Change a lot of http:// URLs to https://.
Most of our sites are now HTTPS-only. Update URLs accordingly. Update
other URLs while we're at it. Remove or comment out dead links.

Change-Id: I7c4f323e6585d22760bb90bf28fc0faa6b893a33
Reviewed-on: https://code.wireshark.org/review/7621
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-03-10 19:30:50 +00:00
Guy Harris 56446270f9 "Break" the Acme reader so that the tests work.
We don't want to have to change the pcap-ng file against which we
compare, so we hardcode the year here to be the same as the year from
the pcap-ng capture.

Change-Id: Ibd83d06e035341f617b8285f6ba51c749c38a177
Reviewed-on: https://code.wireshark.org/review/7448
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-01 07:13:02 +00:00
Hadriel Kaplan ceb8d954d2 Lua: Expose tcp_dissect_pdus() to Lua
Provide a way for Lua-based dissectors to invoke tcp_dissect_pdus()
to make TCP-based dissection easier.

Bug: 9851
Change-Id: I91630ebf1f1fc1964118b6750cc34238e18a8ad3
Reviewed-on: https://code.wireshark.org/review/6778
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-01-27 15:14:12 +00:00
Gerald Combs b32e39e198 Test suite: Add verbosity to the HTTP2 test.
We should probably do the same for the other decryption tests but we're
having issues with HTTP2 right now.

Change-Id: I8e8f5da200a29a5ca1cddb39c082bb7ee12d1eaf
Reviewed-on: https://code.wireshark.org/review/6686
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-23 13:14:10 +00:00
Guy Harris 612e286b9e Fix test script to test Lua Pinfo, and fix problem it found.
The test script was running lua/nstime.lua rather than lua/pinfo.lua for
the Pinfo test, and the Pinfo test was testing the ipproto property for
a Pinfo, but that was removed.

Change-Id: Iccdccd265dd550e41640af3acd607362f1f2f02e
Reviewed-on: https://code.wireshark.org/review/6747
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-23 01:52:24 +00:00
Alexis La Goutte af3924a333 HTTP2: Add HPACK decode to test suite
Change-Id: Ic84942b78a795974d6e2023751245ad98b8f1142
Reviewed-on: https://code.wireshark.org/review/6415
Reviewed-by: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-20 07:31:23 +00:00
Graham Bloice d7bce33140 Fix Cygwin path
Fix the Cygwin path added for tests so that Cygwin comes after the
existing path and that the correct link command is found for exntest.

Same change to runa2x.sh to be consistent.

Change-Id: I177a5e7d17a0077b0e8ca7d264d7e725a5312e24
Reviewed-on: https://code.wireshark.org/review/6503
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Graham Bloice <graham.bloice@trihedral.com>
2015-01-12 12:40:04 +00:00
Graham Bloice a49e1d54d9 Make running the tests a little easier on Windows
1.  Set the igncr option a little differently, this is the preferred
    way according to the latest Cygwin bash update announcement
    (See https://sourceware.org/ml/cygwin-announce/2014-10/msg00015.html, Sect 4a)
    The previous way didn't work for me.
2.  Ensure /usr/bin is on the path if running under Cygwin.
    I really don't want Cygwin on my normal paths, the build process
    adds if required, so this change makes the test scripts do the same.

Change-Id: I0f4da1fa87802bf0a4039bb5a91e577fae506d79
Reviewed-on: https://code.wireshark.org/review/6243
Tested-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2015-01-12 10:22:40 +00:00
Graham Bloice e7d0cdc061 Fix lua tests on Windows
Convert TEST_DIR path to a Windows path, this is used in all the lua tests.
Fix a typo

Change-Id: I38808822c998ed1df007732b3701b6b13d6c886b
Reviewed-on: https://code.wireshark.org/review/6235
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-01-02 16:49:40 +00:00
Evan Huus 887d198361 test: improve check for out-of-tree tests
Rather than running `cd` and letting it potentially fail, just use the `-d` flag
to test that `run` exists and is a directory. Avoids useless stderr output.

Change-Id: Iab8b63681db6256aa1a6fc389d2536acbd491aba
Reviewed-on: https://code.wireshark.org/review/6239
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-01-02 16:12:45 +00:00
Evan Huus 5cb96a0eb5 test: default WS_QT_BIN_PATH to WS_BIN_PATH
it used to be SOURCE_DIR, which is still the fallback for WS_BIN_PATH, but this
way if you specify a custom WS_BIN_PATH it gets picked up for both

Change-Id: If9198565fc7b7b3911550fd200adb0f918622540
Reviewed-on: https://code.wireshark.org/review/6238
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-01-02 16:08:20 +00:00
Joerg Mayer 27fa202b5e Make it easier to run tests out of tree.
Change-Id: I4ed10339d3c543d9d199e5262b6e7bb8247544ac
Reviewed-on: https://code.wireshark.org/review/5148
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-02 15:00:03 +00:00
Hadriel Kaplan 3cc6aee32a Lua: regex test suite fails with UTF-8 locale
Due to the change in change-id Ib43e16a9d98d08e5ddaff81fd3235f5b64d7b95b, the setlocale() call has been moved earlier in tshark's processing, such that Lua plugins load with the environment locale instead of C-locale. Since that matches Wireshark's behavior, it's good, but it causes the Lua regex test suite to fail. So the test suite needs to be fixed.

Bug: 10824
Change-Id: I3dcad15a9e247a1e42d2f708ccfb7272de2fe960
Reviewed-on: https://code.wireshark.org/review/6226
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2015-01-02 13:09:16 +00:00
Gerald Combs f485b28090 Test suite: Make sure we have a usable locale before we run iconv.
Change-Id: Ib1f3143dc48af4c556b9bcdfafbb477fd59b6359
Reviewed-on: https://code.wireshark.org/review/6181
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-31 17:13:06 +00:00
Hadriel Kaplan f7b6dcc58c Lua: allow a Dissector object to be passed in for register_heuristic
Bug: 10695
Change-Id: I81181b2d00fcb5f0c25ab89bbe4968897f47a3a6
Reviewed-on: https://code.wireshark.org/review/6131
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-31 16:01:51 +00:00
Gerald Combs dcbebe0eac Test suite: Start testing our output for valid UTF-8.
Feed the output of `tshark -G <glossary>` to `iconv -f UTF-8`. Adjust a
couple of the Bluetooth dissectors and X11 keysyms accordingly.

Change-Id: I5b04dc3fa4734c8f0a795daf44bd398fe5ebc1bd
Reviewed-on: https://code.wireshark.org/review/6146
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-30 21:20:28 +00:00
Hadriel Kaplan 2391a436e6 Bug 10233 - Wireshark crashes if Lua heuristic dissector returns true
Because call_heur_dissector_direct() didn't set the pinfo->heur_list_name
before calling the heuristic dissector, heur_dissect_lua() would invoke
report_failure().  Unfortunately, calling report_failure() within a dissector
can cause problems because GTK continues invoking timed callbacks while
it displays the modal dialog created by report_failure()... without yet
returning from report_failure().  In such a case, it's possible for
epan_dissect_run() to be called while still within the execution of a
previous call to epan_dissect_run(), which casues an assert since
epan_dissect_run() is not reentrant.

So this commit both fixes the call_heur_dissector_direct() bug as well
as avoids using report_failure() within heur_dissect_lua().  It also
upadtes the dissector.lua script used in the testsuite to match the one
pubshied on the wiki, since that script's heuristic dissector triggered
the bug.

Bug: 10233
Change-Id: If022604347745fadac01c02d370ca1a5d3f88b5b
Reviewed-on: https://code.wireshark.org/review/6040
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2014-12-25 15:13:56 +00:00
Alexis La Goutte 04a1f332b1 test suite: (Minor) fix some double space
Change-Id: I7fe7cd7ed471b8fcd2afd5fb4bbc180b580295b3
Reviewed-on: https://code.wireshark.org/review/6031
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-24 17:39:49 +00:00
Alexis La Goutte cd558218f7 test suite: fix indent (use tabs) and add modelines
Change-Id: I648d02d41f92c7fd176ce194eee20a2d19643fe0
Reviewed-on: https://code.wireshark.org/review/5985
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-23 07:27:48 +00:00
Michael Mann 6d207fe5f4 Remove private_data member from packet_info structure.
Dissectors should pass data directly to their subdissectors through the data parameter (of new-style dissectors). This avoids unintentional "trampling" from other dissectors trying to "share" private_data member.

Change-Id: I2efef5c8dfeef64588ba3ac6e695b469238c6468
Reviewed-on: https://code.wireshark.org/review/5487
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-01 14:05:44 +00:00
Gerald Combs c55d69780b Try to speed up ping-dependent capture tests.
Ping four times a second for ~60 seconds. Save the subprocess PID so that
we can kill it when we're done with each test instead of waiting for it
to finish.

Change-Id: I64f889c700e8a6fa1bc1c3916ef045341ef59cc6
Reviewed-on: https://code.wireshark.org/review/4557
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-08 18:54:13 +00:00
Gerald Combs bdfff4d3c7 Re-enable the Wireshark test suite.
Change-Id: Icfd9edb8c6ef7620878bc9d60c8dcc569ad2abad
Reviewed-on: https://code.wireshark.org/review/4434
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-03 00:02:56 +00:00
Gerald Combs ff7b51f920 Partially re-enable Wireshark tests.
Qt requires Xrender and XKEYBOARD. Unfortunately the Ubuntu and Solaris
buildbots run the test script under Xtightvnc, which provides neither of
those. Only enable the tests on Windows and OS X for now.

Change-Id: I84bc28f810782b862b4dca8fc8df088a4919066d
Reviewed-on: https://code.wireshark.org/review/4430
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-02 22:49:46 +00:00
Gerald Combs 67f1fa5e56 Temporarily disable the Qt tests added in g58cde5c.
Apparently what works for me doesn't work for the Buildbot users.

Change-Id: I7d3e4f2b89ae8ae3dadc8d92438c0e1923b97ace
Reviewed-on: https://code.wireshark.org/review/4416
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-02 02:20:07 +00:00
Gerald Combs 58cde5c74a Add tests for the Qt UI.
Make sure the Qt UI quits if WIRESHARK_QUIT_AFTER_CAPTURE is set. Make
sure Bourne shell scripts (*.sh) have UNIX/POSIX line endings. Reduce
some time values so that the tests run faster.

Change-Id: I81df7c6f72d7d807d1856863cbea1bb6326ca711
Reviewed-on: https://code.wireshark.org/review/4407
Tested-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-01 22:30:33 +00:00
Evan Huus 45fb37718e Fix lua bindings to handle timestamp precision changes
The recent wiretap changes broke the generation of init.lua among other things,
though it did coincidentally fix one of the "yuck" comments in the generator
regex.

(Note that this is entirely untested, because out-of-tree init.lua is and always
has been broken, but it should work)

Change-Id: Id0c27b31c596613997de4ba2f6088eb9d6c8fc53
Reviewed-on: https://code.wireshark.org/review/4361
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-09-29 02:35:29 +00:00
Alex Badea a1604bd5d6 test: add decryption test for isakmp with certificates
This was suggested in review 2297. Capture and key are from bug 7951.

Bug: 7951
Change-Id: I820c5e839b20ec464cc1be438633d5311f657fb2
Signed-off-by: Alex Badea <abadea@ixiacom.com>
Reviewed-on: https://code.wireshark.org/review/4143
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-09-24 22:06:31 +00:00
Gerald Combs b7fb1167e3 Qt → wireshark. GTK+ → wireshark-gtk.
Make sure the Qt UI is named "Wireshark" and its executable is named
"wireshark" or "wireshark.exe". Make sure the GTK+ UI is named
"Wireshark 1" or "Wireshark (GTK+)" depending on how much the target
audience is likely to care about UI toolkits. Make sure the GTK+
executable is named "wireshark-gtk" or "wireshark-gtk.exe".

It looks like moving to Qt 5.3 (g978faf3) broke the PortableApps
package. It's likely even more broken now.

Autotools out-of-tree builds also broke on Ubuntu 12.02 (automake
1.11.3) at some point. The first attempt to compile in ui/qt returns
"error: source_file.cpp: No such file or directory". The second attempt
works. Out-of-tree builds work fine on Ubuntu 14.04 (automake 1.14.1).

Tested:

- Nmake builds

- NSIS packaging

- CMake builds (Windows, OS X)

- Autotools build and distcheck

- RPM packaging

To do:

- Test Debian packaging

- Fix PortableApps

Change-Id: I66429870e05fd2d6fc901942477959ed6164fce2
Reviewed-on: https://code.wireshark.org/review/3919
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-02 15:39:17 +00:00
Evan Huus 5fda232659 make unit-test suite work out-of-tree
Change-Id: I638015a9b55712bb6843d6756c9c55915e142372
Reviewed-on: https://code.wireshark.org/review/2893
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-12 12:08:13 +00:00
Evan Huus a87e292272 Tighten the dump-glossary test.
1. The only indication we get of an out-of-order value string is a message on
 STDERR, so check that and fail the test if STDERR wasn't empty.

 2. This exposes an out-of-order value string in packet-stun.c; fix it.

 3. This triggered the pre-commit hook on packet-stun.c, which noticed an API
 error (ENC_ASCII -> ENC_ASCII|ENC_NA); fix that too.

Change-Id: I36f87a2a87b40537119562f22a7e3012716ff239
Lesson: automated testing/tooling is both wonderful and scary.
Reviewed-on: https://code.wireshark.org/review/2682
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-27 03:47:32 +00:00
Gerald Combs 81963e7f1a Decrease TRAFFIC_CAPTURE_DURATION from 60s to 15s.
Change-Id: Ie6d6ac0489f0fcb506360a3900d33c44cb3477e9
Reviewed-on: https://code.wireshark.org/review/2664
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-06-25 23:02:55 +00:00
Evan Huus fca7b3f4f8 Check for lua by grepping the output of tshark -v
Grepping config.h doesn't work for out-of-tree builds.

Change-Id: If3f551dffb04dd646f5adece57fac90dc48ff1c9
Reviewed-on: https://code.wireshark.org/review/2389
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-18 18:32:18 +00:00
Guy Harris 6db77b000f Allow wtap_read() and wtap_seek_read() to return records other than packets.
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be
REC_TYPE_PACKET, for a record containing a packet, or
REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific
data.

Modify code that reads packets to be able to handle non-packet records,
even if that just means ignoring them.

Rename some routines to indicate that they handle more than just
packets.

We don't yet have any libwiretap code that supplies records other than
REC_TYPE_PACKET or that supporting writing records other than
REC_TYPE_PACKET, or any code to support plugins for handling
REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug
8590.

Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813
Reviewed-on: https://code.wireshark.org/review/1773
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24 18:31:25 +00:00
Evan Huus a1e6b10239 Fix lua directory tests.
The underlying directory iterator is not guaranteed to return directories in the
same order according to the glib documentation, so don't rely on the directory
order being the same when testing it.
https://developer.gnome.org/glib/2.37/glib-File-Utilities.html#g-dir-read-name

Bug:10009
Change-Id: I4b1078e1f3981921b1e83c4f77b4bc30a5d21b46
Reviewed-on: https://code.wireshark.org/review/1671
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-21 03:17:15 +00:00
Evan Huus 4272cb8786 Revert part of g757db64e484b009c3
It was intended to change the DTLS decryption test, but changed the SSL test
file instead, which led to the SSL test mysteriously failing. The SSL capture
really is http, so that's the right protocol, and the port is the standard 443,
not 4433 (which was perhaps a typo?).

Change-Id: I84448c2326d2a4301a4bba9607f8ba90a495531d
Reviewed-on: https://code.wireshark.org/review/1401
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-27 21:55:03 +00:00
Evan Huus c6d41f961b Have DTLS just dissect the test capture as data
Follow-up to g757db64e484b009c33b67b5fa38e109d7b8f5e78 which changed the filter
being tested but didn't change the target protocol, so the test was still
failing because it was still trying to use HTTP.

Change-Id: I6675cfad3bba63f7a536eb7ae82e4b25132d108e
Reviewed-on: https://code.wireshark.org/review/1375
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-26 21:45:48 +00:00
Michael Mann 757db64e48 Don't use HTTP filter for DTLS decryption test as it's not really HTTP traffic (and a more discerning HTTP dissector will cause this to fail)
Change-Id: I74ea78f541f87000d84c85794d04e9de46d477f2
Reviewed-on: https://code.wireshark.org/review/1333
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-25 04:20:27 +00:00
Hadriel Kaplan f52626cc83 Add tvb_get and proto_tree_add for string-encoded byte arrays
This commit adds tvb_get_string_bytes and proto_tree_add_bytes_item routines for
getting GByteArrays fields from the tvb when they are encoded in ASCII hex string form.

The proto_tree_add_bytes_item routine is also usable for normal
binary encoded byte arrays, and has the advantage of retrieving
the array values even if there's no proto tree.

It also exposes the routines to Lua, both so that a Lua script can take
advantage of this, but also so I can write a testsuite to test the functions.

Change-Id: I112a038653df6482a5d0ebe7c95708f207319e20
Reviewed-on: https://code.wireshark.org/review/1158
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-17 14:04:19 +00:00
Hadriel Kaplan dd002649c3 Add tvb_get and proto_tree_add for string-encoded timestamps
This commit adds tvb_get_string_time and proto_tree_add_time_item routines for
getting nstime fields from the tvb when they are encoded in ASCII string form.

The proto_tree_add_time_item routine is also usable for normal
big/little-endian encoded time_t, and has the advantage of retrieving
the value even if there's no proto tree.

It also exposes the routines to Lua, both so that a Lua script can take
advantage of this, but also so I can write a testsuite to test the functions.

Change-Id: I955da10f68f2680e3da3a5be5ad8fdce7ed6808c
Reviewed-on: https://code.wireshark.org/review/1084
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-14 11:47:39 +00:00
Pascal Quantin cc3c05ed5f Switch to Lua 5.2.3 built with MSVC2010 instead of the one built with MingW gcc 4.3
Fixes bug 9957

Change-Id: Ibe38ec25be5cfdad98c53c8257b0a858529897f6
Reviewed-on: https://code.wireshark.org/review/991
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-07 05:54:19 +00:00
Hadriel Kaplan 85aa07157a Get it compiling again: WindowsXP build failing
The WindowsXP build is failing due to a wslua testsuite failure, in the
file reader/writer tests. I've looked at it a bit and I don't know
why it's failing yet - I know why it says it's failing, but it doesn't
fail for me. And it was passing on WindowsXP until the change to Lua 5.2.3,
but I run 5.2.3 all the time and it passes for me, and there's nothing
special about the portion that's failing.

The only way to debug it is to run it on WindowsXP myself, but I need
a build to do that with, so I've commented out the failing test and
hopefull it will build now and I can grab the automated build to debug
the issue.

Change-Id: Ib75e8f75829e8f506823e648605ba16e21c7973a
Reviewed-on: https://code.wireshark.org/review/982
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-06 17:51:34 +00:00