Commit Graph

52678 Commits

Author SHA1 Message Date
Daniel Stenberg c35870b0af packet-http2: updated to http2 draft-12
From Alexis La Goutte
Fix warning found by pre-commit

Partial-Bug: 10054
Change-Id: I976884a240a55bb2287a802d72668a2c845179c0
Reviewed-on: https://code.wireshark.org/review/1295
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-27 20:23:27 +00:00
Alexis La Goutte b57fc91c68 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I75aa99b020c92e7caf7efebe34cd1af3763cf592
Reviewed-on: https://code.wireshark.org/review/1397
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-27 20:23:01 +00:00
Alexis La Goutte 298633ec33 Add Modelines info
Change-Id: Ib6e1c68e47f2c66d444ac26d1d48f5ef3e14b949
Reviewed-on: https://code.wireshark.org/review/1396
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-27 19:55:40 +00:00
Alexis La Goutte ea729ed5b7 Add Modelines info
Change-Id: I8ce92fcd103a18fad2ea4c0b873914af38d48155
Reviewed-on: https://code.wireshark.org/review/1395
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-27 19:55:11 +00:00
Alexis La Goutte 574a3ef42b Add Modelines info
Change-Id: I978198266523a0b1f0ba9d4ed6848664a6fa3637
Reviewed-on: https://code.wireshark.org/review/1394
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-27 19:55:01 +00:00
Alexis La Goutte e0b15f5e17 Fix warning found by -Wunused-const-variable (Clang 3.5)
packet-gvcp.c:493:27: error: unused variable 'linkconfiguration_class' [-Werror,-Wunused-const-variable]

Change-Id: Id31ced029af9700f47230df4afa5c0a4aaecf6d3
Reviewed-on: https://code.wireshark.org/review/1392
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-27 19:42:56 +00:00
Jakub Zawadzki af2eebef2a Reorder fields in http_conv_t to save some memory.
On amd64 before patch: sizeof(http_conv_t) == 88, after: 72 bytes.

Change-Id: I2863f1c7223a904dadfbe68dc41bc61fc2cc378a
Reviewed-on: https://code.wireshark.org/review/1388
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-27 19:30:51 +00:00
Alexis La Goutte dec179eab8 Try to fix Mac OS X buildbot
packet-http.c:2629: warning: implicit conversion shortens 64-bit value into a 32-bit value

Change-Id: I6a423639a53c24431fcfd79e0a235f2885ea86c2
Reviewed-on: https://code.wireshark.org/review/1389
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-27 19:30:10 +00:00
Peter Wu 878f341ffa prefs: fix ASAN error due to invalid indirection
For pref_current, indirection of pref->varp.string will cause a read of
size 8. This will cause a global buffer overflow error for all smaller
types, for example lbmc_use_heuristic_subdissectors (size 4).

Reproduce: compile Wireshark with -fsanitize=address, open Preferences
and select OK or Apply. Result: ASAN crash.

To fix this, only indirect a pointer if the storage size is known, a
void pointer stores the address of the constant value (pref_default,
pref_stashed) or the address to the value (pref_current). Note that
pointers of different types are of equal size, I could take
valp.pref_(anything).

While at it, remove superfluous 'break' keywords where a 'return'
keyword is present.

Change-Id: I05a69e8f14a1ecb4e5d2a0c0f0b71ed3f0a41d70
Reviewed-on: https://code.wireshark.org/review/1286
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-27 18:56:03 +00:00
Peter Wu 5600ae100a http: Fix src/dest mapping for proxied connections
Using value_is_in_range is making quite some assumptions, namely (1) the
proxy server is always run on a registered HTTP port, and (2) the
source (client) port is always not HTTP. The former is quite a strong
assertion which fails to hold when using a custom port (8008) that got
detected through heuristics.

Fix this by recording the source address and port pair for the server
and then check this against the current packet.

This fixes detection of a SSL conversation where two conversations got
detected instead of one. Example: 8008 is proxy, 443 is target server.
Now the proxied conversation got detected as 443 --> "client port"
(server to client, ok) and 443 --> 8008 (client to server, not ok,
should be "client port" --> 443).

bug:7717
Change-Id: I05113ec2aca6c9296184759a8a62eb32cbfcbb4f
Reviewed-on: https://code.wireshark.org/review/1380
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-27 18:08:44 +00:00
Hauke Mehrtens 338269fe41 ssl/dtls: add keyfile support to dtls
This moves the keyfile and psk options from the ssl code into ssl-utils
and then uses them also for dtls.

