From 6eb9c5a5657d1fe77b55cc261450f3538d35a94d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:19:15 +0200 Subject: Adding upstream version 13.4. Signed-off-by: Daniel Baumann --- src/include/common/saslprep.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/include/common/saslprep.h (limited to 'src/include/common/saslprep.h') diff --git a/src/include/common/saslprep.h b/src/include/common/saslprep.h new file mode 100644 index 0000000..3abf2ac --- /dev/null +++ b/src/include/common/saslprep.h @@ -0,0 +1,30 @@ +/*------------------------------------------------------------------------- + * + * saslprep.h + * SASLprep normalization, for SCRAM authentication + * + * These definitions are used by both frontend and backend code. + * + * Copyright (c) 2017-2020, PostgreSQL Global Development Group + * + * src/include/common/saslprep.h + * + *------------------------------------------------------------------------- + */ +#ifndef SASLPREP_H +#define SASLPREP_H + +/* + * Return codes for pg_saslprep() function. + */ +typedef enum +{ + SASLPREP_SUCCESS = 0, + SASLPREP_OOM = -1, /* out of memory (only in frontend) */ + SASLPREP_INVALID_UTF8 = -2, /* input is not a valid UTF-8 string */ + SASLPREP_PROHIBITED = -3 /* output would contain prohibited characters */ +} pg_saslprep_rc; + +extern pg_saslprep_rc pg_saslprep(const char *input, char **output); + +#endif /* SASLPREP_H */ -- cgit v1.2.3