Database Articles

  Home arrow Database Articles arrow Page 6 - Authentication Protocol Security
DATABASE ARTICLES

Authentication Protocol Security
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2007-08-17

    Table of Contents:
  • Authentication Protocol Security
  • Authenticating Handshake
  • Command Packet
  • Server Responses
  • OK Packet
  • Error Packet
  • Result Set Packets

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Authentication Protocol Security - Error Packet


    (Page 6 of 7 )

    When something goes wrong with the processing of a command, the server responds with an error packet. The format is documented in Table 4-9.

    Table 4-9. Format of server’s error packet

    Offset in the body Length Description
    0 1 A byte containing 255. The client will always treat a response packet starting with a byte containing 255 as an error message.
    1 2

    The error code. Low byte first. The field will not be included if the server is talking to a very ancient pre-3.23 client, and the subsequent offsets should be adjusted accordingly in that case.

    3 2 Character ‘ # ’ followed by the byte containing the value of the ODBC/JDBC SQL state. Present only in version 4.1 and later.
    5 in version 4.1 and later, 3 in 4.0 and earlier Varies Zero-terminated text of the error message.

    To send an error packet from inside the server, call send_error() , which is defined in sql/protocol.cc in version 4.1 and later, and in sql/net_pkg.cc in version 4.0 and earlier.

    EOF Packet

    The end-of-file (EOF) packet is used to communicate a number of messages:

    EOF) packet is used to communicate a number of messages: The end-of-file (EOF) packet is used to communicate a number of messages:
    1. End-of-field information data in a result set
    2. End-of-row data in a result set
    3. Server acknowledgment of COM_SHUTDOWN
    4. Server reporting success in response to COM_SET_OPTION and COM_DEBUG
    5. Request for the old-style credentials during authentication

    The body of an EOF packet always starts with a byte containing decimal 254. In the pre-4.1 era, there was nothing else in the body in addition to this byte. Version 4.1 added another 4 bytes of status fields with the potential of going up to 7 bytes. The format of the version 4.1 EOF body is outlined in Table 4-10.

    Table 4-10. Format of server’s EOF packet

    Offset in the body

    Length

    Description

    0

    1

    Byte with the decimal 254

    1

    2

    Number of warnings

    3

    2

    Server status bit mask

    The reason for the 7 byte limit in the status bytes area is that the decimal 254 byte followed by an 8 byte string at the beginning of a packet body can have a different meaning: it can specify the number of fields in a result set using the field length format described in the “Data Field ” section, earlier in this chapter.

    To send an EOF packet, the server uses send_eof() , which is defined in sql/protocol.cc in 4.1 and later, and in sql/net_pkg.cc in the earlier versions.

    More Database Articles Articles
    More By O'Reilly Media

    blog comments powered by Disqus

    DATABASE ARTICLES ARTICLES

    - Completing a Book Inventory Management System
    - Uploading Images for a Book Inventory Manage...
    - Finishing the Add Book Story for a Book Inve...
    - Integration Testing for a Book Inventory Man...
    - User Stories for a Book Inventory Management...
    - Unit Testing a Book Inventory Management Sys...
    - Testing a Book Inventory Management System
    - Implementing Models for a Book Inventory Man...
    - Book Inventory Application: Publishers and B...
    - Handling Publishers in a Book Inventory Mana...
    - Publisher Administration for Book Inventory ...
    - Book Inventory Management
    - Using the SQL Reference Manual
    - Using Oracle SQL Developer with SQL Statemen...
    - Fixing Errors with Oracle SQL Developer


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap