Unix Technical Forum

Re: [pgadmin-hackers] Client-side password encryption

This is a discussion on Re: [pgadmin-hackers] Client-side password encryption within the pgsql Hackers forums, part of the PostgreSQL category; --> > -----Original Message----- > From: Tom Lane [mailto:tgl@sss.pgh.pa.us] > Sent: 19 December 2005 05:37 > To: Christopher Kings-Lynne > ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 08:23 AM
Dave Page
 
Posts: n/a
Default Re: [pgadmin-hackers] Client-side password encryption



> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: 19 December 2005 05:37
> To: Christopher Kings-Lynne
> Cc: Peter Eisentraut; pgsql-hackers@postgresql.org; Andreas
> Pflug; Dave Page
> Subject: Re: [HACKERS] [pgadmin-hackers] Client-side password
> encryption
>
> Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> >> So it appears that pg_md5_encrypt is not officially

> exported from libpq.
> >> Does anyone see a problem with adding it to the export

> list and the
> >> header file?

>
> > Is it different to normal md5? How is this helpful to the

> phpPgAdmin
> > project?

>
> It would be better to export an API that is (a) less random (why one
> input null-terminated and the other not?) and (b) less tightly tied
> to MD5 --- the fact that the caller knows how long the result must be
> is the main problem here.
>
> Something like
> char *pg_gen_encrypted_passwd(const char *passwd, const
> char *user)
> with malloc'd result (or NULL on failure) seems more future-proof.


Changing the API is likely to cause fun on Windows for new apps that
find an old libpq.dll. Perhaps at this point it should become
libpq82.dll?

Regards, Dave.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-11-2008, 08:23 AM
Martijn van Oosterhout
 
Posts: n/a
Default Re: [pgadmin-hackers] Client-side password encryption

On Mon, Dec 19, 2005 at 08:51:23AM -0000, Dave Page wrote:
> > Something like
> > char *pg_gen_encrypted_passwd(const char *passwd, const
> > char *user)
> > with malloc'd result (or NULL on failure) seems more future-proof.

>
> Changing the API is likely to cause fun on Windows for new apps that
> find an old libpq.dll. Perhaps at this point it should become
> libpq82.dll?


Hmm? Libpq already has a version number, I beleive it's upto 4.1 right
now. So if any number is used, it should be that. And secondly, there
have already been new functions added to the API without changing the
library name so why should that happen here?

In windows the trend seems to be to upgrade a library if the one on the
system is too old. If programs are really worried about it, they should
lookup the function dynamically rather than statically...

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFDpnZKIB7bNG8LQkwRAmrbAJ9vZuYLbTx/QEvQHBGFAhUY/jamVACfRd8A
UfUR0PeFBklLuxuPiEB+O1c=
=AAxf
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-11-2008, 08:24 AM
Christopher Kings-Lynne
 
Posts: n/a
Default Re: [pgadmin-hackers] Client-side password encryption

By the way,

I've already implemented this in phpPgAdmin trivially using the md5()
function. I can't be bothered using a C library function

Chris

Dave Page wrote:
>
>
>
>>-----Original Message-----
>>From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
>>Sent: 19 December 2005 05:37
>>To: Christopher Kings-Lynne
>>Cc: Peter Eisentraut; pgsql-hackers@postgresql.org; Andreas
>>Pflug; Dave Page
>>Subject: Re: [HACKERS] [pgadmin-hackers] Client-side password
>>encryption
>>
>>Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
>>
>>>>So it appears that pg_md5_encrypt is not officially

>>
>>exported from libpq.
>>
>>>>Does anyone see a problem with adding it to the export

>>
>>list and the
>>
>>>>header file?

>>
>>>Is it different to normal md5? How is this helpful to the

>>
>>phpPgAdmin
>>
>>>project?

>>
>>It would be better to export an API that is (a) less random (why one
>>input null-terminated and the other not?) and (b) less tightly tied
>>to MD5 --- the fact that the caller knows how long the result must be
>>is the main problem here.
>>
>>Something like
>> char *pg_gen_encrypted_passwd(const char *passwd, const
>>char *user)
>>with malloc'd result (or NULL on failure) seems more future-proof.

>
>
> Changing the API is likely to cause fun on Windows for new apps that
> find an old libpq.dll. Perhaps at this point it should become
> libpq82.dll?
>
> Regards, Dave.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-11-2008, 08:25 AM
Christopher Kings-Lynne
 
Posts: n/a
Default Re: [pgadmin-hackers] Client-side password encryption

> IIRC the whole point of this exercise was to avoid passing the password
> to the server in the first place. Unless you are talking about a PHP
> md5() password of course ...
>




---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:26 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com