Ejemplo n.º 1
0
 private HandShakePacket ReceiveGreeting()
 {
     var handShakePacket = new HandShakePacket();
     handShakePacket.Read(this.socket);
     return handShakePacket;
 }
Ejemplo n.º 2
0
        private void SendHandShake()
        {
            plugData = GetRandomChallenge();

            var packet = new HandShakePacket()
            {
                ServerVersion = "Greedy.MySqlProxy-0.1.0",
                ConnectionId = Thread.CurrentThread.ManagedThreadId,
                AuthPluginDataPart1 = plugData.Take(8).ToArray(),
                Capabilities = (CapabilityFlags)0xf7ff,
                CharacterSet = CharacterSet.UTF8_GENERAL_CI,
                Status = StatusFlags.SERVER_STATUS_AUTOCOMMIT,
                AuthPluginDataPart2 = plugData.Skip(8).Concat(new byte[] { 0x00 }).ToArray(),
                AuthPluginDataLength = 0x00,
                AuthPluginName = "mysql_native_password"
            };

            SendPacket(packet);
        }