pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Paul Hart <paulhart@io.com>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Password authentication failure
Date: Tue, 05 Jun 2001 16:08:46 -0400
Message-ID: <20430.991771726@sss.pgh.pa.us> (raw)
In-Reply-To: <PMEGKOAGJFDHONNBPEHIIEDFCHAA.paulhart@io.com>
References: <PMEGKOAGJFDHONNBPEHIIEDFCHAA.paulhart@io.com>

"Paul Hart" <paulhart@io.com> writes:
> However, based on that, I would guess that the crypt() problem isn't it.
> As for the postmaster log file, there is nothing special in there:
> verify_password: password mismatch for 'XXXX'.

No, that tells us quite a lot: checking in the source code for that
message, I can see that the backend has received your username and
password, and has found the username in an external password file,
and has attempted to match your password against what was in the
password file.  And that match didn't work.  I think that crypt()
is exactly where your problem is.  Did you build the external
password file with pg_passwd, or manually?

> Uhm... would that then mean that if I was on an OpenBSD machine as a
> client (i.e. just running psql), I would be unable (at least without
> massaging some code) to access a postgres instance on, say, a Solaris
> box? That sounds *very* fishy to me.

If you use the crypt auth method (crypt on client side and send
that across the wire) then yes, the crypt algorithms offered by
client and server C libraries had better match.  However, AFAICT
you are not doing that.  In the regular passwd method what we are
assuming is that the crypt library routine linked into the
postmaster is the same one linked into pg_passwd, or whatever
program you use to maintain the flat password file.  Since these
are on the same machine it's not such a big assumption.

> Any chance we can have a standardized hashing function built into the
> code?

Are you volunteering?  There have been a couple of long discussions
on pghackers about a better password challenge protocol.  IIRC we
came up with a good-looking paper design, but there was a notable
lack of effort on actually making it happen.

			regards, tom lane



view thread (9+ messages)  latest in thread

Message-ID: <20430.991771726@sss.pgh.pa.us>
Permalink:  ../20430.991771726@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20430.991771726@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, paulhart@io.com, peter_e@gmx.net
  Subject: Re: Password authentication failure
  In-Reply-To: <20430.991771726@sss.pgh.pa.us>
  References: <PMEGKOAGJFDHONNBPEHIIEDFCHAA.paulhart@io.com> <20430.991771726@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox