Re: Encrypting pg_shadow passwords - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Encrypting pg_shadow passwords
Date
Msg-id 200106261502.f5QF2F906490@candle.pha.pa.us
Whole thread Raw
In response to Re: Encrypting pg_shadow passwords  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
Responses Re: Re: Encrypting pg_shadow passwords  (michael@miknet.net (Michael Samuel))
List 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@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Encrypting pg_shadow passwords
Next
From: Hannu Krosing
Date:
Subject: Re: 7.2 items