From 61bccb050b910c918d326f2f318ed3f623d5b374 Mon Sep 17 00:00:00 2001 From: Souma Kanti Ghosh Date: Thu, 5 Sep 2024 18:59:57 +0530 Subject: [PATCH] BUG#36577957: Update charset/collation description indicate this is 16 bits This patch fixes the issue where Connector/Python violates the MySQL Connection Protocol while authenticating or setting up SSL before entering the authentication phase by setting 2 bytes instead of 1 for charset option in the response packet. Change-Id: Ib2ddfad4acdd119255f44ee0b56410429b9e86f8 --- CHANGES.txt | 1 + mysql-connector-python/lib/mysql/connector/protocol.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 34c96522..2e6d99b3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -19,6 +19,7 @@ v9.1.0 - WL#16307: Remove Python 3.8 support - WL#16306: Add support for Python 3.13 - BUG#37013057: mysql-connector-python Parameterized query SQL injection +- BUG#36577957: Update charset/collation description indicate this is 16 bits v9.0.0 ====== diff --git a/mysql-connector-python/lib/mysql/connector/protocol.py b/mysql-connector-python/lib/mysql/connector/protocol.py index e9e186e3..a0f213d2 100644 --- a/mysql-connector-python/lib/mysql/connector/protocol.py +++ b/mysql-connector-python/lib/mysql/connector/protocol.py @@ -428,8 +428,8 @@ def make_auth_ssl( [ utils.int4store(client_flags), utils.int4store(max_allowed_packet), - utils.int2store(charset), - b"\x00" * 22, + utils.int1store(charset), + b"\x00" * 23, ] )