PostgreSQL Source Code
git master
|
#include "common/cryptohash.h"
#include "lib/stringinfo.h"
#include "libpq/libpq-be.h"
#include "libpq/sasl.h"
Go to the source code of this file.
Functions | |
char * | pg_be_scram_build_secret (const char *password) |
bool | parse_scram_secret (const char *secret, int *iterations, pg_cryptohash_type *hash_type, int *key_length, char **salt, uint8 *stored_key, uint8 *server_key) |
bool | scram_verify_plain_password (const char *username, const char *password, const char *secret) |
Variables | |
PGDLLIMPORT int | scram_sha_256_iterations |
PGDLLIMPORT const pg_be_sasl_mech | pg_be_scram_mech |
bool parse_scram_secret | ( | const char * | secret, |
int * | iterations, | ||
pg_cryptohash_type * | hash_type, | ||
int * | key_length, | ||
char ** | salt, | ||
uint8 * | stored_key, | ||
uint8 * | server_key | ||
) |
Definition at line 589 of file auth-scram.c.
References iterations, palloc(), pg_b64_dec_len(), pg_b64_decode(), PG_SHA256, pstrdup(), SCRAM_SHA_256_KEY_LEN, and strsep().
Referenced by get_password_type(), scram_init(), and scram_verify_plain_password().
char* pg_be_scram_build_secret | ( | const char * | password | ) |
Definition at line 472 of file auth-scram.c.
References ereport, errcode(), errmsg(), ERROR, password, pfree(), pg_saslprep(), PG_SHA256, pg_strong_random(), SASLPREP_SUCCESS, scram_build_secret(), SCRAM_DEFAULT_SALT_LEN, scram_sha_256_iterations, and SCRAM_SHA_256_KEY_LEN.
Referenced by encrypt_password().
bool scram_verify_plain_password | ( | const char * | username, |
const char * | password, | ||
const char * | secret | ||
) |
Definition at line 512 of file auth-scram.c.
References elog, ereport, errmsg(), ERROR, iterations, LOG, palloc(), parse_scram_secret(), password, pfree(), pg_b64_dec_len(), pg_b64_decode(), pg_saslprep(), SASLPREP_SUCCESS, SCRAM_MAX_KEY_LEN, scram_SaltedPassword(), scram_ServerKey(), and username.
Referenced by plain_crypt_verify().
|
extern |
Definition at line 113 of file auth-scram.c.
Referenced by CheckPWChallengeAuth().
|
extern |
Definition at line 192 of file auth-scram.c.
Referenced by pg_be_scram_build_secret().