Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 6342] New: MySQL’s response for a “prepare statement” com

Date: Thu, 15 Sep 2011 01:07:47 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6342

           Summary: MySQL’s response for a “prepare statement” command not
                    supported by the MySQL dissector
           Product: Wireshark
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Low
         Component: TShark
        AssignedTo: bugzilla-admin@xxxxxxxxxxxxx
        ReportedBy: pmderodat@xxxxxxxx


Created an attachment (id=7016)
 --> (https://bugs.wireshark.org/bugzilla/attachment.cgi?id=7016)
Capture of a MySQL connection using prepared statements

Build Information:
wireshark 1.7.0 (SVN Rev 38992 from /trunk)

Copyright 1998-2011 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled (32-bit) with GTK+ 2.24.4, with Cairo 1.10.2, with Pango 1.28.4, with
GLib 2.28.6, with libpcap 1.1.1, with libz 1.2.3.4, with POSIX capabilities
(Linux), with threads support, with SMI 0.4.8, with c-ares 1.7.3, with Lua 5.1,
with Python 2.7.1+, with GnuTLS 2.8.6, with Gcrypt 1.4.6, with MIT Kerberos,
with GeoIP, with PortAudio V19-devel (built Mar 18 2011 15:44:36), without
AirPcap.

Running on Linux 2.6.38-8-generic, with locale en_US.UTF-8, with libpcap
version
1.1.1, with libz 1.2.3.4, GnuTLS 2.8.6, Gcrypt 1.4.6.

Built using gcc 4.5.2.
--
The MySQL’s dissector do not fully support the server response packet for a
“prepare statement” command (see
http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol#OK_for_Prepared_Statement_Initialization_Packet).

I’ve fixed it so it can analyze the following information:
– the ID of the created prepared statement
– the number of columns in the result set
– the number of parameters in the query
– the warning count

I’ve also fixed the state machine so that after having received this OK packet,
the dissector is expecting the correct types for the next packets:
– field packets + EOF packet if the number of parameters is > 0
– the same if the number of columns is > 0.

With my changes to the MySQL’s dissector, I’ve run successfully 90000
iterations with the fuzz-testing tool (tools/fuzz-test.sh) using the attached
capture.

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.