scram.h 994 B

123456789101112131415161718192021222324252627282930
  1. /*-------------------------------------------------------------------------
  2. *
  3. * scram.h
  4. * Interface to libpq/scram.c
  5. *
  6. * Portions Copyright (c) 1996-2022, 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. #include "lib/stringinfo.h"
  16. #include "libpq/libpq-be.h"
  17. #include "libpq/sasl.h"
  18. /* SASL implementation callbacks */
  19. extern PGDLLIMPORT const pg_be_sasl_mech pg_be_scram_mech;
  20. /* Routines to handle and check SCRAM-SHA-256 secret */
  21. extern char *pg_be_scram_build_secret(const char *password);
  22. extern bool parse_scram_secret(const char *secret, int *iterations, char **salt,
  23. uint8 *stored_key, uint8 *server_key);
  24. extern bool scram_verify_plain_password(const char *username,
  25. const char *password, const char *secret);
  26. #endif /* PG_SCRAM_H */