codekingpro/portable-devtools
114k
1/*-------------------------------------------------------------------------2 *3 * scram.h4 * Interface to libpq/scram.c5 *6 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group7 * Portions Copyright (c) 1994, Regents of the University of California8 *9 * src/include/libpq/scram.h10 *11 *-------------------------------------------------------------------------12 */13#ifndef PG_SCRAM_H14#define PG_SCRAM_H15 16#include "common/cryptohash.h"17#include "lib/stringinfo.h"18#include "libpq/libpq-be.h"19#include "libpq/sasl.h"20 21/* Number of iterations when generating new secrets */22extern PGDLLIMPORT int scram_sha_256_iterations;23 24/* SASL implementation callbacks */25extern PGDLLIMPORT const pg_be_sasl_mech pg_be_scram_mech;26 27/* Routines to handle and check SCRAM-SHA-256 secret */28extern char *pg_be_scram_build_secret(const char *password);29extern bool parse_scram_secret(const char *secret,30 int *iterations,31 pg_cryptohash_type *hash_type,32 int *key_length, char **salt,33 uint8 *stored_key, uint8 *server_key);34extern bool scram_verify_plain_password(const char *username,35 const char *password, const char *secret);36 37#endif /* PG_SCRAM_H */38 