Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/libs/ldap/include/sasl.h
4394 views
1
/*
2
* Copyright 2022 Hans Leidekker for CodeWeavers
3
*
4
* Minimal compatible sasl.h header
5
*
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.
10
*
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.
15
*
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
19
*/
20
21
#ifndef SASL_H
22
#define SASL_H 1
23
24
#define SASL_VERSION_MAJOR 2
25
#define SASL_VERSION_MINOR 1
26
27
#define SASL_CONTINUE 1
28
#define SASL_INTERACT 2
29
#define SASL_OK 0
30
#define SASL_FAIL -1
31
#define SASL_NOMEM -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
46
47
typedef unsigned int sasl_ssf_t;
48
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
57
58
typedef struct sasl_security_properties
59
{
60
sasl_ssf_t min_ssf;
61
sasl_ssf_t max_ssf;
62
unsigned int maxbufsize;
63
unsigned int security_flags;
64
const char **property_names;
65
const char **property_values;
66
} sasl_security_properties_t;
67
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
75
76
typedef struct sasl_callback
77
{
78
unsigned long id;
79
int (*proc)(void);
80
void *context;
81
} sasl_callback_t;
82
83
typedef struct sasl_interact
84
{
85
unsigned long id;
86
const char *challenge;
87
const char *prompt;
88
const char *defresult;
89
const void *result;
90
unsigned len;
91
} sasl_interact_t;
92
93
#define SASL_USERNAME 0
94
#define SASL_SSF 1
95
#define SASL_MAXOUTBUF 2
96
97
typedef struct sasl_conn sasl_conn_t;
98
99
#define SASL_SSF_EXTERNAL 100
100
#define SASL_SEC_PROPS 101
101
#define SASL_AUTH_EXTERNAL 102
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 *,
107
const char **);
108
int sasl_client_step(sasl_conn_t *conn, const char *, unsigned int, sasl_interact_t **, const char **,
109
unsigned int *);
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 *);
119
120
#endif /* SASL_H */
121
122