Skip to content

Commit 388e66a

Browse files
committed
Remove assumption that the auth response is AuthenticateOk
1 parent b7ffbd3 commit 388e66a

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

conn.go

+2-18
Original file line numberDiff line numberDiff line change
@@ -1213,29 +1213,13 @@ func (cn *conn) auth(r *readBuf, o values) {
12131213
w := cn.writeBuf('p')
12141214
w.string(o["password"])
12151215
cn.send(w)
1216-
1217-
t, r := cn.recv()
1218-
if t != 'R' {
1219-
errorf("unexpected password response: %q", t)
1220-
}
1221-
1222-
if r.int32() != 0 {
1223-
errorf("unexpected authentication response: %q", t)
1224-
}
1216+
return
12251217
case 5:
12261218
s := string(r.next(4))
12271219
w := cn.writeBuf('p')
12281220
w.string("md5" + md5s(md5s(o["password"]+o["user"])+s))
12291221
cn.send(w)
1230-
1231-
t, r := cn.recv()
1232-
if t != 'R' {
1233-
errorf("unexpected password response: %q", t)
1234-
}
1235-
1236-
if r.int32() != 0 {
1237-
errorf("unexpected authentication response: %q", t)
1238-
}
1222+
return
12391223
case 7: // GSSAPI, startup
12401224
if newGss == nil {
12411225
errorf("kerberos error: no GSSAPI provider registered (import github.com/lib/pq/auth/kerberos if you need Kerberos support)")

0 commit comments

Comments
 (0)