summaryrefslogtreecommitdiffstats
path: root/src/include/common/saslprep.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:17:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:17:33 +0000
commit5e45211a64149b3c659b90ff2de6fa982a5a93ed (patch)
tree739caf8c461053357daa9f162bef34516c7bf452 /src/include/common/saslprep.h
parentInitial commit. (diff)
downloadpostgresql-15-5e45211a64149b3c659b90ff2de6fa982a5a93ed.tar.xz
postgresql-15-5e45211a64149b3c659b90ff2de6fa982a5a93ed.zip
Adding upstream version 15.5.upstream/15.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/include/common/saslprep.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/include/common/saslprep.h b/src/include/common/saslprep.h
new file mode 100644
index 0000000..305c8f4
--- /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-2022, 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 */