gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.3KB

  1. /*-------------------------------------------------------------------------
  2. *
  3. * scram.h
  4. * Interface to libpq/scram.c
  5. *
  6. * Portions Copyright (c) 1996-2019, 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. /* Status codes for message exchange */
  18. #define SASL_EXCHANGE_CONTINUE 0
  19. #define SASL_EXCHANGE_SUCCESS 1
  20. #define SASL_EXCHANGE_FAILURE 2
  21. /* Routines dedicated to authentication */
  22. extern void pg_be_scram_get_mechanisms(Port *port, StringInfo buf);
  23. extern void *pg_be_scram_init(Port *port, const char *selected_mech, const char *shadow_pass);
  24. extern int pg_be_scram_exchange(void *opaq, const char *input, int inputlen,
  25. char **output, int *outputlen, char **logdetail);
  26. /* Routines to handle and check SCRAM-SHA-256 verifier */
  27. extern char *pg_be_scram_build_verifier(const char *password);
  28. extern bool parse_scram_verifier(const char *verifier, int *iterations, char **salt,
  29. uint8 *stored_key, uint8 *server_key);
  30. extern bool scram_verify_plain_password(const char *username,
  31. const char *password, const char *verifier);
  32. #endif /* PG_SCRAM_H */
上海开阖软件有限公司 沪ICP备12045867号-1