This is the last missing part for bug 9499 from my side.

Change-Id: Ie2fe5bc565eabe1e6ce62498c985b8a36e913b0f
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-on: https://code.wireshark.org/review/1369
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-27 18:00:21 +00:00
Peter Wu 162a8c72f0 http: Display a list of cookies
For long cookies, the label "[truncated] Cookie: foo=v..." is not really
helpful. Add a new subtree to display individual cookies, this makes
copying values much easier.

A new "http.cookie_pair" field was added instead of re-using
"http.cookie". This has the advantage that `tshark -Tfields -e
http.cookie` does not end up with duplicates. At the same time, one can
match against individual cookie values.

I also considered to limit the number of cookies to be split, but as
there is no limit on the number of headers, I decided not to be
restrictive for cookies either.

Change-Id: I98d9522867811278ade3e04aab02e517f997928b
Reviewed-on: https://code.wireshark.org/review/1186
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-27 17:53:38 +00:00
Gerald Combs 7b401202d5 [Automatic manuf, services and enterprise-numbers update for 2014-04-27]
Change-Id: I0745df4a0a0447abf7ab4c7555d9d195ac40eb78
Reviewed-on: https://code.wireshark.org/review/1384
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-04-27 15:05:29 +00:00
Stefan Doehla ff854bc650 SAP: fix dissection of Originating Source address
Regression introduced in commit c131f9a074

Bug: 10029
Change-Id: Ia99ca36216dd26e41f926cc67e52827e665c40eb
Reviewed-on: https://code.wireshark.org/review/1383
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-27 12:39:37 +00:00
Michael Mann f8e8c85f99 Limit the start of HTTP request/response to a printable character.
From Martin Mathieson.

In a profiled run with FTP traffic, the HTTP dissector looking for the end of a line of data (which was binary) was taking around 3% of runtime.

bug:8822
Change-Id: I2617d1e49030bd5ad85b0e818c48c01dc6fae075
Reviewed-on: https://code.wireshark.org/review/1373
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-27 12:26:49 +00:00
Pascal Quantin b588511c9c T38: fix access to uninitialised variables
Bug: 10050
Change-Id: I7bc2d1b99bcb1241705a2561d9360a006fb9cb47
Reviewed-on: https://code.wireshark.org/review/1382
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-27 12:15:21 +00:00
Pascal Quantin 7929d9acf9 SSL: fix compilation without GnuTLS and Gcrypt
Change-Id: Ic783f9ac2b7abcbace67ce48239b0506ac237267
Reviewed-on: https://code.wireshark.org/review/1381
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-27 10:36:36 +00:00
Martin Mathieson 616d4c9c1b Change preferences - always want to try to decrypt signalling PDUs
Change-Id: Ib34f12b5f8dd276612aed2fe0192c94e847858f2
Reviewed-on: https://code.wireshark.org/review/1377
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-04-26 22:33:32 +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
Guy Harris 1ba06e65b0 Fix FSF address.
Change-Id: Ic79fcf7e1bebb9821d9d9db43c2a4f4291beb706
Reviewed-on: https://code.wireshark.org/review/1374
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-26 17:50:08 +00:00
Hauke Mehrtens 3b76de7dc2 dtls: run dissector for decryption also on server hello extensions
The dissector only ran through the server hello extensions for the tree
and not in the ssl decryption pass. This resulted in
ssl_dissect_hnd_hello_ext() being always called with ssl == NULL. For
SSL this was also called with ssl != NULL.

Change-Id: I22f7b1089731124b3ca1a2b8515f307c4a021b7f
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-on: https://code.wireshark.org/review/1370
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-26 15:47:47 +00:00
Peter Wu 720f504dd6 ssl: support any address/port combi for priv key
Both "any port" and "any address" are supported separatedly, but not the
combination of both. This also has the effect that the combination of
any address with the special keyword "start_tls" did not work.

Fix this by checking for a private key with the combination of any
address and port.

Change-Id: Icb49d6728f032a05007dcb7ac73ec0528778441a
Reviewed-on: https://code.wireshark.org/review/1368
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-26 15:36:17 +00:00
Peter Wu 4250dfd3f5 ssl: return early if no private keys are found
There is no need to check for private keys if there are none. In
addition, print the number of keys for debugging purposes.

