PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "common/base64.h"
#include "common/hmac.h"
#include "common/scram-common.h"
#include "miscadmin.h"
#include "port/pg_bswap.h"
Go to the source code of this file.
Functions | |
int | scram_SaltedPassword (const char *password, pg_cryptohash_type hash_type, int key_length, const char *salt, int saltlen, int iterations, uint8 *result, const char **errstr) |
int | scram_H (const uint8 *input, pg_cryptohash_type hash_type, int key_length, uint8 *result, const char **errstr) |
int | scram_ClientKey (const uint8 *salted_password, pg_cryptohash_type hash_type, int key_length, uint8 *result, const char **errstr) |
int | scram_ServerKey (const uint8 *salted_password, pg_cryptohash_type hash_type, int key_length, uint8 *result, const char **errstr) |
char * | scram_build_secret (pg_cryptohash_type hash_type, int key_length, const char *salt, int saltlen, int iterations, const char *password, const char **errstr) |
char* scram_build_secret | ( | pg_cryptohash_type | hash_type, |
int | key_length, | ||
const char * | salt, | ||
int | saltlen, | ||
int | iterations, | ||
const char * | password, | ||
const char ** | errstr | ||
) |
Definition at line 210 of file scram-common.c.
References _, Assert, elog, ERROR, free, iterations, malloc, palloc(), password, pg_b64_enc_len(), pg_b64_encode(), PG_SHA256, scram_ClientKey(), scram_H(), SCRAM_MAX_KEY_LEN, scram_SaltedPassword(), scram_ServerKey(), and sprintf.
Referenced by pg_be_scram_build_secret(), and pg_fe_scram_build_secret().
int scram_ClientKey | ( | const uint8 * | salted_password, |
pg_cryptohash_type | hash_type, | ||
int | key_length, | ||
uint8 * | result, | ||
const char ** | errstr | ||
) |
Definition at line 142 of file scram-common.c.
References pg_hmac_create(), pg_hmac_error(), pg_hmac_final(), pg_hmac_free(), pg_hmac_init(), and pg_hmac_update().
Referenced by calculate_client_proof(), and scram_build_secret().
int scram_H | ( | const uint8 * | input, |
pg_cryptohash_type | hash_type, | ||
int | key_length, | ||
uint8 * | result, | ||
const char ** | errstr | ||
) |
Definition at line 112 of file scram-common.c.
References input, pg_cryptohash_create(), pg_cryptohash_error(), pg_cryptohash_final(), pg_cryptohash_free(), pg_cryptohash_init(), and pg_cryptohash_update().
Referenced by calculate_client_proof(), scram_build_secret(), and verify_client_proof().
int scram_SaltedPassword | ( | const char * | password, |
pg_cryptohash_type | hash_type, | ||
int | key_length, | ||
const char * | salt, | ||
int | saltlen, | ||
int | iterations, | ||
uint8 * | result, | ||
const char ** | errstr | ||
) |
Definition at line 38 of file scram-common.c.
References CHECK_FOR_INTERRUPTS, i, iterations, j, password, pg_hmac_create(), pg_hmac_error(), pg_hmac_final(), pg_hmac_free(), pg_hmac_init(), pg_hmac_update(), pg_hton32, and SCRAM_MAX_KEY_LEN.
Referenced by calculate_client_proof(), scram_build_secret(), and scram_verify_plain_password().
int scram_ServerKey | ( | const uint8 * | salted_password, |
pg_cryptohash_type | hash_type, | ||
int | key_length, | ||
uint8 * | result, | ||
const char ** | errstr | ||
) |
Definition at line 172 of file scram-common.c.
References pg_hmac_create(), pg_hmac_error(), pg_hmac_final(), pg_hmac_free(), pg_hmac_init(), and pg_hmac_update().
Referenced by scram_build_secret(), scram_verify_plain_password(), and verify_server_signature().