Re: Encrypting pg_shadow passwords

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
Cc: Jim Mercer <jim(at)reptiles(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Encrypting pg_shadow passwords
Date: 2001-06-26 15:02:15
Message-ID: 200106261502.f5QF2F906490@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> At 12:51 AM 26-06-2001 -0400, Jim Mercer wrote:
>
> >my mods are server-side only.
> >
> >to rewind a bit.
> >
> >my mods correct this by doing:
> >
> >with an AUTH_ARGUMENT == "pg_shadow", the process is:
> >tmp_pwd = crypt(client->passwd, pg_shadow->passwd)
> >if strcmp(tmp_pwd, pg_shadow->passwd) == 0
> > access allowed
> >else
> > access not allowed
> >
> >this is not so much an enhancement, but a correction of what i think the
> >original "password" authentication scheme was supposed to allow.
> >
>
> Yep it's a correction. pg_shadow shouldn't have been in plaintext in the
> first place.
>
> host all 127.0.0.1 255.255.255.255 password
> should have meant check crypted passwords in pg_shadow.

The issue is that when we store users in pg_shadow we don't know what
kind of authentication is going to be used in pg_hba.conf, and in the
old days if we stored it encrypted we couldn't use random salt in
'crypt' authentication.

This is the first time I am hearing people are more concerned about
pg_shadow security than the wire security. I can see cases where people
are on secure networks or are using only local users where having
pg_shadow encrypted is more important than crypt authentication.
Fortunately the new system will solve both problems.

> Given your suggestion, what happens when someone does an ALTER USER ...
> WITH PASSWORD ....?

It stores it encrypted in pg_shadow.

> Might it be too late to do a fix?
>
> HMAC sounds interesting. What would the impact be on stuff like Pg DBD?

No idea.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-06-26 15:03:38 Re: Encrypting pg_shadow passwords
Previous Message Frank Ch. Eigler 2001-06-26 14:30:43 Re: Encrypting pg_shadow passwords