Re: Re: Proposal for encrypting pg_shadow passwords - Mailing list pgsql-patches

From Tom Lane
Subject Re: Re: Proposal for encrypting pg_shadow passwords
Date
Msg-id 10264.997981287@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: Proposal for encrypting pg_shadow passwords  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Can someone look at our use of port->salt in the code.  The call to
> crypt() assumes port->salt is null-terminated, doesn't it.

I have not looked at the new patch, but the EncryptMD5 routine at the
bottom of the original patch's md5.c definitely does think that the
salt is null-terminated.  It'd be a trivial change to pass the salt
as buffer pointer and length, however, avoiding any assumptions about
nullness.

BTW, it occurs to me that the day may come when a 4-byte salt space
looks too small too.  Perhaps we should define the MD5 protocol as using
an 8-binary-byte salt.  For the moment, you'd fill it with two calls to
random(), which'd not add any more security than using only one call;
but if we ever need a bigger salt space, we don't have to change the
protocol and clients to do it.

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: Proposal for encrypting pg_shadow passwords
Next
From: Bruce Momjian
Date:
Subject: Re: Re: Proposal for encrypting pg_shadow passwords