|
gsasl
1.8.0
|
00001 /* gsasl-compat.h --- Header file for obsoleted features in GNU SASL Library. 00002 * Copyright (C) 2002-2012 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 __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 GSASL_API int gsasl_client_listmech (Gsasl * ctx, char *out, 00066 size_t * outlen) 00067 __attribute__ ((deprecated)); 00068 extern GSASL_API int gsasl_server_listmech (Gsasl * ctx, char *out, 00069 size_t * outlen) 00070 __attribute__ ((deprecated)); 00071 extern GSASL_API int gsasl_client_step (Gsasl_session * sctx, 00072 const char *input, size_t input_len, 00073 char *output, size_t * output_len) 00074 __attribute__ ((deprecated)); 00075 extern GSASL_API int gsasl_client_step_base64 (Gsasl_session * sctx, 00076 const char *b64input, 00077 char *b64output, 00078 size_t b64output_len) 00079 __attribute__ ((deprecated)); 00080 extern GSASL_API int gsasl_server_step (Gsasl_session * sctx, 00081 const char *input, size_t input_len, 00082 char *output, size_t * output_len) 00083 __attribute__ ((deprecated)); 00084 extern GSASL_API int gsasl_server_step_base64 (Gsasl_session * sctx, 00085 const char *b64input, 00086 char *b64output, 00087 size_t b64output_len) 00088 __attribute__ ((deprecated)); 00089 extern GSASL_API void gsasl_client_finish (Gsasl_session * sctx) 00090 __attribute__ ((deprecated)); 00091 extern GSASL_API void gsasl_server_finish (Gsasl_session * sctx) 00092 __attribute__ ((deprecated)); 00093 extern GSASL_API Gsasl *gsasl_client_ctx_get (Gsasl_session * sctx) 00094 __attribute__ ((deprecated)); 00095 extern GSASL_API Gsasl *gsasl_server_ctx_get (Gsasl_session * sctx) 00096 __attribute__ ((deprecated)); 00097 extern GSASL_API void gsasl_client_application_data_set (Gsasl_session * sctx, 00098 void 00099 *application_data) 00100 __attribute__ ((deprecated)); 00101 extern GSASL_API void *gsasl_client_application_data_get (Gsasl_session * 00102 sctx) 00103 __attribute__ ((deprecated)); 00104 extern GSASL_API void gsasl_server_application_data_set (Gsasl_session * sctx, 00105 void 00106 *application_data) 00107 __attribute__ ((deprecated)); 00108 extern GSASL_API void *gsasl_server_application_data_get (Gsasl_session * 00109 sctx) 00110 __attribute__ ((deprecated)); 00111 extern GSASL_API int gsasl_randomize (int strong, char *data, size_t datalen) 00112 __attribute__ ((deprecated)); 00113 extern GSASL_API Gsasl *gsasl_ctx_get (Gsasl_session * sctx) 00114 __attribute__ ((deprecated)); 00115 extern GSASL_API int gsasl_encode_inline (Gsasl_session * sctx, 00116 const char *input, size_t input_len, 00117 char *output, size_t * output_len) 00118 __attribute__ ((deprecated)); 00119 extern GSASL_API int gsasl_decode_inline (Gsasl_session * sctx, 00120 const char *input, size_t input_len, 00121 char *output, size_t * output_len) 00122 __attribute__ ((deprecated)); 00123 extern GSASL_API void gsasl_application_data_set (Gsasl * ctx, void *appdata) 00124 __attribute__ ((deprecated)); 00125 extern GSASL_API void *gsasl_application_data_get (Gsasl * ctx) 00126 __attribute__ ((deprecated)); 00127 extern GSASL_API void gsasl_appinfo_set (Gsasl_session * sctx, void *appdata) 00128 __attribute__ ((deprecated)); 00129 extern GSASL_API void *gsasl_appinfo_get (Gsasl_session * sctx) 00130 __attribute__ ((deprecated)); 00131 extern GSASL_API const char *gsasl_server_suggest_mechanism (Gsasl * ctx, 00132 const char 00133 *mechlist) 00134 __attribute__ ((deprecated)); 00135 00136 extern GSASL_API int gsasl_base64_encode (char const *src, size_t srclength, 00137 char *target, size_t targsize) 00138 __attribute__ ((deprecated)); 00139 extern GSASL_API int gsasl_base64_decode (char const *src, 00140 char *target, size_t targsize) 00141 __attribute__ ((deprecated)); 00142 00143 extern GSASL_API char *gsasl_stringprep_nfkc (const char *in, ssize_t len) 00144 __attribute__ ((deprecated)); 00145 extern GSASL_API char *gsasl_stringprep_saslprep (const char *in, 00146 int *stringprep_rc) 00147 __attribute__ ((deprecated)); 00148 extern GSASL_API char *gsasl_stringprep_trace (const char *in, 00149 int *stringprep_rc) 00150 __attribute__ ((deprecated)); 00151 00152 extern GSASL_API int gsasl_md5pwd_get_password (const char *filename, 00153 const char *username, 00154 char *key, size_t * keylen) 00155 __attribute__ ((deprecated)); 00156 00157 /* Callback prototypes */ 00158 typedef int (*Gsasl_client_callback_anonymous) (Gsasl_session * sctx, 00159 char *out, size_t * outlen); 00160 typedef int (*Gsasl_client_callback_authentication_id) (Gsasl_session * sctx, 00161 char *out, 00162 size_t * outlen); 00163 typedef int (*Gsasl_client_callback_authorization_id) (Gsasl_session * sctx, 00164 char *out, 00165 size_t * outlen); 00166 typedef int (*Gsasl_client_callback_password) (Gsasl_session * sctx, 00167 char *out, size_t * outlen); 00168 typedef int (*Gsasl_client_callback_passcode) (Gsasl_session * sctx, 00169 char *out, size_t * outlen); 00170 typedef int (*Gsasl_client_callback_pin) (Gsasl_session * sctx, 00171 char *suggestion, char *out, 00172 size_t * outlen); 00173 typedef int (*Gsasl_client_callback_service) (Gsasl_session * sctx, 00174 char *service, 00175 size_t * servicelen, 00176 char *hostname, 00177 size_t * hostnamelen, 00178 char *servicename, 00179 size_t * servicenamelen); 00180 typedef Gsasl_qop (*Gsasl_client_callback_qop) (Gsasl_session * sctx, 00181 Gsasl_qop serverqops); 00182 typedef size_t (*Gsasl_client_callback_maxbuf) (Gsasl_session * sctx, 00183 size_t servermaxbuf); 00184 typedef int (*Gsasl_client_callback_realm) (Gsasl_session * sctx, char *out, 00185 size_t * outlen); 00186 typedef int (*Gsasl_server_callback_retrieve) (Gsasl_session * sctx, 00187 const char *authentication_id, 00188 const char *authorization_id, 00189 const char *realm, char *key, 00190 size_t * keylen); 00191 typedef int (*Gsasl_server_callback_validate) (Gsasl_session * sctx, 00192 const char *authorization_id, 00193 const char *authentication_id, 00194 const char *password); 00195 typedef int (*Gsasl_server_callback_gssapi) (Gsasl_session * sctx, 00196 const char *clientname, 00197 const char *authentication_id); 00198 typedef int (*Gsasl_server_callback_securid) (Gsasl_session * sctx, 00199 const char *authentication_id, 00200 const char *authorization_id, 00201 const char *passcode, char *pin, 00202 char *suggestpin, 00203 size_t * suggestpinlen); 00204 typedef int (*Gsasl_server_callback_cram_md5) (Gsasl_session * sctx, 00205 char *username, 00206 char *challenge, 00207 char *response); 00208 typedef int (*Gsasl_server_callback_digest_md5) (Gsasl_session * sctx, 00209 char *username, char *realm, 00210 char *secrethash); 00211 typedef int (*Gsasl_server_callback_service) (Gsasl_session * sctx, 00212 char *service, 00213 size_t * servicelen, 00214 char *hostname, 00215 size_t * hostnamelen); 00216 typedef int (*Gsasl_server_callback_external) (Gsasl_session * sctx); 00217 typedef int (*Gsasl_server_callback_anonymous) (Gsasl_session * sctx, 00218 const char *token); 00219 typedef int (*Gsasl_server_callback_realm) (Gsasl_session * sctx, char *out, 00220 size_t * outlen, size_t nth); 00221 typedef Gsasl_qop (*Gsasl_server_callback_qop) (Gsasl_session * sctx); 00222 typedef size_t (*Gsasl_server_callback_maxbuf) (Gsasl_session * sctx); 00223 typedef Gsasl_cipher (*Gsasl_server_callback_cipher) (Gsasl_session * sctx); 00224 00225 /* Obsolete client callbacks: callback-c.c */ 00226 extern GSASL_API void 00227 gsasl_client_callback_authorization_id_set 00228 (Gsasl * ctx, Gsasl_client_callback_authorization_id cb) 00229 __attribute__ ((deprecated)); 00230 extern GSASL_API Gsasl_client_callback_authorization_id 00231 gsasl_client_callback_authorization_id_get (Gsasl * ctx) 00232 __attribute__ ((deprecated)); 00233 00234 extern GSASL_API void 00235 gsasl_client_callback_authentication_id_set 00236 (Gsasl * ctx, Gsasl_client_callback_authentication_id cb) 00237 __attribute__ ((deprecated)); 00238 extern GSASL_API Gsasl_client_callback_authentication_id 00239 gsasl_client_callback_authentication_id_get (Gsasl * ctx) 00240 __attribute__ ((deprecated)); 00241 00242 extern GSASL_API void 00243 gsasl_client_callback_anonymous_set (Gsasl * ctx, 00244 Gsasl_client_callback_anonymous cb) 00245 __attribute__ ((deprecated)); 00246 extern GSASL_API Gsasl_client_callback_anonymous 00247 gsasl_client_callback_anonymous_get (Gsasl * ctx) 00248 __attribute__ ((deprecated)); 00249 00250 extern GSASL_API void 00251 gsasl_client_callback_password_set (Gsasl * ctx, 00252 Gsasl_client_callback_password cb) 00253 __attribute__ ((deprecated)); 00254 extern GSASL_API Gsasl_client_callback_password 00255 gsasl_client_callback_password_get (Gsasl * ctx) __attribute__ ((deprecated)); 00256 00257 extern GSASL_API void 00258 gsasl_client_callback_passcode_set (Gsasl * ctx, 00259 Gsasl_client_callback_passcode cb) 00260 __attribute__ ((deprecated)); 00261 extern GSASL_API Gsasl_client_callback_passcode 00262 gsasl_client_callback_passcode_get (Gsasl * ctx) __attribute__ ((deprecated)); 00263 00264 extern GSASL_API void 00265 gsasl_client_callback_pin_set (Gsasl * ctx, Gsasl_client_callback_pin cb) 00266 __attribute__ ((deprecated)); 00267 extern GSASL_API Gsasl_client_callback_pin 00268 gsasl_client_callback_pin_get (Gsasl * ctx) __attribute__ ((deprecated)); 00269 00270 extern GSASL_API void 00271 gsasl_client_callback_service_set (Gsasl * ctx, 00272 Gsasl_client_callback_service cb) 00273 __attribute__ ((deprecated)); 00274 extern GSASL_API Gsasl_client_callback_service 00275 gsasl_client_callback_service_get (Gsasl * ctx) __attribute__ ((deprecated)); 00276 00277 extern GSASL_API void 00278 gsasl_client_callback_qop_set (Gsasl * ctx, Gsasl_client_callback_qop cb) 00279 __attribute__ ((deprecated)); 00280 extern GSASL_API Gsasl_client_callback_qop 00281 gsasl_client_callback_qop_get (Gsasl * ctx) __attribute__ ((deprecated)); 00282 00283 extern GSASL_API void 00284 gsasl_client_callback_maxbuf_set (Gsasl * ctx, 00285 Gsasl_client_callback_maxbuf cb) 00286 __attribute__ ((deprecated)); 00287 extern GSASL_API Gsasl_client_callback_maxbuf 00288 gsasl_client_callback_maxbuf_get (Gsasl * ctx) __attribute__ ((deprecated)); 00289 extern GSASL_API 00290 void gsasl_client_callback_realm_set (Gsasl * ctx, 00291 Gsasl_client_callback_realm cb) 00292 __attribute__ ((deprecated)); 00293 extern GSASL_API Gsasl_client_callback_realm 00294 gsasl_client_callback_realm_get (Gsasl * ctx) __attribute__ ((deprecated)); 00295 00296 /* Obsolete server callbacks: callback-s.c */ 00297 extern GSASL_API void 00298 gsasl_server_callback_validate_set (Gsasl * ctx, 00299 Gsasl_server_callback_validate cb) 00300 __attribute__ ((deprecated)); 00301 extern GSASL_API Gsasl_server_callback_validate 00302 gsasl_server_callback_validate_get (Gsasl * ctx) __attribute__ ((deprecated)); 00303 00304 extern GSASL_API void 00305 gsasl_server_callback_retrieve_set (Gsasl * ctx, 00306 Gsasl_server_callback_retrieve cb) 00307 __attribute__ ((deprecated)); 00308 extern GSASL_API Gsasl_server_callback_retrieve 00309 gsasl_server_callback_retrieve_get (Gsasl * ctx) __attribute__ ((deprecated)); 00310 00311 extern GSASL_API void 00312 gsasl_server_callback_cram_md5_set (Gsasl * ctx, 00313 Gsasl_server_callback_cram_md5 cb) 00314 __attribute__ ((deprecated)); 00315 extern GSASL_API Gsasl_server_callback_cram_md5 00316 gsasl_server_callback_cram_md5_get (Gsasl * ctx) __attribute__ ((deprecated)); 00317 00318 extern GSASL_API void 00319 gsasl_server_callback_digest_md5_set (Gsasl * ctx, 00320 Gsasl_server_callback_digest_md5 cb) 00321 __attribute__ ((deprecated)); 00322 extern GSASL_API Gsasl_server_callback_digest_md5 00323 gsasl_server_callback_digest_md5_get (Gsasl * ctx) 00324 __attribute__ ((deprecated)); 00325 00326 extern GSASL_API void 00327 gsasl_server_callback_external_set (Gsasl * ctx, 00328 Gsasl_server_callback_external cb) 00329 __attribute__ ((deprecated)); 00330 extern GSASL_API Gsasl_server_callback_external 00331 gsasl_server_callback_external_get (Gsasl * ctx) __attribute__ ((deprecated)); 00332 00333 extern GSASL_API void 00334 gsasl_server_callback_anonymous_set (Gsasl * ctx, 00335 Gsasl_server_callback_anonymous cb) 00336 __attribute__ ((deprecated)); 00337 extern GSASL_API Gsasl_server_callback_anonymous 00338 gsasl_server_callback_anonymous_get (Gsasl * ctx) 00339 __attribute__ ((deprecated)); 00340 00341 extern GSASL_API void 00342 gsasl_server_callback_realm_set (Gsasl * ctx, Gsasl_server_callback_realm cb) 00343 __attribute__ ((deprecated)); 00344 extern GSASL_API Gsasl_server_callback_realm 00345 gsasl_server_callback_realm_get (Gsasl * ctx) __attribute__ ((deprecated)); 00346 00347 extern GSASL_API void 00348 gsasl_server_callback_qop_set (Gsasl * ctx, Gsasl_server_callback_qop cb) 00349 __attribute__ ((deprecated)); 00350 extern GSASL_API Gsasl_server_callback_qop 00351 gsasl_server_callback_qop_get (Gsasl * ctx) __attribute__ ((deprecated)); 00352 00353 extern GSASL_API void 00354 gsasl_server_callback_maxbuf_set (Gsasl * ctx, 00355 Gsasl_server_callback_maxbuf cb) 00356 __attribute__ ((deprecated)); 00357 extern GSASL_API Gsasl_server_callback_maxbuf 00358 gsasl_server_callback_maxbuf_get (Gsasl * ctx) __attribute__ ((deprecated)); 00359 00360 extern GSASL_API void 00361 gsasl_server_callback_cipher_set (Gsasl * ctx, 00362 Gsasl_server_callback_cipher cb) 00363 __attribute__ ((deprecated)); 00364 extern GSASL_API Gsasl_server_callback_cipher 00365 gsasl_server_callback_cipher_get (Gsasl * ctx) __attribute__ ((deprecated)); 00366 00367 extern GSASL_API void 00368 gsasl_server_callback_securid_set (Gsasl * ctx, 00369 Gsasl_server_callback_securid cb) 00370 __attribute__ ((deprecated)); 00371 extern GSASL_API Gsasl_server_callback_securid 00372 gsasl_server_callback_securid_get (Gsasl * ctx) __attribute__ ((deprecated)); 00373 00374 extern GSASL_API void 00375 gsasl_server_callback_gssapi_set (Gsasl * ctx, 00376 Gsasl_server_callback_gssapi cb) 00377 __attribute__ ((deprecated)); 00378 extern GSASL_API Gsasl_server_callback_gssapi 00379 gsasl_server_callback_gssapi_get (Gsasl * ctx) __attribute__ ((deprecated)); 00380 00381 extern GSASL_API void 00382 gsasl_server_callback_service_set (Gsasl * ctx, 00383 Gsasl_server_callback_service cb) 00384 __attribute__ ((deprecated)); 00385 extern GSASL_API Gsasl_server_callback_service 00386 gsasl_server_callback_service_get (Gsasl * ctx) __attribute__ ((deprecated)); 00387 00388 #endif /* GSASL_COMPAT_H */
1.7.6.1