PostgreSQL Source Code
git master
|
Go to the source code of this file.
Macros | |
#define | SASL_EXCHANGE_CONTINUE 0 |
#define | SASL_EXCHANGE_SUCCESS 1 |
#define | SASL_EXCHANGE_FAILURE 2 |
Functions | |
void | pg_be_scram_get_mechanisms (Port *port, StringInfo buf) |
void * | pg_be_scram_init (Port *port, const char *selected_mech, const char *shadow_pass) |
int | pg_be_scram_exchange (void *opaq, const char *input, int inputlen, char **output, int *outputlen, char **logdetail) |
char * | pg_be_scram_build_secret (const char *password) |
bool | parse_scram_secret (const char *secret, int *iterations, char **salt, uint8 *stored_key, uint8 *server_key) |
bool | scram_verify_plain_password (const char *username, const char *password, const char *secret) |
#define SASL_EXCHANGE_CONTINUE 0 |
Definition at line 20 of file scram.h.
Referenced by CheckSCRAMAuth(), and pg_be_scram_exchange().
#define SASL_EXCHANGE_FAILURE 2 |
Definition at line 22 of file scram.h.
Referenced by pg_be_scram_exchange().
#define SASL_EXCHANGE_SUCCESS 1 |
Definition at line 21 of file scram.h.
Referenced by CheckSCRAMAuth(), and pg_be_scram_exchange().
bool parse_scram_secret | ( | const char * | secret, |
int * | iterations, | ||
char ** | salt, | ||
uint8 * | stored_key, | ||
uint8 * | server_key | ||
) |
Definition at line 560 of file auth-scram.c.
References palloc(), pg_b64_dec_len(), pg_b64_decode(), pstrdup(), and SCRAM_KEY_LEN.
Referenced by get_password_type(), pg_be_scram_init(), and scram_verify_plain_password().
char* pg_be_scram_build_secret | ( | const char * | password | ) |
Definition at line 451 of file auth-scram.c.
References ereport, errcode(), errmsg(), ERROR, pfree(), pg_saslprep(), pg_strong_random(), SASLPREP_SUCCESS, scram_build_secret(), SCRAM_DEFAULT_ITERATIONS, and SCRAM_DEFAULT_SALT_LEN.
Referenced by encrypt_password().
int pg_be_scram_exchange | ( | void * | opaq, |
const char * | input, | ||
int | inputlen, | ||
char ** | output, | ||
int * | outputlen, | ||
char ** | logdetail | ||
) |
Definition at line 328 of file auth-scram.c.
References Assert, build_server_final_message(), build_server_first_message(), scram_state::doomed, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, scram_state::logdetail, pstrdup(), read_client_final_message(), read_client_first_message(), SASL_EXCHANGE_CONTINUE, SASL_EXCHANGE_FAILURE, SASL_EXCHANGE_SUCCESS, SCRAM_AUTH_FINISHED, SCRAM_AUTH_INIT, SCRAM_AUTH_SALT_SENT, scram_state::state, verify_client_proof(), and verify_final_nonce().
Referenced by CheckSCRAMAuth().
void pg_be_scram_get_mechanisms | ( | Port * | port, |
StringInfo | buf | ||
) |
Definition at line 181 of file auth-scram.c.
References appendStringInfoChar(), appendStringInfoString(), SCRAM_SHA_256_NAME, SCRAM_SHA_256_PLUS_NAME, and Port::ssl_in_use.
Referenced by CheckSCRAMAuth().
void* pg_be_scram_init | ( | Port * | port, |
const char * | selected_mech, | ||
const char * | shadow_pass | ||
) |
Definition at line 218 of file auth-scram.c.
References _, scram_state::channel_binding_in_use, scram_state::doomed, ereport, errcode(), errmsg(), ERROR, get_password_type(), scram_state::iterations, LOG, scram_state::logdetail, mock_scram_secret(), palloc0(), parse_scram_secret(), PASSWORD_TYPE_SCRAM_SHA_256, port, scram_state::port, psprintf(), scram_state::salt, SCRAM_AUTH_INIT, SCRAM_SHA_256_NAME, SCRAM_SHA_256_PLUS_NAME, scram_state::ServerKey, Port::ssl_in_use, scram_state::state, scram_state::StoredKey, and Port::user_name.
Referenced by CheckSCRAMAuth().
bool scram_verify_plain_password | ( | const char * | username, |
const char * | password, | ||
const char * | secret | ||
) |
Definition at line 488 of file auth-scram.c.
References elog, ereport, errmsg(), ERROR, LOG, palloc(), parse_scram_secret(), pfree(), pg_b64_dec_len(), pg_b64_decode(), pg_saslprep(), SASLPREP_SUCCESS, SCRAM_KEY_LEN, scram_SaltedPassword(), and scram_ServerKey().
Referenced by plain_crypt_verify().