Re: Password encryption method

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Password encryption method
Дата
Msg-id 20070119154149.GA13687@wolff.to
обсуждение исходный текст
Ответ на Password encryption method  (Bertram Scharpf <lists@bertram-scharpf.de>)
Список pgsql-general
On Fri, Jan 19, 2007 at 09:31:49 +0100,
  Bertram Scharpf <lists@bertram-scharpf.de> wrote:
> Hi,
>
> looking at the source code I find out that this works:
>
>   sandbox=# create role joe login password 'verysecret';
>   CREATE ROLE
>   sandbox=# create function validate_user_8_1(text,text) returns boolean immutable language 'sql' as $$ select
'md5'||md5($2||$1)= rolpassword from pg_authid where rolname=$1; $$; 
>   CREATE FUNCTION
>   sandbox=# select validate_user_8_1('joe','verysecret');
>    validate_user_8_1
>   -------------------
>    t
>   (1 Zeile)
>
> May I rely on this in future versions or are there more
> sophisticated ways to do it?

I don't know that I would 'rely' on it, but it doesn't seem like something
that is likely to change any time soon. But I could see there being alternate
hash functions being used eventually.

It might make more sense to use your own table of users and hashed passwords
rather than postgres'. This would depend somewhat on the overlap of users who
are using your application and those who connect directly to the database.
If there isn't much overlap, having a separate table is probably better.

В списке pgsql-general по дате отправления:

Предыдущее
От: Darcy Buskermolen
Дата:
Сообщение: Re: [HACKERS] Autovacuum Improvements
Следующее
От: "Ian Harding"
Дата:
Сообщение: A Picture is Worth