gsasl-compat.h

Go to the documentation of this file.
00001 /* gsasl-compat.h --- Header file for obsoleted features in GNU SASL Library.
00002  * Copyright (C) 2002, 2003, 2004, 2005  Simon Josefsson
00003  *
00004  * This file is part of GNU SASL Library.
00005  *
00006  * GNU SASL Library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public License
00008  * as published by the Free Software Foundation; either version 2.1 of
00009  * the License, or (at your option) any later version.
00010  *
00011  * GNU SASL Library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License License along with GNU SASL Library; if not, write to the
00018  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef GSASL_COMPAT_H
00024 # define GSASL_COMPAT_H
00025 
00026 #ifndef __attribute__
00027 /* This feature is available in gcc versions 2.5 and later.  */
00028 # if __cplusplus == 1 || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
00029 #  define __attribute__(Spec)   /* empty */
00030 # endif
00031 #endif
00032 
00033 /* Old error codes */
00034 enum
00035 {
00036   GSASL_TOO_SMALL_BUFFER = 4,
00037   GSASL_FOPEN_ERROR = 5,
00038   GSASL_FCLOSE_ERROR = 6,
00039   GSASL_GCRYPT_ERROR = GSASL_CRYPTO_ERROR,
00040   GSASL_CANNOT_GET_CTX = 32,
00041   GSASL_NEED_CLIENT_ANONYMOUS_CALLBACK = 11,
00042   GSASL_NEED_CLIENT_PASSWORD_CALLBACK = 12,
00043   GSASL_NEED_CLIENT_PASSCODE_CALLBACK = 13,
00044   GSASL_NEED_CLIENT_PIN_CALLBACK = 14,
00045   GSASL_NEED_CLIENT_AUTHORIZATION_ID_CALLBACK = 15,
00046   GSASL_NEED_CLIENT_AUTHENTICATION_ID_CALLBACK = 16,
00047   GSASL_NEED_CLIENT_SERVICE_CALLBACK = 17,
00048   GSASL_NEED_SERVER_VALIDATE_CALLBACK = 18,
00049   GSASL_NEED_SERVER_CRAM_MD5_CALLBACK = 19,
00050   GSASL_NEED_SERVER_DIGEST_MD5_CALLBACK = 20,
00051   GSASL_NEED_SERVER_EXTERNAL_CALLBACK = 21,
00052   GSASL_NEED_SERVER_ANONYMOUS_CALLBACK = 22,
00053   GSASL_NEED_SERVER_REALM_CALLBACK = 23,
00054   GSASL_NEED_SERVER_SECURID_CALLBACK = 24,
00055   GSASL_NEED_SERVER_SERVICE_CALLBACK = 25,
00056   GSASL_NEED_SERVER_GSSAPI_CALLBACK = 26,
00057   GSASL_NEED_SERVER_RETRIEVE_CALLBACK = 27,
00058   GSASL_UNICODE_NORMALIZATION_ERROR = 28,
00059   GSASL_NO_MORE_REALMS = 34,
00060   GSASL_INVALID_HANDLE = 50
00061 } __attribute__ ((deprecated));
00062 
00063 typedef Gsasl Gsasl_ctx __attribute__ ((deprecated));
00064 typedef Gsasl_session Gsasl_session_ctx __attribute__ ((deprecated));
00065 extern int gsasl_client_listmech (Gsasl * ctx, char *out,
00066                                   size_t * outlen)
00067   __attribute__ ((deprecated));
00068 extern int gsasl_server_listmech (Gsasl * ctx, char *out, size_t * outlen)
00069   __attribute__ ((deprecated));
00070 extern int gsasl_client_step (Gsasl_session * sctx, const char *input,
00071                               size_t input_len, char *output,
00072                               size_t * output_len)
00073   __attribute__ ((deprecated));
00074 extern int gsasl_client_step_base64 (Gsasl_session * sctx,
00075                                      const char *b64input, char *b64output,
00076                                      size_t b64output_len)
00077   __attribute__ ((deprecated));
00078 extern int gsasl_server_step (Gsasl_session * sctx, const char *input,
00079                               size_t input_len, char *output,
00080                               size_t * output_len)
00081   __attribute__ ((deprecated));
00082 extern int gsasl_server_step_base64 (Gsasl_session * sctx,
00083                                      const char *b64input, char *b64output,
00084                                      size_t b64output_len)
00085   __attribute__ ((deprecated));
00086 extern void gsasl_client_finish (Gsasl_session * sctx)
00087   __attribute__ ((deprecated));
00088 extern void gsasl_server_finish (Gsasl_session * sctx)
00089   __attribute__ ((deprecated));
00090 extern Gsasl *gsasl_client_ctx_get (Gsasl_session * sctx)
00091   __attribute__ ((deprecated));
00092 extern Gsasl *gsasl_server_ctx_get (Gsasl_session * sctx)
00093   __attribute__ ((deprecated));
00094 extern void gsasl_client_application_data_set (Gsasl_session * sctx,
00095                                                void *application_data)
00096   __attribute__ ((deprecated));
00097 extern void *gsasl_client_application_data_get (Gsasl_session * sctx)
00098   __attribute__ ((deprecated));
00099 extern void gsasl_server_application_data_set (Gsasl_session * sctx,
00100                                                void *application_data)
00101   __attribute__ ((deprecated));
00102 extern void *gsasl_server_application_data_get (Gsasl_session * sctx)
00103   __attribute__ ((deprecated));
00104 extern int gsasl_randomize (int strong, char *data, size_t datalen)
00105   __attribute__ ((deprecated));
00106 extern Gsasl *gsasl_ctx_get (Gsasl_session * sctx)
00107   __attribute__ ((deprecated));
00108 extern int gsasl_encode_inline (Gsasl_session * sctx, const char *input,
00109                                 size_t input_len, char *output,
00110                                 size_t * output_len)
00111   __attribute__ ((deprecated));
00112 extern int gsasl_decode_inline (Gsasl_session * sctx, const char *input,
00113                                 size_t input_len, char *output,
00114                                 size_t * output_len)
00115   __attribute__ ((deprecated));
00116 extern void gsasl_application_data_set (Gsasl * ctx, void *appdata)
00117   __attribute__ ((deprecated));
00118 extern void *gsasl_application_data_get (Gsasl * ctx)
00119   __attribute__ ((deprecated));
00120 extern void gsasl_appinfo_set (Gsasl_session * sctx, void *appdata)
00121   __attribute__ ((deprecated));
00122 extern void *gsasl_appinfo_get (Gsasl_session * sctx)
00123   __attribute__ ((deprecated));
00124 extern const char *gsasl_server_suggest_mechanism (Gsasl * ctx,
00125                                                    const char *mechlist)
00126   __attribute__ ((deprecated));
00127 
00128 extern int gsasl_base64_encode (char const *src, size_t srclength,
00129                                 char *target, size_t targsize)
00130   __attribute__ ((deprecated));
00131 extern int gsasl_base64_decode (char const *src,
00132                                 char *target, size_t targsize)
00133   __attribute__ ((deprecated));
00134 
00135 extern char *gsasl_stringprep_nfkc (const char *in, ssize_t len)
00136   __attribute__ ((deprecated));
00137 extern char *gsasl_stringprep_saslprep (const char *in, int *stringprep_rc)
00138   __attribute__ ((deprecated));
00139 extern char *gsasl_stringprep_trace (const char *in, int *stringprep_rc)
00140   __attribute__ ((deprecated));
00141 
00142 extern int gsasl_md5pwd_get_password (const char *filename,
00143                                       const char *username,
00144                                       char *key, size_t * keylen)
00145   __attribute__ ((deprecated));
00146 
00147 /* Callback prototypes */
00148 typedef int (*Gsasl_client_callback_anonymous) (Gsasl_session * sctx,
00149                                                 char *out, size_t * outlen);
00150 typedef int (*Gsasl_client_callback_authentication_id) (Gsasl_session * sctx,
00151                                                         char *out,
00152                                                         size_t * outlen);
00153 typedef int (*Gsasl_client_callback_authorization_id) (Gsasl_session * sctx,
00154                                                        char *out,
00155                                                        size_t * outlen);
00156 typedef int (*Gsasl_client_callback_password) (Gsasl_session * sctx,
00157                                                char *out, size_t * outlen);
00158 typedef int (*Gsasl_client_callback_passcode) (Gsasl_session * sctx,
00159                                                char *out, size_t * outlen);
00160 typedef int (*Gsasl_client_callback_pin) (Gsasl_session * sctx,
00161                                           char *suggestion, char *out,
00162                                           size_t * outlen);
00163 typedef int (*Gsasl_client_callback_service) (Gsasl_session * sctx,
00164                                               char *service,
00165                                               size_t * servicelen,
00166                                               char *hostname,
00167                                               size_t * hostnamelen,
00168                                               char *servicename,
00169                                               size_t * servicenamelen);
00170 typedef Gsasl_qop (*Gsasl_client_callback_qop) (Gsasl_session * sctx,
00171                                                 Gsasl_qop serverqops);
00172 typedef size_t (*Gsasl_client_callback_maxbuf) (Gsasl_session * sctx,
00173                                                 size_t servermaxbuf);
00174 typedef int (*Gsasl_client_callback_realm) (Gsasl_session * sctx, char *out,
00175                                             size_t * outlen);
00176 typedef int (*Gsasl_server_callback_retrieve) (Gsasl_session * sctx,
00177                                                const char *authentication_id,
00178                                                const char *authorization_id,
00179                                                const char *realm, char *key,
00180                                                size_t * keylen);
00181 typedef int (*Gsasl_server_callback_validate) (Gsasl_session * sctx,
00182                                                const char *authorization_id,
00183                                                const char *authentication_id,
00184                                                const char *password);
00185 typedef int (*Gsasl_server_callback_gssapi) (Gsasl_session * sctx,
00186                                              const char *clientname,
00187                                              const char *authentication_id);
00188 typedef int (*Gsasl_server_callback_securid) (Gsasl_session * sctx,
00189                                               const char *authentication_id,
00190                                               const char *authorization_id,
00191                                               const char *passcode, char *pin,
00192                                               char *suggestpin,
00193                                               size_t * suggestpinlen);
00194 typedef int (*Gsasl_server_callback_cram_md5) (Gsasl_session * sctx,
00195                                                char *username,
00196                                                char *challenge,
00197                                                char *response);
00198 typedef int (*Gsasl_server_callback_digest_md5) (Gsasl_session * sctx,
00199                                                  char *username, char *realm,
00200                                                  char *secrethash);
00201 typedef int (*Gsasl_server_callback_service) (Gsasl_session * sctx,
00202                                               char *service,
00203                                               size_t * servicelen,
00204                                               char *hostname,
00205                                               size_t * hostnamelen);
00206 typedef int (*Gsasl_server_callback_external) (Gsasl_session * sctx);
00207 typedef int (*Gsasl_server_callback_anonymous) (Gsasl_session * sctx,
00208                                                 const char *token);
00209 typedef int (*Gsasl_server_callback_realm) (Gsasl_session * sctx, char *out,
00210                                             size_t * outlen, size_t nth);
00211 typedef Gsasl_qop (*Gsasl_server_callback_qop) (Gsasl_session * sctx);
00212 typedef size_t (*Gsasl_server_callback_maxbuf) (Gsasl_session * sctx);
00213 typedef Gsasl_cipher (*Gsasl_server_callback_cipher) (Gsasl_session * sctx);
00214 
00215 /* Obsolete client callbacks: callback-c.c */
00216 extern void
00217   gsasl_client_callback_authorization_id_set
00218   (Gsasl * ctx, Gsasl_client_callback_authorization_id cb)
00219   __attribute__ ((deprecated));
00220 extern Gsasl_client_callback_authorization_id
00221 gsasl_client_callback_authorization_id_get (Gsasl * ctx)
00222 __attribute__ ((deprecated));
00223 
00224 extern void
00225   gsasl_client_callback_authentication_id_set
00226   (Gsasl * ctx, Gsasl_client_callback_authentication_id cb)
00227   __attribute__ ((deprecated));
00228 extern Gsasl_client_callback_authentication_id
00229 gsasl_client_callback_authentication_id_get (Gsasl * ctx)
00230 __attribute__ ((deprecated));
00231 
00232 extern void
00233 gsasl_client_callback_anonymous_set (Gsasl * ctx,
00234                                      Gsasl_client_callback_anonymous cb)
00235 __attribute__ ((deprecated));
00236 extern Gsasl_client_callback_anonymous
00237 gsasl_client_callback_anonymous_get (Gsasl * ctx)
00238 __attribute__ ((deprecated));
00239 
00240 extern void
00241 gsasl_client_callback_password_set (Gsasl * ctx,
00242                                     Gsasl_client_callback_password cb)
00243 __attribute__ ((deprecated));
00244 extern Gsasl_client_callback_password
00245 gsasl_client_callback_password_get (Gsasl * ctx) __attribute__ ((deprecated));
00246 
00247 extern void
00248 gsasl_client_callback_passcode_set (Gsasl * ctx,
00249                                     Gsasl_client_callback_passcode cb)
00250 __attribute__ ((deprecated));
00251 extern Gsasl_client_callback_passcode
00252 gsasl_client_callback_passcode_get (Gsasl * ctx) __attribute__ ((deprecated));
00253 
00254 extern void
00255 gsasl_client_callback_pin_set (Gsasl * ctx, Gsasl_client_callback_pin cb)
00256 __attribute__ ((deprecated));
00257 extern Gsasl_client_callback_pin gsasl_client_callback_pin_get (Gsasl * ctx)
00258   __attribute__ ((deprecated));
00259 
00260 extern void
00261 gsasl_client_callback_service_set (Gsasl * ctx,
00262                                    Gsasl_client_callback_service cb)
00263 __attribute__ ((deprecated));
00264 extern Gsasl_client_callback_service gsasl_client_callback_service_get (Gsasl
00265                                                                         * ctx)
00266   __attribute__ ((deprecated));
00267 
00268 extern void
00269 gsasl_client_callback_qop_set (Gsasl * ctx, Gsasl_client_callback_qop cb)
00270 __attribute__ ((deprecated));
00271 extern Gsasl_client_callback_qop gsasl_client_callback_qop_get (Gsasl * ctx)
00272   __attribute__ ((deprecated));
00273 
00274 extern void
00275 gsasl_client_callback_maxbuf_set (Gsasl * ctx,
00276                                   Gsasl_client_callback_maxbuf cb)
00277 __attribute__ ((deprecated));
00278 extern Gsasl_client_callback_maxbuf gsasl_client_callback_maxbuf_get (Gsasl *
00279                                                                       ctx)
00280   __attribute__ ((deprecated));
00281 extern void gsasl_client_callback_realm_set (Gsasl * ctx,
00282                                              Gsasl_client_callback_realm cb)
00283   __attribute__ ((deprecated));
00284 extern Gsasl_client_callback_realm gsasl_client_callback_realm_get (Gsasl *
00285                                                                     ctx)
00286   __attribute__ ((deprecated));
00287 
00288 /* Obsolete server callbacks: callback-s.c */
00289 extern void
00290 gsasl_server_callback_validate_set (Gsasl * ctx,
00291                                     Gsasl_server_callback_validate cb)
00292 __attribute__ ((deprecated));
00293 extern Gsasl_server_callback_validate
00294 gsasl_server_callback_validate_get (Gsasl * ctx) __attribute__ ((deprecated));
00295 
00296 extern void
00297 gsasl_server_callback_retrieve_set (Gsasl * ctx,
00298                                     Gsasl_server_callback_retrieve cb)
00299 __attribute__ ((deprecated));
00300 extern Gsasl_server_callback_retrieve
00301 gsasl_server_callback_retrieve_get (Gsasl * ctx) __attribute__ ((deprecated));
00302 
00303 extern void
00304 gsasl_server_callback_cram_md5_set (Gsasl * ctx,
00305                                     Gsasl_server_callback_cram_md5 cb)
00306 __attribute__ ((deprecated));
00307 extern Gsasl_server_callback_cram_md5
00308 gsasl_server_callback_cram_md5_get (Gsasl * ctx) __attribute__ ((deprecated));
00309 
00310 extern void
00311 gsasl_server_callback_digest_md5_set (Gsasl * ctx,
00312                                       Gsasl_server_callback_digest_md5 cb)
00313 __attribute__ ((deprecated));
00314 extern Gsasl_server_callback_digest_md5
00315 gsasl_server_callback_digest_md5_get (Gsasl * ctx)
00316 __attribute__ ((deprecated));
00317 
00318 extern void
00319 gsasl_server_callback_external_set (Gsasl * ctx,
00320                                     Gsasl_server_callback_external cb)
00321 __attribute__ ((deprecated));
00322 extern Gsasl_server_callback_external
00323 gsasl_server_callback_external_get (Gsasl * ctx) __attribute__ ((deprecated));
00324 
00325 extern void
00326 gsasl_server_callback_anonymous_set (Gsasl * ctx,
00327                                      Gsasl_server_callback_anonymous cb)
00328 __attribute__ ((deprecated));
00329 extern Gsasl_server_callback_anonymous
00330 gsasl_server_callback_anonymous_get (Gsasl * ctx)
00331 __attribute__ ((deprecated));
00332 
00333 extern void
00334 gsasl_server_callback_realm_set (Gsasl * ctx, Gsasl_server_callback_realm cb)
00335 __attribute__ ((deprecated));
00336 extern Gsasl_server_callback_realm gsasl_server_callback_realm_get (Gsasl *
00337                                                                     ctx)
00338   __attribute__ ((deprecated));
00339 
00340 extern void
00341 gsasl_server_callback_qop_set (Gsasl * ctx, Gsasl_server_callback_qop cb)
00342 __attribute__ ((deprecated));
00343 extern Gsasl_server_callback_qop gsasl_server_callback_qop_get (Gsasl * ctx)
00344   __attribute__ ((deprecated));
00345 
00346 extern void
00347 gsasl_server_callback_maxbuf_set (Gsasl * ctx,
00348                                   Gsasl_server_callback_maxbuf cb)
00349 __attribute__ ((deprecated));
00350 extern Gsasl_server_callback_maxbuf gsasl_server_callback_maxbuf_get (Gsasl *
00351                                                                       ctx)
00352   __attribute__ ((deprecated));
00353 
00354 extern void
00355 gsasl_server_callback_cipher_set (Gsasl * ctx,
00356                                   Gsasl_server_callback_cipher cb)
00357 __attribute__ ((deprecated));
00358 extern Gsasl_server_callback_cipher gsasl_server_callback_cipher_get (Gsasl *
00359                                                                       ctx)
00360   __attribute__ ((deprecated));
00361 
00362 extern void
00363 gsasl_server_callback_securid_set (Gsasl * ctx,
00364                                    Gsasl_server_callback_securid cb)
00365 __attribute__ ((deprecated));
00366 extern Gsasl_server_callback_securid gsasl_server_callback_securid_get (Gsasl
00367                                                                         * ctx)
00368   __attribute__ ((deprecated));
00369 
00370 extern void
00371 gsasl_server_callback_gssapi_set (Gsasl * ctx,
00372                                   Gsasl_server_callback_gssapi cb)
00373 __attribute__ ((deprecated));
00374 extern Gsasl_server_callback_gssapi gsasl_server_callback_gssapi_get (Gsasl *
00375                                                                       ctx)
00376   __attribute__ ((deprecated));
00377 
00378 extern void
00379 gsasl_server_callback_service_set (Gsasl * ctx,
00380                                    Gsasl_server_callback_service cb)
00381 __attribute__ ((deprecated));
00382 extern Gsasl_server_callback_service gsasl_server_callback_service_get (Gsasl
00383                                                                         * ctx)
00384   __attribute__ ((deprecated));
00385 
00386 #endif /* GSASL_COMPAT_H */

Generated on Tue Aug 22 12:06:06 2006 for gsasl by  doxygen 1.4.7