wxMaxima
Loading...
Searching...
No Matches
saslprep.h
1/*
2** Name: saslprep.h
3** Purpose: SASLprep normalization, for SCRAM authentication
4** Copyright: (c) 2024-2024 Ulrich Telle
5** SPDX-License-Identifier: PostgreSQL
6*/
7
8// SASLprep. Adapted from PostgreSQL.
9
10/*-------------------------------------------------------------------------
11 *
12 * saslprep.h
13 * SASLprep normalization, for SCRAM authentication
14 *
15 * These definitions are used by both frontend and backend code.
16 *
17 * Copyright (c) 2017-2023, PostgreSQL Global Development Group
18 *
19 * src/include/common/saslprep.h
20 *
21 *-------------------------------------------------------------------------
22 */
23
24#pragma once
25#ifndef WXPDFDOC_CRYPTO_SASLPREP_H_
26#define WXPDFDOC_CRYPTO_SASLPREP_H_
27
28#include <string>
29
30namespace wxpdfdoc {
31namespace crypto {
32
33/*
34 * Return codes for saslprep() function.
35 */
36typedef enum
37{
38 SASLPREP_SUCCESS = 0,
39 SASLPREP_OOM = -1, // out of memory (only in frontend)
40 SASLPREP_INVALID_UTF8 = -2, // input is not a valid UTF-8 string
41 SASLPREP_PROHIBITED = -3 // output would contain prohibited characters
42} saslprep_rc;
43
44saslprep_rc saslprep(const std::string& intxt, std::string& outtxt);
45
46} // namespace crypto
47} // namespace wxpdfdoc
48
49#endif // WXPDFDOC_CRYPTO_SASLPREP_H_