@@ -158,7 +158,7 @@ typedef struct
158
158
/* Fields from the last message from client */
159
159
char * client_final_message_without_proof ;
160
160
char * client_final_nonce ;
161
- char ClientProof [SCRAM_MAX_KEY_LEN ];
161
+ uint8 ClientProof [SCRAM_MAX_KEY_LEN ];
162
162
163
163
/* Fields generated in the server */
164
164
char * server_first_message ;
@@ -186,9 +186,9 @@ static void mock_scram_secret(const char *username, pg_cryptohash_type *hash_typ
186
186
static bool is_scram_printable (char * p );
187
187
static char * sanitize_char (char c );
188
188
static char * sanitize_str (const char * s );
189
- static char * scram_mock_salt (const char * username ,
190
- pg_cryptohash_type hash_type ,
191
- int key_length );
189
+ static uint8 * scram_mock_salt (const char * username ,
190
+ pg_cryptohash_type hash_type ,
191
+ int key_length );
192
192
193
193
/*
194
194
* The number of iterations to use when generating new secrets.
@@ -484,7 +484,7 @@ pg_be_scram_build_secret(const char *password)
484
484
{
485
485
char * prep_password ;
486
486
pg_saslprep_rc rc ;
487
- char saltbuf [SCRAM_DEFAULT_SALT_LEN ];
487
+ uint8 saltbuf [SCRAM_DEFAULT_SALT_LEN ];
488
488
char * result ;
489
489
const char * errstr = NULL ;
490
490
@@ -524,7 +524,7 @@ scram_verify_plain_password(const char *username, const char *password,
524
524
const char * secret )
525
525
{
526
526
char * encoded_salt ;
527
- char * salt ;
527
+ uint8 * salt ;
528
528
int saltlen ;
529
529
int iterations ;
530
530
int key_length = 0 ;
@@ -609,9 +609,9 @@ parse_scram_secret(const char *secret, int *iterations,
609
609
char * storedkey_str ;
610
610
char * serverkey_str ;
611
611
int decoded_len ;
612
- char * decoded_salt_buf ;
613
- char * decoded_stored_buf ;
614
- char * decoded_server_buf ;
612
+ uint8 * decoded_salt_buf ;
613
+ uint8 * decoded_stored_buf ;
614
+ uint8 * decoded_server_buf ;
615
615
616
616
/*
617
617
* The secret is of form:
@@ -698,7 +698,7 @@ mock_scram_secret(const char *username, pg_cryptohash_type *hash_type,
698
698
int * iterations , int * key_length , char * * salt ,
699
699
uint8 * stored_key , uint8 * server_key )
700
700
{
701
- char * raw_salt ;
701
+ uint8 * raw_salt ;
702
702
char * encoded_salt ;
703
703
int encoded_len ;
704
704
@@ -1231,7 +1231,7 @@ build_server_first_message(scram_state *state)
1231
1231
* For convenience, however, we don't use the whole range available,
1232
1232
* rather, we generate some random bytes, and base64 encode them.
1233
1233
*/
1234
- char raw_nonce [SCRAM_RAW_NONCE_LEN ];
1234
+ uint8 raw_nonce [SCRAM_RAW_NONCE_LEN ];
1235
1235
int encoded_len ;
1236
1236
1237
1237
if (!pg_strong_random (raw_nonce , SCRAM_RAW_NONCE_LEN ))
@@ -1271,7 +1271,7 @@ read_client_final_message(scram_state *state, const char *input)
1271
1271
char * begin ,
1272
1272
* proof ;
1273
1273
char * p ;
1274
- char * client_proof ;
1274
+ uint8 * client_proof ;
1275
1275
int client_proof_len ;
1276
1276
1277
1277
begin = p = pstrdup (input );
@@ -1340,7 +1340,7 @@ read_client_final_message(scram_state *state, const char *input)
1340
1340
b64_message_len = pg_b64_enc_len (cbind_input_len );
1341
1341
/* don't forget the zero-terminator */
1342
1342
b64_message = palloc (b64_message_len + 1 );
1343
- b64_message_len = pg_b64_encode (cbind_input , cbind_input_len ,
1343
+ b64_message_len = pg_b64_encode (( uint8 * ) cbind_input , cbind_input_len ,
1344
1344
b64_message , b64_message_len );
1345
1345
if (b64_message_len < 0 )
1346
1346
elog (ERROR , "could not encode channel binding data" );
@@ -1440,7 +1440,7 @@ build_server_final_message(scram_state *state)
1440
1440
siglen = pg_b64_enc_len (state -> key_length );
1441
1441
/* don't forget the zero-terminator */
1442
1442
server_signature_base64 = palloc (siglen + 1 );
1443
- siglen = pg_b64_encode (( const char * ) ServerSignature ,
1443
+ siglen = pg_b64_encode (ServerSignature ,
1444
1444
state -> key_length , server_signature_base64 ,
1445
1445
siglen );
1446
1446
if (siglen < 0 )
@@ -1467,7 +1467,7 @@ build_server_final_message(scram_state *state)
1467
1467
* hash based on the username and a cluster-level secret key. Returns a
1468
1468
* pointer to a static buffer of size SCRAM_DEFAULT_SALT_LEN, or NULL.
1469
1469
*/
1470
- static char *
1470
+ static uint8 *
1471
1471
scram_mock_salt (const char * username , pg_cryptohash_type hash_type ,
1472
1472
int key_length )
1473
1473
{
@@ -1501,5 +1501,5 @@ scram_mock_salt(const char *username, pg_cryptohash_type hash_type,
1501
1501
}
1502
1502
pg_cryptohash_free (ctx );
1503
1503
1504
- return ( char * ) sha_digest ;
1504
+ return sha_digest ;
1505
1505
}
0 commit comments