2 * Copyright 2022 Hans Leidekker for CodeWeavers
4 * Minimal compatible sasl.h header
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #define SASL_VERSION_MAJOR 2
25 #define SASL_VERSION_MINOR 1
27 #define SASL_CONTINUE 1
28 #define SASL_INTERACT 2
32 #define SASL_BUFOVER -3
33 #define SASL_NOMECH -4
34 #define SASL_BADPROT -5
35 #define SASL_NOTDONE -6
36 #define SASL_BADPARAM -7
37 #define SASL_TRYAGAIN -8
38 #define SASL_BADMAC -9
39 #define SASL_BADSERV -10
40 #define SASL_WRONGMECH -11
41 #define SASL_NOTINIT -12
42 #define SASL_BADAUTH -13
43 #define SASL_NOAUTHZ -14
44 #define SASL_TOOWEAK -15
45 #define SASL_ENCRYPT -16
47 typedef unsigned int sasl_ssf_t
;
49 #define SASL_SEC_NOPLAINTEXT 0x0001
50 #define SASL_SEC_NOACTIVE 0x0002
51 #define SASL_SEC_NODICTIONARY 0x0004
52 #define SASL_SEC_FORWARD_SECRECY 0x0008
53 #define SASL_SEC_NOANONYMOUS 0x0010
54 #define SASL_SEC_PASS_CREDENTIALS 0x0020
55 #define SASL_SEC_MUTUAL_AUTH 0x0040
56 #define SASL_SEC_MAXIMUM 0x00FF
58 typedef struct sasl_security_properties
62 unsigned int maxbufsize
;
63 unsigned int security_flags
;
64 const char **property_names
;
65 const char **property_values
;
66 } sasl_security_properties_t
;
68 #define SASL_CB_LIST_END 0
69 #define SASL_CB_USER 0x4001
70 #define SASL_CB_AUTHNAME 0x4002
71 #define SASL_CB_PASS 0x4004
72 #define SASL_CB_ECHOPROMPT 0x4005
73 #define SASL_CB_NOECHOPROMPT 0x4006
74 #define SASL_CB_GETREALM 0x4008
76 typedef struct sasl_callback
83 typedef struct sasl_interact
86 const char *challenge
;
88 const char *defresult
;
93 #define SASL_USERNAME 0
95 #define SASL_MAXOUTBUF 2
97 typedef struct sasl_conn sasl_conn_t
;
99 #define SASL_SSF_EXTERNAL 100
100 #define SASL_SEC_PROPS 101
101 #define SASL_AUTH_EXTERNAL 102
103 int sasl_client_init(const sasl_callback_t
*);
104 int sasl_client_new(const char *, const char *, const char *, const char *, const sasl_callback_t
*,
105 unsigned int, sasl_conn_t
**);
106 int sasl_client_start(sasl_conn_t
*conn
, const char *, sasl_interact_t
**, const char **, unsigned int *,
108 int sasl_client_step(sasl_conn_t
*conn
, const char *, unsigned int, sasl_interact_t
**, const char **,
110 int sasl_decode(sasl_conn_t
*, const char *, unsigned int, const char **, unsigned int *);
111 void sasl_dispose(sasl_conn_t
**);
112 int sasl_encode(sasl_conn_t
*, const char *, unsigned int, const char **, unsigned int *);
113 const char *sasl_errdetail(sasl_conn_t
*);
114 const char *sasl_errstring(int, const char *, const char **);
115 int sasl_getprop(sasl_conn_t
*, int, const void **);
116 const char **sasl_global_listmech(void);
117 void sasl_set_mutex(void *, void *, void *, void *);
118 int sasl_setprop(sasl_conn_t
*, int, const void *);