WriteClearAuthPacket: Client clear text authentication packet http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchResponse
(password string)
| 223 | // WriteClearAuthPacket: Client clear text authentication packet |
| 224 | // http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchResponse |
| 225 | func (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 |
no test coverage detected