PostgreSQL Source Code  git master
scram.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * scram.h
4  * Interface to libpq/scram.c
5  *
6  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/libpq/scram.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef PG_SCRAM_H
14 #define PG_SCRAM_H
15 
16 #include "lib/stringinfo.h"
17 #include "libpq/libpq-be.h"
18 #include "libpq/sasl.h"
19 
20 /* SASL implementation callbacks */
22 
23 /* Routines to handle and check SCRAM-SHA-256 secret */
24 extern char *pg_be_scram_build_secret(const char *password);
25 extern bool parse_scram_secret(const char *secret, int *iterations, char **salt,
26  uint8 *stored_key, uint8 *server_key);
27 extern bool scram_verify_plain_password(const char *username,
28  const char *password, const char *secret);
29 
30 #endif /* PG_SCRAM_H */
bool scram_verify_plain_password(const char *username, const char *password, const char *secret)
Definition: auth-scram.c:498
unsigned char uint8
Definition: c.h:439
static char * password
Definition: streamutil.c:53
const char * username
Definition: pgbench.c:282
char * pg_be_scram_build_secret(const char *password)
Definition: auth-scram.c:461
const pg_be_sasl_mech pg_be_scram_mech
Definition: auth-scram.c:117
bool parse_scram_secret(const char *secret, int *iterations, char **salt, uint8 *stored_key, uint8 *server_key)
Definition: auth-scram.c:570