]> granicus.if.org Git - postgresql/commit
Clean up password authentication code a bit.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 8 Dec 2016 11:44:47 +0000 (13:44 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 8 Dec 2016 11:44:47 +0000 (13:44 +0200)
commitfe7bdf0bf67d8ac360d67fa9740074a2c70e88a4
treeb0463aaf3839ff828407632d31c87aadd826461c
parentf7d54f4f7ddf72bf4db1783890b058e758b4b894
Clean up password authentication code a bit.

Commit fe0a0b59, which moved code to do MD5 authentication to a separate
CheckMD5Auth() function, left behind a comment that really belongs inside
the function, too. Also move the check for db_user_namespace inside the
function, seems clearer that way.

Now that the md5 salt is passed as argument to md5_crypt_verify, it's a bit
silly that it peeks into the Port struct to see if MD5 authentication was
used. Seems more straightforward to treat it as an MD5 authentication, if
the md5 salt argument is given. And after that, md5_crypt_verify only used
the Port argument to look at port->user_name, but that is redundant,
because it is also passed as a separate 'role' argument. So remove the Port
argument altogether.
src/backend/libpq/auth.c
src/backend/libpq/crypt.c
src/include/libpq/crypt.h