From ca66dd0c9e3f481656350c50eb70236e21fd2422 Mon Sep 17 00:00:00 2001 From: "yoshihiko.ueno" Date: Mon, 28 Apr 2025 23:19:03 +0900 Subject: [PATCH] Remove assumption that the auth response is AuthenticateOk --- conn.go | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/conn.go b/conn.go index 1d9e4a22..b3d56c16 100644 --- a/conn.go +++ b/conn.go @@ -1213,29 +1213,13 @@ func (cn *conn) auth(r *readBuf, o values) { w := cn.writeBuf('p') w.string(o["password"]) cn.send(w) - - t, r := cn.recv() - if t != 'R' { - errorf("unexpected password response: %q", t) - } - - if r.int32() != 0 { - errorf("unexpected authentication response: %q", t) - } + return case 5: s := string(r.next(4)) w := cn.writeBuf('p') w.string("md5" + md5s(md5s(o["password"]+o["user"])+s)) cn.send(w) - - t, r := cn.recv() - if t != 'R' { - errorf("unexpected password response: %q", t) - } - - if r.int32() != 0 { - errorf("unexpected authentication response: %q", t) - } + return case 7: // GSSAPI, startup if newGss == nil { errorf("kerberos error: no GSSAPI provider registered (import github.com/lib/pq/auth/kerberos if you need Kerberos support)")