2
0

saslprep.h 853 B

123456789101112131415161718192021222324252627282930
  1. /*-------------------------------------------------------------------------
  2. *
  3. * saslprep.h
  4. * SASLprep normalization, for SCRAM authentication
  5. *
  6. * These definitions are used by both frontend and backend code.
  7. *
  8. * Copyright (c) 2017-2022, PostgreSQL Global Development Group
  9. *
  10. * src/include/common/saslprep.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef SASLPREP_H
  15. #define SASLPREP_H
  16. /*
  17. * Return codes for pg_saslprep() function.
  18. */
  19. typedef enum
  20. {
  21. SASLPREP_SUCCESS = 0,
  22. SASLPREP_OOM = -1, /* out of memory (only in frontend) */
  23. SASLPREP_INVALID_UTF8 = -2, /* input is not a valid UTF-8 string */
  24. SASLPREP_PROHIBITED = -3 /* output would contain prohibited characters */
  25. } pg_saslprep_rc;
  26. extern pg_saslprep_rc pg_saslprep(const char *input, char **output);
  27. #endif /* SASLPREP_H */