Remove code moved to pgconn

pull/483/head
Jack Christensen 2018-12-31 17:52:11 -06:00
parent 378ccb8945
commit af2fc36c27
1 changed files with 0 additions and 23 deletions

23
conn.go
View File

@ -2,10 +2,8 @@ package pgx
import (
"context"
"crypto/md5"
"crypto/tls"
"encoding/binary"
"encoding/hex"
"io"
"net"
"reflect"
@ -901,27 +899,6 @@ func (c *Conn) rxMsg() (pgproto3.BackendMessage, error) {
return msg, nil
}
func (c *Conn) rxAuthenticationX(msg *pgproto3.Authentication) (err error) {
switch msg.Type {
case pgproto3.AuthTypeOk:
case pgproto3.AuthTypeCleartextPassword:
err = c.txPasswordMessage(c.pgConn.Config.Password)
case pgproto3.AuthTypeMD5Password:
digestedPassword := "md5" + hexMD5(hexMD5(c.pgConn.Config.Password+c.pgConn.Config.User)+string(msg.Salt[:]))
err = c.txPasswordMessage(digestedPassword)
default:
err = errors.New("Received unknown authentication message")
}
return
}
func hexMD5(s string) string {
hash := md5.New()
io.WriteString(hash, s)
return hex.EncodeToString(hash.Sum(nil))
}
func (c *Conn) rxErrorResponse(msg *pgproto3.ErrorResponse) *pgconn.PgError {
err := &pgconn.PgError{
Severity: msg.Severity,