From 601d99d77c4e0fe8b7024b41dc3bdb2f009ecaaa Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Mon, 4 Aug 2014 18:24:34 +0200 Subject: [PATCH] MySQL: Request Unknown (133) (SSL: Handshake response packet) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the MySQL protocol has established a SSL connection the first packet is a HandshakeResponse packet (aka Login Request). http://dev.mysql.com/doc/internals/en/ssl.html http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse The loginrequest within the SSL stream is not packet_number 1. (it however is the first packet in the ssl stream) Issue found by Daniël van Eeden Change-Id: Ic6110c38f7206a9788158c5c6861064939644221 Ping-Bug:10338 Reviewed-on: https://code.wireshark.org/review/3408 Reviewed-by: Evan Huus Reviewed-by: Daniël van Eeden Reviewed-by: Michael Mann --- epan/dissectors/packet-mysql.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/epan/dissectors/packet-mysql.c b/epan/dissectors/packet-mysql.c index d488567fb6..9392b01194 100644 --- a/epan/dissectors/packet-mysql.c +++ b/epan/dissectors/packet-mysql.c @@ -2046,7 +2046,7 @@ dissect_mysql_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat conversation_t *conversation; int offset = 0; guint packet_number; - gboolean is_response; + gboolean is_response, is_ssl = FALSE; mysql_conn_data_t *conn_data; #ifdef CTDEBUG mysql_state_t conn_state_in, conn_state_out, frame_state; @@ -2141,9 +2141,10 @@ dissect_mysql_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat PROTO_ITEM_SET_GENERATED(pi); } #endif + proto_get_frame_protocols(pinfo->layers, NULL, NULL, NULL, NULL, &is_ssl); if (is_response) { - if (packet_number == 0) { + if (packet_number == 0 ) { col_set_str(pinfo->cinfo, COL_INFO, "Server Greeting"); offset = mysql_dissect_greeting(tvb, pinfo, offset, mysql_tree, conn_data); } else { @@ -2151,7 +2152,7 @@ dissect_mysql_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat offset = mysql_dissect_response(tvb, pinfo, offset, mysql_tree, conn_data); } } else { - if (packet_number == 1) { + if (packet_number == 1 || (packet_number == 2 && is_ssl)) { col_set_str(pinfo->cinfo, COL_INFO, "Login Request"); offset = mysql_dissect_login(tvb, pinfo, offset, mysql_tree, conn_data); } else {