Commit Graph

366 Commits

Author SHA1 Message Date
Alexis La Goutte b36382a9ce TLS(1.3): with draft-16, Server Hello return draft release (0x7fxx)
set server_version to TLS 1.3

Change-Id: Id4d3d5d21ae996f447d826e98c0cf60880e7c0ce
Reviewed-on: https://code.wireshark.org/review/18171
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-10-13 00:13:35 +00:00
Alexis La Goutte 9434f25275 TLS(1.3): Add Supported Versions (43) Hello extension
Ping-Bug: 12779
Change-Id: Ia8dcfcb300f4da3bf270d9512fbcc85a7b1a8671
Reviewed-on: https://code.wireshark.org/review/18108
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-12 03:52:04 +00:00
Alexis La Goutte 6c26ed90dd TLS(1.3): Add new cipher from TLS 1.3
Change-Id: I8f39ea55763e925e15896efc9c519297c1288ccf
Reviewed-on: https://code.wireshark.org/review/18110
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-09 11:44:33 +00:00
Alexis La Goutte 827ae0c722 TLS: Fix typo after g989dcef3
Change-Id: I23cf7e7847aea4f48f035d567ba7d22060acb0e7
Reviewed-on: https://code.wireshark.org/review/18106
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-10-07 17:31:46 +00:00
Alexis La Goutte 196c2b1284 TLS(1.3): Add Hello Retry Request (6) extension
Add also special case on hello key_share extension

Ping-Bug: 12779
Change-Id: Ib8e2dd060f322c2404a8afa9b8cb70de7c2c65b7
Reviewed-on: https://code.wireshark.org/review/18093
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-07 11:43:50 +00:00
Alexis La Goutte 6529b36c54 TLS(1.3): Add cookie (44) hello extension
Ping-Bug: 12779
Change-Id: I94d492d126050fdff6f98608f9d68d55c19e0a50
Reviewed-on: https://code.wireshark.org/review/18092
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-07 07:40:51 +00:00
Dario Lombardo 542c3c6f3a ssl: use ws_strtou function.
Change-Id: I947dc83e3b1b853873b5158f234e44ef933c3bcc
Reviewed-on: https://code.wireshark.org/review/17982
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-03 14:35:37 +00:00
Alexis La Goutte b3166fd87c TLS: Fix indent of SNI hello extension
use 4 spaces

Change-Id: I0cbde19997f51046e6d5f22213b994a94a2998d6
Reviewed-on: https://code.wireshark.org/review/17978
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-29 08:46:34 +00:00
Alexis La Goutte d39d272e80 TLS(1.3): Add Early Data (42) Hello extension
Bug:12779
Change-Id: I97470c6e6be6e3df707cf2f3634f2c1e9da26bc2
Reviewed-on: https://code.wireshark.org/review/17885
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-27 03:53:44 +00:00
Peter Wu b5eb01c1a5 ssl: fix crash when setting RSA key file without valid protocol
If ssl_association_add is passed a NULL app_handle argument, it will
trigger DISSECTOR_ASSERT which fails due to the bad wmem scope
(wmem_packet_scope). Arguably DISSECTOR_ASSERT should not be used there,
but its alternative is g_warning/g_assert are not much different...

Fix the crash (assertion failure) by checking that the UAT-supplied
protocol is really valid. Normally the post_update_cb should not be
invoked if any of the fields are invalid, but that requires larger
changes in the Qt UAT dialog code.

Change-Id: Ie245213b650b1de9640db8dadd08f3ed2bff335f
Reviewed-on: https://code.wireshark.org/review/17906
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>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-27 03:49:39 +00:00
Peter Wu 75ae538514 ssl: fix exact matching of ALPN protocol names
The "name_length >= alpn_proto->proto_name_len" condition always failed
to match for short names (like "h2" where the reported length is 2, but
the proto_name_len would be 3).

This fixes recognition of HTTP/2 traffic, without this patch it would be
interpreted as http-over-tls as reported on
https://ask.wireshark.org/questions/55720/how-to-install-http2-dissector-plugin

