Ignore mingw-get's downloaded files
[msysgit.git] / mingw / include / gsasl-compat.h
blobb3d8bf7bce7cb3887c125c53e2041da3e038b3b8
1 /* gsasl-compat.h --- Header file for obsoleted features in GNU SASL Library.
2 * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Simon Josefsson
4 * This file is part of GNU SASL Library.
6 * GNU SASL Library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * as published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version.
11 * GNU SASL 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 License along with GNU SASL Library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
23 #ifndef GSASL_COMPAT_H
24 # define GSASL_COMPAT_H
26 #ifndef __attribute__
27 /* This feature is available in gcc versions 2.5 and later. */
28 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
29 # define __attribute__(Spec) /* empty */
30 # endif
31 #endif
33 /* Old error codes */
34 enum
36 GSASL_TOO_SMALL_BUFFER = 4,
37 GSASL_FOPEN_ERROR = 5,
38 GSASL_FCLOSE_ERROR = 6,
39 GSASL_GCRYPT_ERROR = GSASL_CRYPTO_ERROR,
40 GSASL_CANNOT_GET_CTX = 32,
41 GSASL_NEED_CLIENT_ANONYMOUS_CALLBACK = 11,
42 GSASL_NEED_CLIENT_PASSWORD_CALLBACK = 12,
43 GSASL_NEED_CLIENT_PASSCODE_CALLBACK = 13,
44 GSASL_NEED_CLIENT_PIN_CALLBACK = 14,
45 GSASL_NEED_CLIENT_AUTHORIZATION_ID_CALLBACK = 15,
46 GSASL_NEED_CLIENT_AUTHENTICATION_ID_CALLBACK = 16,
47 GSASL_NEED_CLIENT_SERVICE_CALLBACK = 17,
48 GSASL_NEED_SERVER_VALIDATE_CALLBACK = 18,
49 GSASL_NEED_SERVER_CRAM_MD5_CALLBACK = 19,
50 GSASL_NEED_SERVER_DIGEST_MD5_CALLBACK = 20,
51 GSASL_NEED_SERVER_EXTERNAL_CALLBACK = 21,
52 GSASL_NEED_SERVER_ANONYMOUS_CALLBACK = 22,
53 GSASL_NEED_SERVER_REALM_CALLBACK = 23,
54 GSASL_NEED_SERVER_SECURID_CALLBACK = 24,
55 GSASL_NEED_SERVER_SERVICE_CALLBACK = 25,
56 GSASL_NEED_SERVER_GSSAPI_CALLBACK = 26,
57 GSASL_NEED_SERVER_RETRIEVE_CALLBACK = 27,
58 GSASL_UNICODE_NORMALIZATION_ERROR = 28,
59 GSASL_NO_MORE_REALMS = 34,
60 GSASL_INVALID_HANDLE = 50
61 } __attribute__ ((deprecated));
63 typedef Gsasl Gsasl_ctx __attribute__ ((deprecated));
64 typedef Gsasl_session Gsasl_session_ctx __attribute__ ((deprecated));
65 extern GSASL_API int gsasl_client_listmech (Gsasl * ctx, char *out,
66 size_t * outlen)
67 __attribute__ ((deprecated));
68 extern GSASL_API int gsasl_server_listmech (Gsasl * ctx, char *out,
69 size_t * outlen)
70 __attribute__ ((deprecated));
71 extern GSASL_API int gsasl_client_step (Gsasl_session * sctx,
72 const char *input, size_t input_len,
73 char *output, size_t * output_len)
74 __attribute__ ((deprecated));
75 extern GSASL_API int gsasl_client_step_base64 (Gsasl_session * sctx,
76 const char *b64input,
77 char *b64output,
78 size_t b64output_len)
79 __attribute__ ((deprecated));
80 extern GSASL_API int gsasl_server_step (Gsasl_session * sctx,
81 const char *input, size_t input_len,
82 char *output, size_t * output_len)
83 __attribute__ ((deprecated));
84 extern GSASL_API int gsasl_server_step_base64 (Gsasl_session * sctx,
85 const char *b64input,
86 char *b64output,
87 size_t b64output_len)
88 __attribute__ ((deprecated));
89 extern GSASL_API void gsasl_client_finish (Gsasl_session * sctx)
90 __attribute__ ((deprecated));
91 extern GSASL_API void gsasl_server_finish (Gsasl_session * sctx)
92 __attribute__ ((deprecated));
93 extern GSASL_API Gsasl *gsasl_client_ctx_get (Gsasl_session * sctx)
94 __attribute__ ((deprecated));
95 extern GSASL_API Gsasl *gsasl_server_ctx_get (Gsasl_session * sctx)
96 __attribute__ ((deprecated));
97 extern GSASL_API void gsasl_client_application_data_set (Gsasl_session * sctx,
98 void
99 *application_data)
100 __attribute__ ((deprecated));
101 extern GSASL_API void *gsasl_client_application_data_get (Gsasl_session *
102 sctx)
103 __attribute__ ((deprecated));
104 extern GSASL_API void gsasl_server_application_data_set (Gsasl_session * sctx,
105 void
106 *application_data)
107 __attribute__ ((deprecated));
108 extern GSASL_API void *gsasl_server_application_data_get (Gsasl_session *
109 sctx)
110 __attribute__ ((deprecated));
111 extern GSASL_API int gsasl_randomize (int strong, char *data, size_t datalen)
112 __attribute__ ((deprecated));
113 extern GSASL_API Gsasl *gsasl_ctx_get (Gsasl_session * sctx)
114 __attribute__ ((deprecated));
115 extern GSASL_API int gsasl_encode_inline (Gsasl_session * sctx,
116 const char *input, size_t input_len,
117 char *output, size_t * output_len)
118 __attribute__ ((deprecated));
119 extern GSASL_API int gsasl_decode_inline (Gsasl_session * sctx,
120 const char *input, size_t input_len,
121 char *output, size_t * output_len)
122 __attribute__ ((deprecated));
123 extern GSASL_API void gsasl_application_data_set (Gsasl * ctx, void *appdata)
124 __attribute__ ((deprecated));
125 extern GSASL_API void *gsasl_application_data_get (Gsasl * ctx)
126 __attribute__ ((deprecated));
127 extern GSASL_API void gsasl_appinfo_set (Gsasl_session * sctx, void *appdata)
128 __attribute__ ((deprecated));
129 extern GSASL_API void *gsasl_appinfo_get (Gsasl_session * sctx)
130 __attribute__ ((deprecated));
131 extern GSASL_API const char *gsasl_server_suggest_mechanism (Gsasl * ctx,
132 const char
133 *mechlist)
134 __attribute__ ((deprecated));
136 extern GSASL_API int gsasl_base64_encode (char const *src, size_t srclength,
137 char *target, size_t targsize)
138 __attribute__ ((deprecated));
139 extern GSASL_API int gsasl_base64_decode (char const *src,
140 char *target, size_t targsize)
141 __attribute__ ((deprecated));
143 extern GSASL_API char *gsasl_stringprep_nfkc (const char *in, ssize_t len)
144 __attribute__ ((deprecated));
145 extern GSASL_API char *gsasl_stringprep_saslprep (const char *in,
146 int *stringprep_rc)
147 __attribute__ ((deprecated));
148 extern GSASL_API char *gsasl_stringprep_trace (const char *in,
149 int *stringprep_rc)
150 __attribute__ ((deprecated));
152 extern GSASL_API int gsasl_md5pwd_get_password (const char *filename,
153 const char *username,
154 char *key, size_t * keylen)
155 __attribute__ ((deprecated));
157 /* Callback prototypes */
158 typedef int (*Gsasl_client_callback_anonymous) (Gsasl_session * sctx,
159 char *out, size_t * outlen);
160 typedef int (*Gsasl_client_callback_authentication_id) (Gsasl_session * sctx,
161 char *out,
162 size_t * outlen);
163 typedef int (*Gsasl_client_callback_authorization_id) (Gsasl_session * sctx,
164 char *out,
165 size_t * outlen);
166 typedef int (*Gsasl_client_callback_password) (Gsasl_session * sctx,
167 char *out, size_t * outlen);
168 typedef int (*Gsasl_client_callback_passcode) (Gsasl_session * sctx,
169 char *out, size_t * outlen);
170 typedef int (*Gsasl_client_callback_pin) (Gsasl_session * sctx,
171 char *suggestion, char *out,
172 size_t * outlen);
173 typedef int (*Gsasl_client_callback_service) (Gsasl_session * sctx,
174 char *service,
175 size_t * servicelen,
176 char *hostname,
177 size_t * hostnamelen,
178 char *servicename,
179 size_t * servicenamelen);
180 typedef Gsasl_qop (*Gsasl_client_callback_qop) (Gsasl_session * sctx,
181 Gsasl_qop serverqops);
182 typedef size_t (*Gsasl_client_callback_maxbuf) (Gsasl_session * sctx,
183 size_t servermaxbuf);
184 typedef int (*Gsasl_client_callback_realm) (Gsasl_session * sctx, char *out,
185 size_t * outlen);
186 typedef int (*Gsasl_server_callback_retrieve) (Gsasl_session * sctx,
187 const char *authentication_id,
188 const char *authorization_id,
189 const char *realm, char *key,
190 size_t * keylen);
191 typedef int (*Gsasl_server_callback_validate) (Gsasl_session * sctx,
192 const char *authorization_id,
193 const char *authentication_id,
194 const char *password);
195 typedef int (*Gsasl_server_callback_gssapi) (Gsasl_session * sctx,
196 const char *clientname,
197 const char *authentication_id);
198 typedef int (*Gsasl_server_callback_securid) (Gsasl_session * sctx,
199 const char *authentication_id,
200 const char *authorization_id,
201 const char *passcode, char *pin,
202 char *suggestpin,
203 size_t * suggestpinlen);
204 typedef int (*Gsasl_server_callback_cram_md5) (Gsasl_session * sctx,
205 char *username,
206 char *challenge,
207 char *response);
208 typedef int (*Gsasl_server_callback_digest_md5) (Gsasl_session * sctx,
209 char *username, char *realm,
210 char *secrethash);
211 typedef int (*Gsasl_server_callback_service) (Gsasl_session * sctx,
212 char *service,
213 size_t * servicelen,
214 char *hostname,
215 size_t * hostnamelen);
216 typedef int (*Gsasl_server_callback_external) (Gsasl_session * sctx);
217 typedef int (*Gsasl_server_callback_anonymous) (Gsasl_session * sctx,
218 const char *token);
219 typedef int (*Gsasl_server_callback_realm) (Gsasl_session * sctx, char *out,
220 size_t * outlen, size_t nth);
221 typedef Gsasl_qop (*Gsasl_server_callback_qop) (Gsasl_session * sctx);
222 typedef size_t (*Gsasl_server_callback_maxbuf) (Gsasl_session * sctx);
223 typedef Gsasl_cipher (*Gsasl_server_callback_cipher) (Gsasl_session * sctx);
225 /* Obsolete client callbacks: callback-c.c */
226 extern GSASL_API void
227 gsasl_client_callback_authorization_id_set
228 (Gsasl * ctx, Gsasl_client_callback_authorization_id cb)
229 __attribute__ ((deprecated));
230 extern GSASL_API Gsasl_client_callback_authorization_id
231 gsasl_client_callback_authorization_id_get (Gsasl * ctx)
232 __attribute__ ((deprecated));
234 extern GSASL_API void
235 gsasl_client_callback_authentication_id_set
236 (Gsasl * ctx, Gsasl_client_callback_authentication_id cb)
237 __attribute__ ((deprecated));
238 extern GSASL_API Gsasl_client_callback_authentication_id
239 gsasl_client_callback_authentication_id_get (Gsasl * ctx)
240 __attribute__ ((deprecated));
242 extern GSASL_API void
243 gsasl_client_callback_anonymous_set (Gsasl * ctx,
244 Gsasl_client_callback_anonymous cb)
245 __attribute__ ((deprecated));
246 extern GSASL_API Gsasl_client_callback_anonymous
247 gsasl_client_callback_anonymous_get (Gsasl * ctx)
248 __attribute__ ((deprecated));
250 extern GSASL_API void
251 gsasl_client_callback_password_set (Gsasl * ctx,
252 Gsasl_client_callback_password cb)
253 __attribute__ ((deprecated));
254 extern GSASL_API Gsasl_client_callback_password
255 gsasl_client_callback_password_get (Gsasl * ctx) __attribute__ ((deprecated));
257 extern GSASL_API void
258 gsasl_client_callback_passcode_set (Gsasl * ctx,
259 Gsasl_client_callback_passcode cb)
260 __attribute__ ((deprecated));
261 extern GSASL_API Gsasl_client_callback_passcode
262 gsasl_client_callback_passcode_get (Gsasl * ctx) __attribute__ ((deprecated));
264 extern GSASL_API void
265 gsasl_client_callback_pin_set (Gsasl * ctx, Gsasl_client_callback_pin cb)
266 __attribute__ ((deprecated));
267 extern GSASL_API Gsasl_client_callback_pin
268 gsasl_client_callback_pin_get (Gsasl * ctx) __attribute__ ((deprecated));
270 extern GSASL_API void
271 gsasl_client_callback_service_set (Gsasl * ctx,
272 Gsasl_client_callback_service cb)
273 __attribute__ ((deprecated));
274 extern GSASL_API Gsasl_client_callback_service
275 gsasl_client_callback_service_get (Gsasl * ctx) __attribute__ ((deprecated));
277 extern GSASL_API void
278 gsasl_client_callback_qop_set (Gsasl * ctx, Gsasl_client_callback_qop cb)
279 __attribute__ ((deprecated));
280 extern GSASL_API Gsasl_client_callback_qop
281 gsasl_client_callback_qop_get (Gsasl * ctx) __attribute__ ((deprecated));
283 extern GSASL_API void
284 gsasl_client_callback_maxbuf_set (Gsasl * ctx,
285 Gsasl_client_callback_maxbuf cb)
286 __attribute__ ((deprecated));
287 extern GSASL_API Gsasl_client_callback_maxbuf
288 gsasl_client_callback_maxbuf_get (Gsasl * ctx) __attribute__ ((deprecated));
289 extern GSASL_API
290 void gsasl_client_callback_realm_set (Gsasl * ctx,
291 Gsasl_client_callback_realm cb)
292 __attribute__ ((deprecated));
293 extern GSASL_API Gsasl_client_callback_realm
294 gsasl_client_callback_realm_get (Gsasl * ctx) __attribute__ ((deprecated));
296 /* Obsolete server callbacks: callback-s.c */
297 extern GSASL_API void
298 gsasl_server_callback_validate_set (Gsasl * ctx,
299 Gsasl_server_callback_validate cb)
300 __attribute__ ((deprecated));
301 extern GSASL_API Gsasl_server_callback_validate
302 gsasl_server_callback_validate_get (Gsasl * ctx) __attribute__ ((deprecated));
304 extern GSASL_API void
305 gsasl_server_callback_retrieve_set (Gsasl * ctx,
306 Gsasl_server_callback_retrieve cb)
307 __attribute__ ((deprecated));
308 extern GSASL_API Gsasl_server_callback_retrieve
309 gsasl_server_callback_retrieve_get (Gsasl * ctx) __attribute__ ((deprecated));
311 extern GSASL_API void
312 gsasl_server_callback_cram_md5_set (Gsasl * ctx,
313 Gsasl_server_callback_cram_md5 cb)
314 __attribute__ ((deprecated));
315 extern GSASL_API Gsasl_server_callback_cram_md5
316 gsasl_server_callback_cram_md5_get (Gsasl * ctx) __attribute__ ((deprecated));
318 extern GSASL_API void
319 gsasl_server_callback_digest_md5_set (Gsasl * ctx,
320 Gsasl_server_callback_digest_md5 cb)
321 __attribute__ ((deprecated));
322 extern GSASL_API Gsasl_server_callback_digest_md5
323 gsasl_server_callback_digest_md5_get (Gsasl * ctx)
324 __attribute__ ((deprecated));
326 extern GSASL_API void
327 gsasl_server_callback_external_set (Gsasl * ctx,
328 Gsasl_server_callback_external cb)
329 __attribute__ ((deprecated));
330 extern GSASL_API Gsasl_server_callback_external
331 gsasl_server_callback_external_get (Gsasl * ctx) __attribute__ ((deprecated));
333 extern GSASL_API void
334 gsasl_server_callback_anonymous_set (Gsasl * ctx,
335 Gsasl_server_callback_anonymous cb)
336 __attribute__ ((deprecated));
337 extern GSASL_API Gsasl_server_callback_anonymous
338 gsasl_server_callback_anonymous_get (Gsasl * ctx)
339 __attribute__ ((deprecated));
341 extern GSASL_API void
342 gsasl_server_callback_realm_set (Gsasl * ctx, Gsasl_server_callback_realm cb)
343 __attribute__ ((deprecated));
344 extern GSASL_API Gsasl_server_callback_realm
345 gsasl_server_callback_realm_get (Gsasl * ctx) __attribute__ ((deprecated));
347 extern GSASL_API void
348 gsasl_server_callback_qop_set (Gsasl * ctx, Gsasl_server_callback_qop cb)
349 __attribute__ ((deprecated));
350 extern GSASL_API Gsasl_server_callback_qop
351 gsasl_server_callback_qop_get (Gsasl * ctx) __attribute__ ((deprecated));
353 extern GSASL_API void
354 gsasl_server_callback_maxbuf_set (Gsasl * ctx,
355 Gsasl_server_callback_maxbuf cb)
356 __attribute__ ((deprecated));
357 extern GSASL_API Gsasl_server_callback_maxbuf
358 gsasl_server_callback_maxbuf_get (Gsasl * ctx) __attribute__ ((deprecated));
360 extern GSASL_API void
361 gsasl_server_callback_cipher_set (Gsasl * ctx,
362 Gsasl_server_callback_cipher cb)
363 __attribute__ ((deprecated));
364 extern GSASL_API Gsasl_server_callback_cipher
365 gsasl_server_callback_cipher_get (Gsasl * ctx) __attribute__ ((deprecated));
367 extern GSASL_API void
368 gsasl_server_callback_securid_set (Gsasl * ctx,
369 Gsasl_server_callback_securid cb)
370 __attribute__ ((deprecated));
371 extern GSASL_API Gsasl_server_callback_securid
372 gsasl_server_callback_securid_get (Gsasl * ctx) __attribute__ ((deprecated));
374 extern GSASL_API void
375 gsasl_server_callback_gssapi_set (Gsasl * ctx,
376 Gsasl_server_callback_gssapi cb)
377 __attribute__ ((deprecated));
378 extern GSASL_API Gsasl_server_callback_gssapi
379 gsasl_server_callback_gssapi_get (Gsasl * ctx) __attribute__ ((deprecated));
381 extern GSASL_API void
382 gsasl_server_callback_service_set (Gsasl * ctx,
383 Gsasl_server_callback_service cb)
384 __attribute__ ((deprecated));
385 extern GSASL_API Gsasl_server_callback_service
386 gsasl_server_callback_service_get (Gsasl * ctx) __attribute__ ((deprecated));
388 #endif /* GSASL_COMPAT_H */