MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / WriteClearAuthPacket

Method WriteClearAuthPacket

IceFireDB-SQLProxy/pkg/mysql/packet/conn.go:225–235  ·  view source on GitHub ↗

WriteClearAuthPacket: Client clear text authentication packet http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchResponse

(password string)

Source from the content-addressed store, hash-verified

223// WriteClearAuthPacket: Client clear text authentication packet
224// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchResponse
225func (c *Conn) WriteClearAuthPacket(password string) error {
226 // Calculate the packet length and add a tailing 0
227 pktLen := len(password) + 1
228 data := make([]byte, 4+pktLen)
229
230 // Add the clear password [null terminated string]
231 copy(data[4:], password)
232 data[4+pktLen-1] = 0x00
233
234 return errors.Wrap(c.WritePacket(data), "WritePacket failed")
235}
236
237// WritePublicKeyAuthPacket: Caching sha2 authentication. Public key request and send encrypted password
238// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchResponse

Callers 1

handleAuthResultMethod · 0.95

Calls 1

WritePacketMethod · 0.95

Tested by

no test coverage detected