From 7e882df929c56acc243b2f20edf080a4597e40d7 Mon Sep 17 00:00:00 2001 From: tipstrade Date: Mon, 5 Nov 2018 17:07:15 +0000 Subject: [PATCH] Fix prefix check as per MySql bug report 93073 See https://bugs.mysql.com/bug.php?id=93073 --- MySQL.Data/src/Authentication/MySQLAuthenticationPlugin.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MySQL.Data/src/Authentication/MySQLAuthenticationPlugin.cs b/MySQL.Data/src/Authentication/MySQLAuthenticationPlugin.cs index 56448a24..0c5ede0d 100644 --- a/MySQL.Data/src/Authentication/MySQLAuthenticationPlugin.cs +++ b/MySQL.Data/src/Authentication/MySQLAuthenticationPlugin.cs @@ -247,10 +247,10 @@ private void ContinueAuthentication(byte[] data = null) _driver.SendPacket(packet); packet = ReadPacket(); + // Is it MySQL protocol (0=OK or 254=need old password) packet ? byte prefixByte = packet.Buffer[0]; - if (prefixByte != 1) return; + if (prefixByte == 0 || prefixByte == 254) return; - // A prefix of 0x01 means need more auth data. byte[] responseData = new byte[packet.Length - 1]; Array.Copy(packet.Buffer, 1, responseData, 0, responseData.Length); moreData = MoreData(responseData);