Change-Id: Idc3eae0b6d593c8f3c435230ef76da90a4b1e7fc
Reviewed-on: https://code.wireshark.org/review/17907
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-09-25 00:39:25 +00:00
Peter Wu 8b047554ee ssl-utils: fix decryption of NULL ciphers
A dissector bug was reported:

    epan/dissectors/packet-ssl-utils.c:1615: failed assertion "data"

and fair enough, the MAC Key is indeed NULL because of our special
handling for NULL ciphers. Just ignore the MAC key then.

Change-Id: I12d2be5e84520badb44a99fc965c48c3afa89346
Fixes: v2.3.0rc0-697-gb1d36fe ("ssl-utils: remove block and key sizes from cipher suites table")
Reviewed-on: https://code.wireshark.org/review/17903
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-09-24 12:34:45 +00:00
Alexis La Goutte 989dcef317 TLS: Update Hello ExtensionType list
use same name and display in dec from http://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml

Change-Id: Ia4a959571204b611dbf275311c9ce58c594b6716
Reviewed-on: https://code.wireshark.org/review/17886
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-24 08:25:34 +00:00
Alexis La Goutte 2e0cbb7ae7 TLS: use define value for ssl_versions value string
and also move on the top and not too far from ssl_version_short value_string

Change-Id: I9012d0d0839fd29da500a7f37a83ecc982f0fb5b
Reviewed-on: https://code.wireshark.org/review/17887
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-23 13:40:21 +00:00
Alexis La Goutte b9d4a18ad2 TLS: no extension length on padding extension
also remove padding function (don't needed)

Bug: 12922
Change-Id: Ie049ee21193ec82b8dc873a7dff78e9d058c7935
Reviewed-on: https://code.wireshark.org/review/17825
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-21 11:41:30 +00:00
Alexis La Goutte b83c730ff0 TLS(1.3): Add Pre-Shared Key (41) Hello extension
Bug: 12779
Change-Id: I64ef80db0a8b51ee569fed3b87099144e57eedc2
Reviewed-on: https://code.wireshark.org/review/17320
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: Peter Wu <peter@lekensteyn.nl>
2016-09-20 09:14:07 +00:00
Alexis La Goutte 41567191d8 TLS(1.3): Add Share Key (40) Hello extension
Bug: 12779
Change-Id: I5cbc911f2c7818558c5182d2e3ccf9235be9281b
Reviewed-on: https://code.wireshark.org/review/17301
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-16 22:39:29 +00:00
Alexis La Goutte 5540df7a82 TLS: Pass directly the handshake_type to dissect_hnd_hello_ext
with TLS 1.3, there is a new 'Hello' type (Hello Retry Request)

Change-Id: If7a11b70a5b0a69044126c50e1d6ab4e1d443f77
Reviewed-on: https://code.wireshark.org/review/17573
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-16 22:35:19 +00:00
Alexis La Goutte c1d9ce47b5 TLS(1.3): Add new Hello extension list
* Key share (40)
* Pre-Shared Key (41)
* Early Data (42)
* Cookie (44)

Bug: 12779
Change-Id: I16e3cf691ae66e244608db233db180e24538a68d
Reviewed-on: https://code.wireshark.org/review/17239
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-16 22:33:37 +00:00
Alexis La Goutte d32b116d40 TLS(1.3): Add (experimental) extension 'Draft version TLS 1.3'
Coming from https://github.com/tlswg/tls13-spec/wiki/Implementations#version-negotiation

Bug: 12779
Change-Id: Ieca74eac737b5ba6c101b719e2e5e3aecf931279
Reviewed-on: https://code.wireshark.org/review/17226
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-16 22:31:43 +00:00
Alexis La Goutte 7319887c31 TLS(1.3): Fix Server Hello
There is no session_id and compression method with TLS 1.3 Server Hello

Also no time on first bytes of random field

Bug: 12779
Change-Id: Id79221c2ad50695cf6d46cd5c9255deab99e2d2c
Reviewed-on: https://code.wireshark.org/review/17225
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-16 22:30:29 +00:00
Alexis La Goutte 778f7c52cc TLS(1.3): Add TLS 1.3 value for version Handshake
Bug: 12779
Change-Id: I298ecf4a0537df2e88354aed6912d4298a094216
Reviewed-on: https://code.wireshark.org/review/17224
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-16 22:28:34 +00:00
Peter Wu 663031e4a8 ssl-utils: fix -Wshorten-64-to-32 and other warnings
Fixes -Wshorten-64-to-32 from v2.3.0rc0-697-gb1d36fe ("ssl-utils: remove
block and key sizes from cipher suites table"), -Wpointer-sign,
-Wunreachable-code-break.

Change-Id: I37ca5e9effe5d6560d49ccef53e9feb096cd2ad6
Reviewed-on: https://code.wireshark.org/review/17727
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-09-16 11:27:39 +00:00
Guy Harris 689ff93474 Squelch some compiler warnings.
gcry_cipher_get_algo_keylen() returns a size_t, which is bigger than a
guint on most if not all 64-bit platforms; however, if the key is bigger
than 2^32 bytes, we have bigger problems, so just cast it down.

Change-Id: Ia7c97d2742686daf2e42f634c6e349cb580fa9df
Reviewed-on: https://code.wireshark.org/review/17731
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-16 10:00:15 +00:00
Peter Wu 1cd3587b73 ssl-utils: fix runtime memory leak
Ensure that Libgcrypt and zlib memory are freed when closing a pcap.

Change-Id: I420f9950911d95d59ff046fee57900ca6f7e9621
Reviewed-on: https://code.wireshark.org/review/17718
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-16 07:50:46 +00:00
Peter Wu b1d36fe0df ssl-utils: remove block and key sizes from cipher suites table
There was an implicit dependency between the block size in the cipher
suites table and the size expected by Libgcrypt. Just remove the block
size from the table and rely on the value from Libgcrypt to avoid the
risk of mismatching values (which could lead to a buffer overflow).

While at it, remove the size of the key ("bits") and the size of key
material ("eff_bits") too. Move the key material sizes for export
ciphers away from the table and use byte quantities instead of bits.

Additionally, this fixes an issue where 8 bytes of uninitialized stack
memory is written to the SSL debug log for stream ciphers like RC4.
The size of the Write Key is also corrected for export ciphers, now it
prints the actual (restricted) number of bytes that are used.

Change-Id: I71d3c83ece0f02b2e11e45455dc08c41740836be
Reviewed-on: https://code.wireshark.org/review/17714
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-09-16 07:29:40 +00:00
Peter Wu 979df813dc ssl-utils: fix buffer overrun (read) with AEAD cipher suites
ssl_cipher_init should only set the IV for CBC cipher suites. NULL
cipher suites will not invoke gcry_cipher_setiv and AEAD ciphers will
set the nonce in a different place anyway.

Fixes a buffer overrun (read) by 12 bytes for any AES-CCM and AES-GCM
cipher suite because the "block size" is set to 4 bytes while the
reported block size for AES is 16 bytes (128 bit). (The four bytes are
the "salt" part of the nonce that is extracted from the "client/server
write IV" part of the key block.)

Observed with the DTLS packet capture from
https://ask.wireshark.org/questions/55487/decrypt-application-data-pending-dtls-abbreviated-handshake-using-psk

Change-Id: I4cc7216f2d77cbd1eac9a40dca3fdfde7e7b3680
Reviewed-on: https://code.wireshark.org/review/17713
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-09-16 05:28:40 +00:00
Peter Wu f2e79776a7 eap: fix EAPOL conversation tracking, fixes TLS decryption
Use new heuristics based on the EAP Code field to determine whether a
field originates from the client or server. This is more reliable than
using "pinfo->match_uint" for two reasons: (1) the heuristics dissector
does not set "match_uint" (resulting in an arbitrary match on the
previous value) and (2) with EAP over EAPOL, there is no matching port
number (resulting in two conversations with different addresses and port
number zero).

To fix TLS decryption, make sure to create a single conversation for
both direction and allow the port type to be PT_NONE (to avoid reporting
all packets as originating from the server).

Bug: 12879
Change-Id: I7b4267a27ffcf68bf9d3f6a90d6e6e2093733f51
Reviewed-on: https://code.wireshark.org/review/17703
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-09-15 04:25:08 +00:00
Alexis La Goutte 2fb9cbd9ad TLS: Enhance display of Hello Extension
Append the length to the extension and display the contents of
unknown extensions as bytes.

Change-Id: Iba1204a1d5e187f28cb41c4369b10eeb86e6b43a
Reviewed-on: https://code.wireshark.org/review/17265
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-11 04:32:27 +00:00
Peter Wu f7a59da905 ssl: set protocol column to "TLS" when possible
The protocol version from a SSL/TLS record contains the minimum
supported SSL/TLS version and is the best guess for Client Hello
handshake messages if no authorative version is available.

By considering the version from the conversation for the initial
col_set_str call, we can also remove some other calls down the road.

Change-Id: I4be25f5c9057ffd0abcea7280d826867c135fed7
Reviewed-on: https://code.wireshark.org/review/17490
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: Peter Wu <peter@lekensteyn.nl>
2016-09-09 10:42:23 +00:00
Peter Wu 7a674c006b ssl: fix TLS renegotiation, add test for this
A handshake starts a new session, be sure to clear the previous state to
avoid creating a decoder with wrong secrets.

Renegotiations are also kind of transparant to the application layer, so
be sure to re-use an existing SslFlow. This fixes the Follow SSL stream
functionality which would previously ignore everything except for the
first session.

The capture file contains a crafted HTTP request/response over TLS 1.2,
interleaved with renegotiations. The HTTP response contains the Python
script used to generate the traffic. Surprise!

Change-Id: I0110ce76893d4a79330845e53e47e10f1c79e47e
Reviewed-on: https://code.wireshark.org/review/17480
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-06 13:45:30 +00:00
Peter Wu 10e84a612b ssl: really fix session resumption expert info
In a two-pass dissection with renegotiated sessions, the
is_session_resumed flag is not updated according to the current protocol
flow. Fix this by performing detection of abbreviated handshakes in
all cases, do not limit it to the decryption stage (where ssl != NULL).

Reset the resumption assumption after the first ChangeCipherSpec
(normally from the server side, but explicitly add this in case client
packets somehow arrive earlier in the capture). This should not have a
functional effect on normal TLS captures with Session Tickets.

Bug: 12793
Change-Id: I1eb2a8262b4e359b8c1d3d0a1e004a9e856bec8c
Reviewed-on: https://code.wireshark.org/review/17483
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-06 11:53:31 +00:00
Peter Wu 7c7497a77e ssl,http: rename http-over-ssl to http-over-tls
This name is displayed in the SSL prototcol tree (Application Data
Protocol: http-over-tls), rename to avoid possible user confusion.

Modify the SSL dissector such that both "http" and "http-over-tls"
invoke the same dissector function.

Change-Id: I2d52890a8ec8fa88b6390b133a11df607a5ec3dc
Reviewed-on: https://code.wireshark.org/review/17481
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-04 13:18:54 +00:00
Peter Wu 7c75370224 ssl: fix wrong detection of non-resumed renegotiated session
If the heuristics fail to detect a resumed session, then it must mark
the session as a normal session. This will also prevent from
applying secrets that do not apply to this renegotiated session.

Bug: 12793
Change-Id: I90f794a7bbaf7f1839e39656ac318183ecf48887
Reviewed-on: https://code.wireshark.org/review/17376
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-08-30 08:15:14 +00:00
Jaap Keuter 9affd2656c SSL utils: Add proper check while getting bag type
Implementing proper return value check, as done for other gnutls function
calls, catches (unlikely) errors and allows C++ compatible build.

Change-Id: Idf5bd3fe6e68d006a469fe72663dea1c7e2d17f7
Reviewed-on: https://code.wireshark.org/review/16865
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-03 22:26:52 +00:00
Kim Kempf 7a9ab60a6e Fixed compile error in packet-ssl-utils.c when HAVE_LIBCRYPT not defined
Bug: 12680
Change-Id: I7219e38be48d1115e7e80b41337423be64776e5a
Reviewed-on: https://code.wireshark.org/review/16742
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-07-28 07:48:00 +00:00
Peter Wu ae0f130582 ssl-utils: ensure that the cipher suite matches decoder
When the cipher suite for the current decryption session is changed via
a Server Hello, it should not change the cipher suite field of the
decoder. Otherwise there is a mismatch between the cipher suite and the
capabilities of the decoder.

Fix this issue by making the decoder hold a pointer to the (constant)
SslCipherSuite structure rather than making a copy (and have the decoder
point to that data).

I also considered resetting the decoder once the cipher suite changes in
the Server Hello, but that breaks renegotiation.

Bug: 12665
Change-Id: Ieff38a535cd111d95933ec383378643b6fbab7bf
Reviewed-on: https://code.wireshark.org/review/16674
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-07-27 10:11:22 +00:00
Jeff Morriss cb987e86ab Don't leak a file descriptor when changing the SSL debug file name.
I guess people don't change the SSL debug file name that often--this bug has
been here since 2006...

Change-Id: I3db053dd7e0cb9a9e4ae49a310e956b3c77c99f6
Reviewed-on: https://code.wireshark.org/review/16236
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-01 18:36:24 +00:00
Michael Mann 57ef06e242 *_stdup_printf -> strdup for "single string only" formatting.
Done for performance improvements.

This could probably be done in checkAPIs.pl, but this was just
a quick manual check with grepping.

Change-Id: I91ff102cb528bb00fa2f65489de53890e7e46f2d
Reviewed-on: https://code.wireshark.org/review/15751
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: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-06-06 06:03:58 +00:00
João Valverde f69b3b1f0e IMAP: Add heuristic check for TLS
If the IMAP TCP stream doesn't include the STARTTLS command/response
the IMAP dissector will try to dissect TLS ciphertext as IMAP protocol
plaintext.

Add heuristic check for SSLv3/TLS and if the heuristic matches register
dissect_ssl() as the dissector for that IMAP session.

Change-Id: If84eca22315193a306e93e66c608de6634e6cd85
Reviewed-on: https://code.wireshark.org/review/13570
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-05-01 23:32:41 +00:00
João Valverde 3db13a7fc9 Link version code statically again
This allows keeping the code-sharing with the static linking.

This "fixes" a hypothetical ABI mismatch with wsutil and avoids pulling more
external dependencies to wsutil than strictly necessary.

A nice side-effect is that libwsutil no longer depends on version.h.

Follow up to f95976eefc.

Change-Id: I8f0d6a557ab3f7ce6f0e2c269124c89f29d6ad23
Reviewed-on: https://code.wireshark.org/review/15002
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-04-21 18:59:56 +00:00
Gerald Combs cf6501eb45 Windows: Remove the need for _CRT_NONSTDC_NO_DEPRECATE.
Replace some function calls with their non-deprecated equivalents so
that we can remove _CRT_NONSTDC_NO_DEPRECATE from CMakeLists.txt and
config.nmake.

Leave _CRT_SECURE_NO_DEPRECATE in place. Removing it failed with 145
warnings and 72 errors.

Note that we could probably improve startup performance by using wmem
in diam_dict.*.

Change-Id: I6e130003de838aebedbdd1aa78c50de8a339ddcb
Reviewed-on: https://code.wireshark.org/review/14883
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: Michael Mann <mmann78@netscape.net>
2016-04-13 02:16:20 +00:00
João Valverde 6f98a0fac3 Rename "libz" to "zlib"
Change-Id: I12f92c983d587c2a4751428cdf299635090c9f0b
Reviewed-on: https://code.wireshark.org/review/14748
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-04 06:58:41 +00:00
Hauke Mehrtens b46fe7e95a ssl: add more TLS extensions
These extensions were added in the last time.
This just adds the basic part, wireshark is now able to translate the
number into a string. these numbers are defined here:
https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml

Change-Id: I9d1f1a04318aa116930202aa0fadb59648bed78d
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-on: https://code.wireshark.org/review/14484
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-16 22:48:24 +00:00
Hauke Mehrtens ec2c9a1e61 ssl: add extra supported ECC/DH groups
These new groups are defined by IANA here:
https://www.iana.org/assignments/tls-parameters/tls-parameters.xml

Change-Id: I29e0710d853e172c27b8989b21f7b29535bfc521
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-on: https://code.wireshark.org/review/14485
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-16 00:58:14 +00:00
Hauke Mehrtens d6ae444945 ssl: update tls protocol number for draft-ietf-tls-chacha20-poly1305
This updates the protocol number to the latest draft.
These numbers are now defined by the IANA here:
https://www.iana.org/assignments/tls-parameters/tls-parameters.xml

Change-Id: Ibb7eb532da86c092ec1476451fb85c1656163e13
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-on: https://code.wireshark.org/review/14483
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-16 00:56:54 +00:00
Bertrand Bonnefoy-Claudet d4dd4fd848 Fix names of SSLv2 RC2 cipher suites
The previous naming for suite 0x040080 was wrong according to [1] and [2].  It
is an export suite but its name did not reflect that.

This also removes the extra "CBC_" in both RC2 cipher suites as it seems more
consistent with other names, the specification and OpenSSL.

[1] https://github.com/openssl/openssl/blob/OpenSSL_1_0_2-stable/ssl/ssl2.h#L95
[2] http://www-archive.mozilla.org/projects/security/pki/nss/ssl/draft02.html

Change-Id: I4a62463fdd7b0733a9652f8ab601848b26977c28
Reviewed-on: https://code.wireshark.org/review/14197
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-27 13:45:56 +00:00
João Valverde e4c059f67f Add free_address_wmem(), fix warnings [-Wcast-qual]
Try to improve address API and also fix some constness warnings
by not overloading the 'data' pointer to store malloc'ed buffers
(use private pointer for that instead).

Second try, now passing test suite.

Change-Id: Idc101cd866b6d4f13500c9d59da5c7a38847fb7f
Reviewed-on: https://code.wireshark.org/review/13946
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-26 23:09:43 +00:00
Peter Wu f4580ac9ed ssl: fix decryption when session ticket is not used
Do not use the client-supplied session ticket for decryption when the
session is not resumed as the cached key (associated with that ticket)
is invalid for this new session. SSL Session IDs are unaffected by this
issue as only the server-issued Session ID is considered.

This fixes decryption of a SSL capture which uses the keylog file for
decryption, but where the session tickets are invalid because the server
was restarted.

Additionally, the session and session tickets stores are split to avoid
exporting session tickets via File -> Export SSL Session keys. Session
tickets should only be used internally, the CLIENT_RANDOM identifier is
shorter and is the preferred method to link secrets.

Change-Id: If96d7a4e89389825478e67e9a65401ce0607aa66
Reviewed-on: https://code.wireshark.org/review/13994
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-19 03:33:45 +00:00
João Valverde ef929dc8eb Revert "Add free_address_wmem() and other extensions to address API"
This reverts commit 13ec77a9fc.

This commit introduces a segmentation fault for Lua code (uncovered by the test suite).

Change-Id: Ibc273d1915cda9632697b9f138f0ae104d3fb65e
Reviewed-on: https://code.wireshark.org/review/13813
Reviewed-by: João Valverde <j@v6e.pt>
2016-02-08 00:44:22 +00:00