Change-Id: Idc9d650e0bf087c0f647dba4e5bd4920b4f6e228
Reviewed-on: https://code.wireshark.org/review/1367
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-26 15:35:43 +00:00
Peter Wu 7805e5a495 ssl: Reduce chance of hash-collisions SSL private keys
The wildcard address contains all zeroes, resulting in the same hash
for 0.0.0.0 and ::. Not really problematic, but it does not sound
great either.

Change-Id: I099128973a1bd8bb5c88d0abcab3ea4ecc3a96c9
Reviewed-on: https://code.wireshark.org/review/1366
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-26 15:34:46 +00:00
Peter Wu c7cbdb4f22 Change ssl_find_private_key to void
No caller checks its return value (which is always 0).

Change-Id: I18461ee6e5d369722c8c2b2ea1e409423aa5d631
Reviewed-on: https://code.wireshark.org/review/1365
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-26 15:34:38 +00:00
Lasse Luttermann Poulsen 03cb700571 Added fields used by HP MSM access points.
Change-Id: I367c99bb351993f05161d683eb54f08e5852145f
Reviewed-on: https://code.wireshark.org/review/1347
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-26 02:46:59 +00:00
Lorand Jakab 742acca3f8 Dissect all details in NAT-T LCAF type...
... and remove last remaining proto_tree_add_text() calls!

Change-Id: I22e5446a06c22ba1f30f342b21f7676641a7f2e7
Signed-off-by: Lorand Jakab <ljakab@ac.upc.edu>
Reviewed-on: https://code.wireshark.org/review/1352
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-26 02:00:43 +00:00
warren babe895d3a Updated gvcp dissector
Change-Id: I49f6acecdbcdf171ba28af171f8067322cc5ecf1
Reviewed-on: https://code.wireshark.org/review/1220
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-26 01:53:38 +00:00
Guy Harris 662e4bd556 wtap_read() and wtap_seek_read() handle caplen > len; don't do it here.
Change-Id: Iac083abdbaaa4666124e5b296e6f8306ee90f32d
Reviewed-on: https://code.wireshark.org/review/1363
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 21:31:24 +00:00
Guy Harris 4f8c8c215d This doesn't have separate captured and actual length, either.
Change-Id: I4605bde8a2951ea78d507bab6fcf004ebef6f38f
Reviewed-on: https://code.wireshark.org/review/1362
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 21:26:18 +00:00
Guy Harris 6335782ccd Put the common code for reading Logcat packets into a routine.
Then have the read and seek-read routines both use that routine.

Change-Id: I3d11df82644207d0ae59486231c91e1f044090ab
Reviewed-on: https://code.wireshark.org/review/1361
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 21:17:01 +00:00
Guy Harris 6ef0420434 No need to set "line" when setting "firstline".
"line" is used only in the main loop processing the lines.

Change-Id: I370c6516867a9c972f9673b3362141f0f42d178a
Reviewed-on: https://code.wireshark.org/review/1360
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 20:13:14 +00:00
Guy Harris 0b1c5c3f12 Get rid of a (now-)redundant call to tvb_get_ptr().
Also, shuffle some comments around to make them better describe what's
happening.

Change-Id: Ie4d71e7c64b68a7f02b4ec6cd2d8601a796a9867
Reviewed-on: https://code.wireshark.org/review/1359
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 20:08:38 +00:00
Guy Harris ae666f6001 Clean up code formatting a bit.
Change-Id: I8f82630f59304149293680f742d490767b88179e
Reviewed-on: https://code.wireshark.org/review/1358
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 20:04:11 +00:00
Martin Kaiser f5165ba0f0 remove some more unnecessary initial values
Change-Id: If2abfee444c7a4a163fef031d92b7757b5d23855
Reviewed-on: https://code.wireshark.org/review/1355
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-04-25 17:53:53 +00:00
Martin Kaiser e417e8bc20 remove unnecessary initial values
Change-Id: I0950daa18c4234677d29101fac74f6f6bd977ef3
Reviewed-on: https://code.wireshark.org/review/1354
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-04-25 17:53:36 +00:00
Guy Harris 6d6094e349 Don't fail if a pcap-NG PB or EPB has caplen > actual len.
We don't fail for other file types; there's no point in failing for
pcap-NG.  wtap_read() will ensure that caplen <= len.

Make wtap_seek_read() ensure that caplen <= len as well.

Fixes bug 10037.

