mirror of
https://github.com/postgres/postgres.git
synced 2025-12-15 02:22:24 +03:00
Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays
A 'void *' argument suggests that the caller might pass an arbitrary struct, which is appropriate for functions like libc's read/write, or pq_sendbytes(). 'uint8 *' is more appropriate for byte arrays that have no structure, like the cancellation keys or SCRAM tokens. Some places used 'char *', but 'uint8 *' is better because 'char *' is commonly used for null-terminated strings. Change code around SCRAM, MD5 authentication, and cancellation key handling to follow these conventions. Discussion: https://www.postgresql.org/message-id/61be9e31-7b7d-49d5-bc11-721800d89d64@eisentraut.org
This commit is contained in:
@@ -666,7 +666,7 @@ ClientAuthentication(Port *port)
|
||||
* Send an authentication request packet to the frontend.
|
||||
*/
|
||||
void
|
||||
sendAuthRequest(Port *port, AuthRequest areq, const char *extradata, int extralen)
|
||||
sendAuthRequest(Port *port, AuthRequest areq, const void *extradata, int extralen)
|
||||
{
|
||||
StringInfoData buf;
|
||||
|
||||
@@ -874,7 +874,7 @@ CheckPWChallengeAuth(Port *port, const char **logdetail)
|
||||
static int
|
||||
CheckMD5Auth(Port *port, char *shadow_pass, const char **logdetail)
|
||||
{
|
||||
char md5Salt[4]; /* Password salt */
|
||||
uint8 md5Salt[4]; /* Password salt */
|
||||
char *passwd;
|
||||
int result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user