summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-ssl-utils.c
AgeCommit message (Collapse)AuthorFilesLines
2017-01-28(D)TLS: fix type of record sequence numberTLS13Peter Wu1-18/+6
The record sequence number is 64-bit, not 32-bit. This applies to all SSLv3/TLS/DTLS versions. Without this fix, after about four million records, the wrong MAC is calculated (for TLS 1.2) or decryption will fail (for TLS 1.3). Change-Id: I05e5e8bc4229ac443a1b06c5fe984fb885eab1ca
2017-01-28TLS: fix decryption of renegotiated sessionsPeter Wu1-1/+6
Renegotiated sessions may interleave application data with handshake records. These handshake records should however not be included in the flow associated with the application data. This fixes a regression in the previous patch, now the "1.12 Step: SSL Decryption (renegotiation)" test passes again. Also remove duplicate DTLS data sources for decrypted records. Change-Id: I46d416ffba11a7c25c5a682b3b53f06d10d4ab79 Fixes: v2.3.0rc0-2152-g77404250d5 ("(D)TLS: consolidate and simplify decrypted records handling")
2017-01-28(D)TLS: consolidate and simplify decrypted records handlingPeter Wu1-71/+36
Previously there was a distinction between decrypted handshake Application Data records ("Decrypted SSL data") and some others (like Alerts, Handshake and Heartbeat, "Decrypted SSL record"). Remove this distinction and always decrypt the payload before passing it on and always display a data sources for decrypted contents ("Decrypted SSL"). This is prepatory work for TLS 1.3 support where the content type is located in the encrypted record, having the record decryption in one place makes it easier to adapt. Change-Id: I92c51c7f9e87e5c93231d28c39a8e896f5afd1ef Ping-Bug: 12779 Reviewed-on: https://code.wireshark.org/review/19789 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>
2017-01-27ssl-utils: recognize new TLS 1.3 keylog formatPeter Wu1-3/+36
Implemented by BoringSSL, an older description can be found at: https://github.com/google/boringssl/commit/e776cc29568e520aaabc83188cc7db7991f0b776 Implementation pending at OpenSSL: https://github.com/openssl/openssl/pull/2287 NSS bug (still open): https://bugzilla.mozilla.org/show_bug.cgi?id=1287711 Proposal for PicoTLS: https://github.com/h2o/picotls/issues/6 Change-Id: Ib597f48e296d286d8f6d30873ca03e7d6324a3c4 Ping-Bug: 12779 Reviewed-on: https://code.wireshark.org/review/19801 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>
2017-01-09TLS(1.3): update PSK extension for draft -18Peter Wu1-60/+46
Removed ke_modes and auth_modes fields, add identity.obfuscated_ticket_age and binders fields. (Note that binders field is not dissected further at this moment due to the lack of a pcap for verification.) Ping-Bug: 12779 Change-Id: I9af7d93feb2352a494be2d5bda66d124267cf464 Reviewed-on: https://code.wireshark.org/review/19462 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>
2016-12-31TLS(1.3): Add PSK Key Exchanges Modes (45) hello extensionAlexis La Goutte1-1/+39
Ping-Bug: 12779 Change-Id: Ie797a437240e5530d74e3039f12a60a6f0395d0a Reviewed-on: https://code.wireshark.org/review/18916 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-06DTLS: add support for use_srtp extension (RFC 5764)Peter Wu1-6/+18
Decryption support will be added later. Tested with dtls-srtp-ws-sip.pcapng from the linked bug. Change-Id: Ida1a2da754ef9aef16ad15ff64455b6f8e703ffd Ping-Bug: 13193 Reviewed-on: https://code.wireshark.org/review/18996 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-11-11ssl: fix next_protocol_negotiation idPeter Wu1-1/+1
NPN is a legacy extension (superseded by ALPN), but there was still a capture with this value. However, the decimal number is wrong. Adjust it to the one in the draft -03 (the hex number is still correct). Change-Id: I80ce468bcb653bc8ec87432d76d478cb0423b46f Reviewed-on: https://code.wireshark.org/review/18744 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-11-02TLS(1.3): Add new AlertAlexis La Goutte1-0/+3
Change-Id: Ice365bf3ca2198b3d81994a5670ac50add3e53dc Reviewed-on: https://code.wireshark.org/review/18620 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-13TLS(1.3): with draft-16, Server Hello return draft release (0x7fxx)Alexis La Goutte1-0/+3
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-12TLS(1.3): Add Supported Versions (43) Hello extensionAlexis La Goutte1-0/+30
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-09TLS(1.3): Add new cipher from TLS 1.3Alexis La Goutte1-0/+6
Change-Id: I8f39ea55763e925e15896efc9c519297c1288ccf Reviewed-on: https://code.wireshark.org/review/18110 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-07TLS: Fix typo after g989dcef3Alexis La Goutte1-1/+1
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-07TLS(1.3): Add Hello Retry Request (6) extensionAlexis La Goutte1-0/+29
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-07TLS(1.3): Add cookie (44) hello extensionAlexis La Goutte1-0/+23
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-03ssl: use ws_strtou function.Dario Lombardo1-6/+14
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-09-29TLS: Fix indent of SNI hello extensionAlexis La Goutte1-31/+31
use 4 spaces Change-Id: I0cbde19997f51046e6d5f22213b994a94a2998d6 Reviewed-on: https://code.wireshark.org/review/17978 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-27TLS(1.3): Add Early Data (42) Hello extensionAlexis La Goutte1-0/+23
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-27ssl: fix crash when setting RSA key file without valid protocolPeter Wu1-2/+2
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-25ssl: fix exact matching of ALPN protocol namesPeter Wu1-10/+11
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-24ssl-utils: fix decryption of NULL ciphersPeter Wu1-2/+5
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-24TLS: Update Hello ExtensionType listAlexis La Goutte1-34/+33
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-23TLS: use define value for ssl_versions value stringAlexis La Goutte1-13/+13
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-21TLS: no extension length on padding extensionAlexis La Goutte1-27/+2
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-20TLS(1.3): Add Pre-Shared Key (41) Hello extensionAlexis La Goutte1-0/+115
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-16TLS(1.3): Add Share Key (40) Hello extensionAlexis La Goutte1-0/+63
Bug: 12779 Change-Id: I5cbc911f2c7818558c5182d2e3ccf9235be9281b Reviewed-on: https://code.wireshark.org/review/17301 Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-16TLS: Pass directly the handshake_type to dissect_hnd_hello_extAlexis La Goutte1-19/+34
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-16TLS(1.3): Add new Hello extension listAlexis La Goutte1-0/+4
* 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-16TLS(1.3): Add (experimental) extension 'Draft version TLS 1.3'Alexis La Goutte1-0/+6
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-16TLS(1.3): Fix Server HelloAlexis La Goutte1-36/+46
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-16TLS(1.3): Add TLS 1.3 value for version HandshakeAlexis La Goutte1-0/+3
Bug: 12779 Change-Id: I298ecf4a0537df2e88354aed6912d4298a094216 Reviewed-on: https://code.wireshark.org/review/17224 Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-16ssl-utils: fix -Wshorten-64-to-32 and other warningsPeter Wu1-2/+1
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-16Squelch some compiler warnings.Guy Harris1-3/+3
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-16ssl-utils: fix runtime memory leakPeter Wu1-5/+21
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-16ssl-utils: remove block and key sizes from cipher suites tablePeter Wu1-327/+382
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-16ssl-utils: fix buffer overrun (read) with AEAD cipher suitesPeter Wu1-3/+6
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-15eap: fix EAPOL conversation tracking, fixes TLS decryptionPeter Wu1-1/+1
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-11TLS: Enhance display of Hello ExtensionAlexis La Goutte1-6/+4
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-09ssl: set protocol column to "TLS" when possiblePeter Wu1-1/+5
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-06ssl: fix TLS renegotiation, add test for thisPeter Wu1-4/+53
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-06ssl: really fix session resumption expert infoPeter Wu1-4/+6
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-04ssl,http: rename http-over-ssl to http-over-tlsPeter Wu1-2/+11
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-08-30ssl: fix wrong detection of non-resumed renegotiated sessionPeter Wu1-0/+2
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-03SSL utils: Add proper check while getting bag typeJaap Keuter1-2/+6
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-07-28Fixed compile error in packet-ssl-utils.c when HAVE_LIBCRYPT not definedKim Kempf1-2/+2
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-27ssl-utils: ensure that the cipher suite matches decoderPeter Wu1-62/+72
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-01Don't leak a file descriptor when changing the SSL debug file name.Jeff Morriss1-1/+4
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-06-06*_stdup_printf -> strdup for "single string only" formatting.Michael Mann1-4/+4
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-05-01IMAP: Add heuristic check for TLSJoão Valverde1-5/+19
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-04-21Link version code statically againJoão Valverde1-1/+1
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 f95976eefcbeb5d24df383c29d29ef888b503945. 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>