mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	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.
			
			
This commit is contained in:
		@@ -13,9 +13,9 @@
 | 
			
		||||
#ifndef PG_CRYPT_H
 | 
			
		||||
#define PG_CRYPT_H
 | 
			
		||||
 | 
			
		||||
#include "libpq/libpq-be.h"
 | 
			
		||||
#include "datatype/timestamp.h"
 | 
			
		||||
 | 
			
		||||
extern int md5_crypt_verify(const Port *port, const char *role,
 | 
			
		||||
				 char *client_pass, char *md5_salt, int md5_salt_len, char **logdetail);
 | 
			
		||||
extern int md5_crypt_verify(const char *role, char *client_pass,
 | 
			
		||||
				 char *md5_salt, int md5_salt_len, char **logdetail);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user