47
47
*/
48
48
static void sendAuthRequest (Port * port , AuthRequest areq , const char * extradata ,
49
49
int extralen );
50
- static void auth_failed (Port * port , int status , const char * logdetail );
50
+ static void auth_failed (Port * port , int status , char * logdetail );
51
51
static char * recv_password_packet (Port * port );
52
52
static void set_authn_id (Port * port , const char * id );
53
53
@@ -56,11 +56,11 @@ static void set_authn_id(Port *port, const char *id);
56
56
* Password-based authentication methods (password, md5, and scram-sha-256)
57
57
*----------------------------------------------------------------
58
58
*/
59
- static int CheckPasswordAuth (Port * port , const char * * logdetail );
60
- static int CheckPWChallengeAuth (Port * port , const char * * logdetail );
59
+ static int CheckPasswordAuth (Port * port , char * * logdetail );
60
+ static int CheckPWChallengeAuth (Port * port , char * * logdetail );
61
61
62
- static int CheckMD5Auth (Port * port , char * shadow_pass , const char * * logdetail );
63
- static int CheckSCRAMAuth (Port * port , char * shadow_pass , const char * * logdetail );
62
+ static int CheckMD5Auth (Port * port , char * shadow_pass , char * * logdetail );
63
+ static int CheckSCRAMAuth (Port * port , char * shadow_pass , char * * logdetail );
64
64
65
65
66
66
/*----------------------------------------------------------------
@@ -258,7 +258,7 @@ ClientAuthentication_hook_type ClientAuthentication_hook = NULL;
258
258
* particular, if logdetail isn't NULL, we send that string to the log.
259
259
*/
260
260
static void
261
- auth_failed (Port * port , int status , const char * logdetail )
261
+ auth_failed (Port * port , int status , char * logdetail )
262
262
{
263
263
const char * errstr ;
264
264
char * cdetail ;
394
394
ClientAuthentication (Port * port )
395
395
{
396
396
int status = STATUS_ERROR ;
397
- const char * logdetail = NULL ;
397
+ char * logdetail = NULL ;
398
398
399
399
/*
400
400
* Get the authentication method to use for this frontend/database
@@ -780,7 +780,7 @@ recv_password_packet(Port *port)
780
780
* Plaintext password authentication.
781
781
*/
782
782
static int
783
- CheckPasswordAuth (Port * port , const char * * logdetail )
783
+ CheckPasswordAuth (Port * port , char * * logdetail )
784
784
{
785
785
char * passwd ;
786
786
int result ;
@@ -815,7 +815,7 @@ CheckPasswordAuth(Port *port, const char **logdetail)
815
815
* MD5 and SCRAM authentication.
816
816
*/
817
817
static int
818
- CheckPWChallengeAuth (Port * port , const char * * logdetail )
818
+ CheckPWChallengeAuth (Port * port , char * * logdetail )
819
819
{
820
820
int auth_result ;
821
821
char * shadow_pass ;
@@ -875,7 +875,7 @@ CheckPWChallengeAuth(Port *port, const char **logdetail)
875
875
}
876
876
877
877
static int
878
- CheckMD5Auth (Port * port , char * shadow_pass , const char * * logdetail )
878
+ CheckMD5Auth (Port * port , char * shadow_pass , char * * logdetail )
879
879
{
880
880
char md5Salt [4 ]; /* Password salt */
881
881
char * passwd ;
@@ -912,7 +912,7 @@ CheckMD5Auth(Port *port, char *shadow_pass, const char **logdetail)
912
912
}
913
913
914
914
static int
915
- CheckSCRAMAuth (Port * port , char * shadow_pass , const char * * logdetail )
915
+ CheckSCRAMAuth (Port * port , char * shadow_pass , char * * logdetail )
916
916
{
917
917
StringInfoData sasl_mechs ;
918
918
int mtype ;
@@ -3240,8 +3240,6 @@ PerformRadiusTransaction(const char *server, const char *secret, const char *por
3240
3240
md5trailer = packet -> vector ;
3241
3241
for (i = 0 ; i < encryptedpasswordlen ; i += RADIUS_VECTOR_LENGTH )
3242
3242
{
3243
- const char * errstr = NULL ;
3244
-
3245
3243
memcpy (cryptvector + strlen (secret ), md5trailer , RADIUS_VECTOR_LENGTH );
3246
3244
3247
3245
/*
@@ -3250,12 +3248,10 @@ PerformRadiusTransaction(const char *server, const char *secret, const char *por
3250
3248
*/
3251
3249
md5trailer = encryptedpassword + i ;
3252
3250
3253
- if (!pg_md5_binary (cryptvector , strlen (secret ) + RADIUS_VECTOR_LENGTH ,
3254
- encryptedpassword + i , & errstr ))
3251
+ if (!pg_md5_binary (cryptvector , strlen (secret ) + RADIUS_VECTOR_LENGTH , encryptedpassword + i ))
3255
3252
{
3256
3253
ereport (LOG ,
3257
- (errmsg ("could not perform MD5 encryption of password: %s" ,
3258
- errstr )));
3254
+ (errmsg ("could not perform MD5 encryption of password" )));
3259
3255
pfree (cryptvector );
3260
3256
pg_freeaddrinfo_all (hint .ai_family , serveraddrs );
3261
3257
return STATUS_ERROR ;
@@ -3340,7 +3336,6 @@ PerformRadiusTransaction(const char *server, const char *secret, const char *por
3340
3336
struct timeval timeout ;
3341
3337
struct timeval now ;
3342
3338
int64 timeoutval ;
3343
- const char * errstr = NULL ;
3344
3339
3345
3340
gettimeofday (& now , NULL );
3346
3341
timeoutval = (endtime .tv_sec * 1000000 + endtime .tv_usec ) - (now .tv_sec * 1000000 + now .tv_usec );
@@ -3459,11 +3454,10 @@ PerformRadiusTransaction(const char *server, const char *secret, const char *por
3459
3454
3460
3455
if (!pg_md5_binary (cryptvector ,
3461
3456
packetlength + strlen (secret ),
3462
- encryptedpassword , & errstr ))
3457
+ encryptedpassword ))
3463
3458
{
3464
3459
ereport (LOG ,
3465
- (errmsg ("could not perform MD5 encryption of received packet: %s" ,
3466
- errstr )));
3460
+ (errmsg ("could not perform MD5 encryption of received packet" )));
3467
3461
pfree (cryptvector );
3468
3462
continue ;
3469
3463
}
0 commit comments