@@ -158,7 +158,7 @@ typedef struct
158158/* Fields from the last message from client */
159159char * client_final_message_without_proof ;
160160char * client_final_nonce ;
161- char ClientProof [SCRAM_MAX_KEY_LEN ];
161+ uint8 ClientProof [SCRAM_MAX_KEY_LEN ];
162162
163163/* Fields generated in the server */
164164char * server_first_message ;
@@ -186,9 +186,9 @@ static void mock_scram_secret(const char *username, pg_cryptohash_type *hash_typ
186186static bool is_scram_printable (char * p );
187187static char * sanitize_char (char c );
188188static 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 );
192192
193193/*
194194 * The number of iterations to use when generating new secrets.
@@ -484,7 +484,7 @@ pg_be_scram_build_secret(const char *password)
484484{
485485char * prep_password ;
486486pg_saslprep_rc rc ;
487- char saltbuf [SCRAM_DEFAULT_SALT_LEN ];
487+ uint8 saltbuf [SCRAM_DEFAULT_SALT_LEN ];
488488char * result ;
489489const char * errstr = NULL ;
490490
@@ -524,7 +524,7 @@ scram_verify_plain_password(const char *username, const char *password,
524524const char * secret )
525525{
526526char * encoded_salt ;
527- char * salt ;
527+ uint8 * salt ;
528528int saltlen ;
529529int iterations ;
530530int key_length = 0 ;
@@ -609,9 +609,9 @@ parse_scram_secret(const char *secret, int *iterations,
609609char * storedkey_str ;
610610char * serverkey_str ;
611611int 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 ;
615615
616616/*
617617 * The secret is of form:
@@ -698,7 +698,7 @@ mock_scram_secret(const char *username, pg_cryptohash_type *hash_type,
698698int * iterations ,int * key_length ,char * * salt ,
699699uint8 * stored_key ,uint8 * server_key )
700700{
701- char * raw_salt ;
701+ uint8 * raw_salt ;
702702char * encoded_salt ;
703703int encoded_len ;
704704
@@ -1231,7 +1231,7 @@ build_server_first_message(scram_state *state)
12311231 * For convenience, however, we don't use the whole range available,
12321232 * rather, we generate some random bytes, and base64 encode them.
12331233 */
1234- char raw_nonce [SCRAM_RAW_NONCE_LEN ];
1234+ uint8 raw_nonce [SCRAM_RAW_NONCE_LEN ];
12351235int encoded_len ;
12361236
12371237if (!pg_strong_random (raw_nonce ,SCRAM_RAW_NONCE_LEN ))
@@ -1271,7 +1271,7 @@ read_client_final_message(scram_state *state, const char *input)
12711271char * begin ,
12721272* proof ;
12731273char * p ;
1274- char * client_proof ;
1274+ uint8 * client_proof ;
12751275int client_proof_len ;
12761276
12771277begin = p = pstrdup (input );
@@ -1340,7 +1340,7 @@ read_client_final_message(scram_state *state, const char *input)
13401340b64_message_len = pg_b64_enc_len (cbind_input_len );
13411341/* don't forget the zero-terminator */
13421342b64_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 ,
13441344b64_message ,b64_message_len );
13451345if (b64_message_len < 0 )
13461346elog (ERROR ,"could not encode channel binding data" );
@@ -1440,7 +1440,7 @@ build_server_final_message(scram_state *state)
14401440siglen = pg_b64_enc_len (state -> key_length );
14411441/* don't forget the zero-terminator */
14421442server_signature_base64 = palloc (siglen + 1 );
1443- siglen = pg_b64_encode (( const char * ) ServerSignature ,
1443+ siglen = pg_b64_encode (ServerSignature ,
14441444state -> key_length ,server_signature_base64 ,
14451445siglen );
14461446if (siglen < 0 )
@@ -1467,7 +1467,7 @@ build_server_final_message(scram_state *state)
14671467 * hash based on the username and a cluster-level secret key. Returns a
14681468 * pointer to a static buffer of size SCRAM_DEFAULT_SALT_LEN, or NULL.
14691469 */
1470- static char *
1470+ static uint8 *
14711471scram_mock_salt (const char * username ,pg_cryptohash_type hash_type ,
14721472int key_length )
14731473{
@@ -1501,5 +1501,5 @@ scram_mock_salt(const char *username, pg_cryptohash_type hash_type,
15011501}
15021502pg_cryptohash_free (ctx );
15031503
1504- return ( char * ) sha_digest ;
1504+ return sha_digest ;
15051505}