MySQL: Request Unknown (133) (SSL: Handshake response packet)

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 <eapache@gmail.com>
Reviewed-by: Daniël van Eeden <wireshark@myname.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Alexis La Goutte 2014-08-04 18:24:34 +02:00 committed by Michael Mann
parent f080b43933
commit 601d99d77c
1 changed files with 4 additions and 3 deletions

View File

@ -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 {