Change-Id: I41fbcf54341ea0429cef875442ea1f1377177a5f
Reviewed-on: https://code.wireshark.org/review/1353
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 17:44:47 +00:00
Peter Wu 83fe3572c5 Fix reading keyfile for "any" IP address
The same file pointer is used for both IPv4 and IPv6.

Change-Id: I448ee10426882dcd5bcddf6b005ca1d07fe9572c
Reviewed-on: https://code.wireshark.org/review/1345
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-25 16:37:45 +00:00
Peter Wu 7435881cea Revert back to emem due to UAT use
Partially reverts "Convert SSL and TCP dissectors to wmem (with the
exception of UAT)." (960a461c8a).

ssl_load_pkcs12 is called in UAT context via
ssldecrypt_uat_fld_password_chk_cb and ssl_parse_key_list (dtls/ssl).

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

Change-Id: I22220fd128b17e273c5ed572a83edbfb8261bda9
Reviewed-on: https://code.wireshark.org/review/1344
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-25 15:30:06 +00:00
Michael Mann 182fd1719b Fix fuzz failure. Bug 10041.
Always need to initialize "firstline" when "line" is initialized.

Bug:10041
Change-Id: Iecee2e387e4a35f0d7126f8f14aa5bd34449a5d3
Reviewed-on: https://code.wireshark.org/review/1351
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-25 15:14:07 +00:00
AndersBroman b136182ad4 Make COMPUTE_OFFSET and COMPUTE_OFFSET_AND_REMAINING macros.
Change-Id: I7a7b5869947499c2e0edb4de4bb462d8e8c19fc7
Reviewed-on: https://code.wireshark.org/review/1346
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-25 14:53:16 +00:00
Pascal Quantin 7acaf8552b Kerberos: ensure that private data elements are stored in separate variables
Bug: 10028

Change-Id: I599cd5475d19b64c0d5b9d31d7054a3befc84af2
Reviewed-on: https://code.wireshark.org/review/1348
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-04-25 14:23:37 +00:00
Lorand Jakab 1c024bc29a Dissect all details in ELP LCAF type...
... and remove more of the remaining proto_tree_add_text() calls.

Change-Id: I0286af7fd6953b9276c15b3e7ce7d80c1bd39e8a
Signed-off-by: Lorand Jakab <ljakab@ac.upc.edu>
Reviewed-on: https://code.wireshark.org/review/1350
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-25 14:07:25 +00:00
AndersBroman a2a17cd6ab Fold alloc_field_info() into proto_tree_add_pi().
Change-Id: Iba9c6133d686fdcf70645238f8bd312815d377b0
Reviewed-on: https://code.wireshark.org/review/1349
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-25 13:32:35 +00:00
Guy Harris afbb1e78e9 Use 4-space indentation consistently in epan/charsets.c.
Make the EBCDIC <-> ASCII translation tables const, while we're at it.

Change-Id: I15a08f7329fd32f758cf36898fe4214ae8540462
Reviewed-on: https://code.wireshark.org/review/1343
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 09:36:11 +00:00
Guy Harris 29eba5308f Add a get_ebcdic_string() routine, similar to other get_XXX_string() routines.
Use it in epan/tvbuff.c.

Do some other cleanups while we're at it.

Change-Id: I7aed37a568373b896aacfd23f986d445b58b77b7
Reviewed-on: https://code.wireshark.org/review/1342
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 09:30:14 +00:00
Guy Harris 0d787afcb4 Another whitespace cleanup.
Change-Id: I7c5c557730fb59244bc82c35fcf79c40991d4d99
Reviewed-on: https://code.wireshark.org/review/1341
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 08:44:36 +00:00
Guy Harris e1bc641c8a Fix some white space.
Change-Id: I9adec36251e27e71c530e64a472ab7562bd07fed
Reviewed-on: https://code.wireshark.org/review/1340
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 08:38:44 +00:00
Guy Harris 6a9c924460 Move the XXX-to-UTF-8 loops to routines in epan/charsets.c.
This moves a bunch of character set knowledge into epan/charsets.c.

Change-Id: Ieb79dcaac9753c77703af756b666ad2ca9385d9e
Reviewed-on: https://code.wireshark.org/review/1339
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 08:32:06 +00:00
AndersBroman a4ff0bc5d2 Try to please the build boot.
Change-Id: I304960a0d1c8e64947a7f35e90da279e43051aac
Reviewed-on: https://code.wireshark.org/review/1338
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-25 07:24:05 +00:00