Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/sasl
File: sasl.h
/* This is a proposed C API for support of SASL
[0] Fix | Delete
*
[1] Fix | Delete
*********************************IMPORTANT*******************************
[2] Fix | Delete
* send email to chris.newman@innosoft.com and cyrus-bugs@andrew.cmu.edu *
[3] Fix | Delete
* if you need to add new error codes, callback types, property values, *
[4] Fix | Delete
* etc. It is important to keep the multiple implementations of this *
[5] Fix | Delete
* API from diverging. *
[6] Fix | Delete
*********************************IMPORTANT*******************************
[7] Fix | Delete
*
[8] Fix | Delete
* Basic Type Summary:
[9] Fix | Delete
* sasl_conn_t Context for a SASL connection negotiation
[10] Fix | Delete
* sasl_ssf_t Security layer Strength Factor
[11] Fix | Delete
* sasl_callback_t A typed client/server callback function and context
[12] Fix | Delete
* sasl_interact_t A client interaction descriptor
[13] Fix | Delete
* sasl_secret_t A client password
[14] Fix | Delete
* sasl_rand_t Random data context structure
[15] Fix | Delete
* sasl_security_properties_t An application's required security level
[16] Fix | Delete
*
[17] Fix | Delete
* Callbacks:
[18] Fix | Delete
* sasl_getopt_t client/server: Get an option value
[19] Fix | Delete
* sasl_logmsg_t client/server: Log message handler
[20] Fix | Delete
* sasl_getsimple_t client: Get user/language list
[21] Fix | Delete
* sasl_getsecret_t client: Get authentication secret
[22] Fix | Delete
* sasl_chalprompt_t client: Display challenge and prompt for response
[23] Fix | Delete
*
[24] Fix | Delete
* Server only Callbacks:
[25] Fix | Delete
* sasl_authorize_t user authorization policy callback
[26] Fix | Delete
* sasl_getconfpath_t get path to search for config file
[27] Fix | Delete
* sasl_server_userdb_checkpass check password and auxprops in userdb
[28] Fix | Delete
* sasl_server_userdb_setpass set password in userdb
[29] Fix | Delete
* sasl_server_canon_user canonicalize username routine
[30] Fix | Delete
*
[31] Fix | Delete
* Client/Server Function Summary:
[32] Fix | Delete
* sasl_done Release all SASL global state
[33] Fix | Delete
* sasl_dispose Connection done: Dispose of sasl_conn_t
[34] Fix | Delete
* sasl_getprop Get property (e.g., user name, security layer info)
[35] Fix | Delete
* sasl_setprop Set property (e.g., external ssf)
[36] Fix | Delete
* sasl_errdetail Generate string from last error on connection
[37] Fix | Delete
* sasl_errstring Translate sasl error code to a string
[38] Fix | Delete
* sasl_encode Encode data to send using security layer
[39] Fix | Delete
* sasl_decode Decode data received using security layer
[40] Fix | Delete
*
[41] Fix | Delete
* Utility functions:
[42] Fix | Delete
* sasl_encode64 Encode data to send using MIME base64 encoding
[43] Fix | Delete
* sasl_decode64 Decode data received using MIME base64 encoding
[44] Fix | Delete
* sasl_erasebuffer Erase a buffer
[45] Fix | Delete
*
[46] Fix | Delete
* Client Function Summary:
[47] Fix | Delete
* sasl_client_init Load and initialize client plug-ins (call once)
[48] Fix | Delete
* sasl_client_new Initialize client connection context: sasl_conn_t
[49] Fix | Delete
* sasl_client_start Select mechanism for connection
[50] Fix | Delete
* sasl_client_step Perform one authentication step
[51] Fix | Delete
*
[52] Fix | Delete
* Server Function Summary
[53] Fix | Delete
* sasl_server_init Load and initialize server plug-ins (call once)
[54] Fix | Delete
* sasl_server_new Initialize server connection context: sasl_conn_t
[55] Fix | Delete
* sasl_listmech Create list of available mechanisms
[56] Fix | Delete
* sasl_server_start Begin an authentication exchange
[57] Fix | Delete
* sasl_server_step Perform one authentication exchange step
[58] Fix | Delete
* sasl_checkpass Check a plaintext passphrase
[59] Fix | Delete
* sasl_checkapop Check an APOP challenge/response (uses pseudo "APOP"
[60] Fix | Delete
* mechanism similar to CRAM-MD5 mechanism; optional)
[61] Fix | Delete
* sasl_user_exists Check if user exists
[62] Fix | Delete
* sasl_setpass Change a password or add a user entry
[63] Fix | Delete
* sasl_auxprop_request Request auxiliary properties
[64] Fix | Delete
* sasl_auxprop_getctx Get auxiliary property context for connection
[65] Fix | Delete
* sasl_auxprop_store Store a set of auxiliary properties
[66] Fix | Delete
*
[67] Fix | Delete
* Basic client model:
[68] Fix | Delete
* 1. client calls sasl_client_init() at startup to load plug-ins
[69] Fix | Delete
* 2. when connection formed, call sasl_client_new()
[70] Fix | Delete
* 3. once list of supported mechanisms received from server, client
[71] Fix | Delete
* calls sasl_client_start(). goto 4a
[72] Fix | Delete
* 4. client calls sasl_client_step()
[73] Fix | Delete
* [4a. If SASL_INTERACT, fill in prompts and goto 4
[74] Fix | Delete
* -- doesn't happen if callbacks provided]
[75] Fix | Delete
* 4b. If SASL error, goto 7 or 3
[76] Fix | Delete
* 4c. If SASL_OK, continue or goto 6 if last server response was success
[77] Fix | Delete
* 5. send message to server, wait for response
[78] Fix | Delete
* 5a. On data or success with server response, goto 4
[79] Fix | Delete
* 5b. On failure goto 7 or 3
[80] Fix | Delete
* 5c. On success with no server response continue
[81] Fix | Delete
* 6. continue with application protocol until connection closes
[82] Fix | Delete
* call sasl_getprop/sasl_encode/sasl_decode() if using security layer
[83] Fix | Delete
* 7. call sasl_dispose(), may return to step 2
[84] Fix | Delete
* 8. call sasl_done() when program terminates
[85] Fix | Delete
*
[86] Fix | Delete
* Basic Server model:
[87] Fix | Delete
* 1. call sasl_server_init() at startup to load plug-ins
[88] Fix | Delete
* 2. On connection, call sasl_server_new()
[89] Fix | Delete
* 3. call sasl_listmech() and send list to client]
[90] Fix | Delete
* 4. after client AUTH command, call sasl_server_start(), goto 5a
[91] Fix | Delete
* 5. call sasl_server_step()
[92] Fix | Delete
* 5a. If SASL_CONTINUE, output to client, wait response, repeat 5
[93] Fix | Delete
* 5b. If SASL error, then goto 7
[94] Fix | Delete
* 5c. If SASL_OK, move on
[95] Fix | Delete
* 6. continue with application protocol until connection closes
[96] Fix | Delete
* call sasl_getprop to get username
[97] Fix | Delete
* call sasl_getprop/sasl_encode/sasl_decode() if using security layer
[98] Fix | Delete
* 7. call sasl_dispose(), may return to step 2
[99] Fix | Delete
* 8. call sasl_done() when program terminates
[100] Fix | Delete
*
[101] Fix | Delete
*************************************************
[102] Fix | Delete
* IMPORTANT NOTE: server realms / username syntax
[103] Fix | Delete
*
[104] Fix | Delete
* If a user name contains a "@", then the rightmost "@" in the user name
[105] Fix | Delete
* separates the account name from the realm in which this account is
[106] Fix | Delete
* located. A single server may support multiple realms. If the
[107] Fix | Delete
* server knows the realm at connection creation time (e.g., a server
[108] Fix | Delete
* with multiple IP addresses tightly binds one address to a specific
[109] Fix | Delete
* realm) then that realm must be passed in the user_realm field of
[110] Fix | Delete
* the sasl_server_new call. If user_realm is non-empty and an
[111] Fix | Delete
* unqualified user name is supplied, then the canon_user facility is
[112] Fix | Delete
* expected to append "@" and user_realm to the user name. The canon_user
[113] Fix | Delete
* facility may treat other characters such as "%" as equivalent to "@".
[114] Fix | Delete
*
[115] Fix | Delete
* If the server forbids the use of "@" in user names for other
[116] Fix | Delete
* purposes, this simplifies security validation.
[117] Fix | Delete
*/
[118] Fix | Delete
[119] Fix | Delete
#ifndef SASL_H
[120] Fix | Delete
#define SASL_H 1
[121] Fix | Delete
[122] Fix | Delete
#include <stddef.h> /* For size_t */
[123] Fix | Delete
[124] Fix | Delete
/* Keep in sync with win32/common.mak */
[125] Fix | Delete
#define SASL_VERSION_MAJOR 2
[126] Fix | Delete
#define SASL_VERSION_MINOR 1
[127] Fix | Delete
#define SASL_VERSION_STEP 27
[128] Fix | Delete
[129] Fix | Delete
/* A convenience macro: same as was defined in the OpenLDAP LDAPDB */
[130] Fix | Delete
#define SASL_VERSION_FULL ((SASL_VERSION_MAJOR << 16) |\
[131] Fix | Delete
(SASL_VERSION_MINOR << 8) | SASL_VERSION_STEP)
[132] Fix | Delete
[133] Fix | Delete
#include "prop.h"
[134] Fix | Delete
[135] Fix | Delete
/*************
[136] Fix | Delete
* Basic API *
[137] Fix | Delete
*************/
[138] Fix | Delete
[139] Fix | Delete
/* SASL result codes: */
[140] Fix | Delete
#define SASL_CONTINUE 1 /* another step is needed in authentication */
[141] Fix | Delete
#define SASL_OK 0 /* successful result */
[142] Fix | Delete
#define SASL_FAIL -1 /* generic failure */
[143] Fix | Delete
#define SASL_NOMEM -2 /* memory shortage failure */
[144] Fix | Delete
#define SASL_BUFOVER -3 /* overflowed buffer */
[145] Fix | Delete
#define SASL_NOMECH -4 /* mechanism not supported */
[146] Fix | Delete
#define SASL_BADPROT -5 /* bad protocol / cancel */
[147] Fix | Delete
#define SASL_NOTDONE -6 /* can't request info until later in exchange */
[148] Fix | Delete
#define SASL_BADPARAM -7 /* invalid parameter supplied */
[149] Fix | Delete
#define SASL_TRYAGAIN -8 /* transient failure (e.g., weak key) */
[150] Fix | Delete
#define SASL_BADMAC -9 /* integrity check failed */
[151] Fix | Delete
#define SASL_NOTINIT -12 /* SASL library not initialized */
[152] Fix | Delete
/* -- client only codes -- */
[153] Fix | Delete
#define SASL_INTERACT 2 /* needs user interaction */
[154] Fix | Delete
#define SASL_BADSERV -10 /* server failed mutual authentication step */
[155] Fix | Delete
#define SASL_WRONGMECH -11 /* mechanism doesn't support requested feature */
[156] Fix | Delete
/* -- server only codes -- */
[157] Fix | Delete
#define SASL_BADAUTH -13 /* authentication failure */
[158] Fix | Delete
#define SASL_NOAUTHZ -14 /* authorization failure */
[159] Fix | Delete
#define SASL_TOOWEAK -15 /* mechanism too weak for this user */
[160] Fix | Delete
#define SASL_ENCRYPT -16 /* encryption needed to use mechanism */
[161] Fix | Delete
#define SASL_TRANS -17 /* One time use of a plaintext password will
[162] Fix | Delete
enable requested mechanism for user */
[163] Fix | Delete
#define SASL_EXPIRED -18 /* passphrase expired, has to be reset */
[164] Fix | Delete
#define SASL_DISABLED -19 /* account disabled */
[165] Fix | Delete
#define SASL_NOUSER -20 /* user not found */
[166] Fix | Delete
#define SASL_BADVERS -23 /* version mismatch with plug-in */
[167] Fix | Delete
#define SASL_UNAVAIL -24 /* remote authentication server unavailable */
[168] Fix | Delete
#define SASL_NOVERIFY -26 /* user exists, but no verifier for user */
[169] Fix | Delete
/* -- codes for password setting -- */
[170] Fix | Delete
#define SASL_PWLOCK -21 /* passphrase locked */
[171] Fix | Delete
#define SASL_NOCHANGE -22 /* requested change was not needed */
[172] Fix | Delete
#define SASL_WEAKPASS -27 /* passphrase is too weak for security policy */
[173] Fix | Delete
#define SASL_NOUSERPASS -28 /* user supplied passwords not permitted */
[174] Fix | Delete
#define SASL_NEED_OLD_PASSWD -29 /* sasl_setpass needs old password in order
[175] Fix | Delete
to perform password change */
[176] Fix | Delete
#define SASL_CONSTRAINT_VIOLAT -30 /* a property can't be stored,
[177] Fix | Delete
because of some constrains/policy violation */
[178] Fix | Delete
[179] Fix | Delete
#define SASL_BADBINDING -32 /* channel binding failure */
[180] Fix | Delete
#define SASL_CONFIGERR -100 /* error when parsing configuration file */
[181] Fix | Delete
[182] Fix | Delete
/* max size of a sasl mechanism name */
[183] Fix | Delete
#define SASL_MECHNAMEMAX 20
[184] Fix | Delete
[185] Fix | Delete
#ifdef _WIN32
[186] Fix | Delete
/* Define to have the same layout as a WSABUF */
[187] Fix | Delete
#ifndef STRUCT_IOVEC_DEFINED
[188] Fix | Delete
#define STRUCT_IOVEC_DEFINED 1
[189] Fix | Delete
struct iovec {
[190] Fix | Delete
long iov_len;
[191] Fix | Delete
char *iov_base;
[192] Fix | Delete
};
[193] Fix | Delete
#endif
[194] Fix | Delete
#else
[195] Fix | Delete
struct iovec; /* Defined in OS headers */
[196] Fix | Delete
#endif
[197] Fix | Delete
[198] Fix | Delete
[199] Fix | Delete
/* per-connection SASL negotiation state for client or server
[200] Fix | Delete
*/
[201] Fix | Delete
typedef struct sasl_conn sasl_conn_t;
[202] Fix | Delete
[203] Fix | Delete
/* Plain text password structure.
[204] Fix | Delete
* len is the length of the password, data is the text.
[205] Fix | Delete
*/
[206] Fix | Delete
typedef struct sasl_secret {
[207] Fix | Delete
unsigned long len;
[208] Fix | Delete
unsigned char data[1]; /* variable sized */
[209] Fix | Delete
} sasl_secret_t;
[210] Fix | Delete
[211] Fix | Delete
/* random data context structure
[212] Fix | Delete
*/
[213] Fix | Delete
typedef struct sasl_rand_s sasl_rand_t;
[214] Fix | Delete
[215] Fix | Delete
#ifdef __cplusplus
[216] Fix | Delete
extern "C" {
[217] Fix | Delete
#endif
[218] Fix | Delete
[219] Fix | Delete
/****************************
[220] Fix | Delete
* Configure Basic Services *
[221] Fix | Delete
****************************/
[222] Fix | Delete
[223] Fix | Delete
/* the following functions are used to adjust how allocation and mutexes work
[224] Fix | Delete
* they must be called before all other SASL functions:
[225] Fix | Delete
*/
[226] Fix | Delete
[227] Fix | Delete
#include <sys/types.h>
[228] Fix | Delete
[229] Fix | Delete
/* memory allocation functions which may optionally be replaced:
[230] Fix | Delete
*/
[231] Fix | Delete
typedef void *sasl_malloc_t(size_t);
[232] Fix | Delete
typedef void *sasl_calloc_t(size_t, size_t);
[233] Fix | Delete
typedef void *sasl_realloc_t(void *, size_t);
[234] Fix | Delete
typedef void sasl_free_t(void *);
[235] Fix | Delete
[236] Fix | Delete
LIBSASL_API void sasl_set_alloc(sasl_malloc_t *,
[237] Fix | Delete
sasl_calloc_t *,
[238] Fix | Delete
sasl_realloc_t *,
[239] Fix | Delete
sasl_free_t *);
[240] Fix | Delete
[241] Fix | Delete
/* mutex functions which may optionally be replaced:
[242] Fix | Delete
* sasl_mutex_alloc allocates a mutex structure
[243] Fix | Delete
* sasl_mutex_lock blocks until mutex locked
[244] Fix | Delete
* returns -1 on deadlock or parameter error
[245] Fix | Delete
* returns 0 on success
[246] Fix | Delete
* sasl_mutex_unlock unlocks mutex if it's locked
[247] Fix | Delete
* returns -1 if not locked or parameter error
[248] Fix | Delete
* returns 0 on success
[249] Fix | Delete
* sasl_mutex_free frees a mutex structure
[250] Fix | Delete
*/
[251] Fix | Delete
typedef void *sasl_mutex_alloc_t(void);
[252] Fix | Delete
typedef int sasl_mutex_lock_t(void *mutex);
[253] Fix | Delete
typedef int sasl_mutex_unlock_t(void *mutex);
[254] Fix | Delete
typedef void sasl_mutex_free_t(void *mutex);
[255] Fix | Delete
LIBSASL_API void sasl_set_mutex(sasl_mutex_alloc_t *, sasl_mutex_lock_t *,
[256] Fix | Delete
sasl_mutex_unlock_t *, sasl_mutex_free_t *);
[257] Fix | Delete
[258] Fix | Delete
/*****************************
[259] Fix | Delete
* Security preference types *
[260] Fix | Delete
*****************************/
[261] Fix | Delete
[262] Fix | Delete
/* security layer strength factor -- an unsigned integer usable by the caller
[263] Fix | Delete
* to specify approximate security layer strength desired. Roughly
[264] Fix | Delete
* correlated to effective key length for encryption.
[265] Fix | Delete
* 0 = no protection
[266] Fix | Delete
* 1 = integrity protection only
[267] Fix | Delete
* 40 = 40-bit DES or 40-bit RC2/RC4
[268] Fix | Delete
* 56 = DES
[269] Fix | Delete
* 112 = triple-DES
[270] Fix | Delete
* 128 = 128-bit RC2/RC4/BLOWFISH
[271] Fix | Delete
* 256 = baseline AES
[272] Fix | Delete
*/
[273] Fix | Delete
typedef unsigned sasl_ssf_t;
[274] Fix | Delete
[275] Fix | Delete
/* usage flags provided to sasl_server_new and sasl_client_new:
[276] Fix | Delete
*/
[277] Fix | Delete
#define SASL_SUCCESS_DATA 0x0004 /* server supports data on success */
[278] Fix | Delete
#define SASL_NEED_PROXY 0x0008 /* require a mech that allows proxying */
[279] Fix | Delete
#define SASL_NEED_HTTP 0x0010 /* require a mech that can do HTTP auth */
[280] Fix | Delete
[281] Fix | Delete
/***************************
[282] Fix | Delete
* Security Property Types *
[283] Fix | Delete
***************************/
[284] Fix | Delete
[285] Fix | Delete
/* Structure specifying the client or server's security policy
[286] Fix | Delete
* and optional additional properties.
[287] Fix | Delete
*/
[288] Fix | Delete
[289] Fix | Delete
/* These are the various security flags apps can specify. */
[290] Fix | Delete
/* NOPLAINTEXT -- don't permit mechanisms susceptible to simple
[291] Fix | Delete
* passive attack (e.g., PLAIN, LOGIN)
[292] Fix | Delete
* NOACTIVE -- protection from active (non-dictionary) attacks
[293] Fix | Delete
* during authentication exchange.
[294] Fix | Delete
* Authenticates server.
[295] Fix | Delete
* NODICTIONARY -- don't permit mechanisms susceptible to passive
[296] Fix | Delete
* dictionary attack
[297] Fix | Delete
* FORWARD_SECRECY -- require forward secrecy between sessions
[298] Fix | Delete
* (breaking one won't help break next)
[299] Fix | Delete
* NOANONYMOUS -- don't permit mechanisms that allow anonymous login
[300] Fix | Delete
* PASS_CREDENTIALS -- require mechanisms which pass client
[301] Fix | Delete
* credentials, and allow mechanisms which can pass
[302] Fix | Delete
* credentials to do so
[303] Fix | Delete
* MUTUAL_AUTH -- require mechanisms which provide mutual
[304] Fix | Delete
* authentication
[305] Fix | Delete
*/
[306] Fix | Delete
#define SASL_SEC_NOPLAINTEXT 0x0001
[307] Fix | Delete
#define SASL_SEC_NOACTIVE 0x0002
[308] Fix | Delete
#define SASL_SEC_NODICTIONARY 0x0004
[309] Fix | Delete
#define SASL_SEC_FORWARD_SECRECY 0x0008
[310] Fix | Delete
#define SASL_SEC_NOANONYMOUS 0x0010
[311] Fix | Delete
#define SASL_SEC_PASS_CREDENTIALS 0x0020
[312] Fix | Delete
#define SASL_SEC_MUTUAL_AUTH 0x0040
[313] Fix | Delete
#define SASL_SEC_MAXIMUM 0x00FF
[314] Fix | Delete
[315] Fix | Delete
typedef struct sasl_security_properties
[316] Fix | Delete
{
[317] Fix | Delete
/* security strength factor
[318] Fix | Delete
* min_ssf = minimum acceptable final level
[319] Fix | Delete
* max_ssf = maximum acceptable final level
[320] Fix | Delete
*/
[321] Fix | Delete
sasl_ssf_t min_ssf;
[322] Fix | Delete
sasl_ssf_t max_ssf;
[323] Fix | Delete
[324] Fix | Delete
/* Maximum security layer receive buffer size.
[325] Fix | Delete
* 0=security layer not supported
[326] Fix | Delete
*/
[327] Fix | Delete
unsigned maxbufsize;
[328] Fix | Delete
[329] Fix | Delete
/* bitfield for attacks to protect against */
[330] Fix | Delete
unsigned security_flags;
[331] Fix | Delete
[332] Fix | Delete
/* NULL terminated array of additional property names, values */
[333] Fix | Delete
const char **property_names;
[334] Fix | Delete
const char **property_values;
[335] Fix | Delete
} sasl_security_properties_t;
[336] Fix | Delete
[337] Fix | Delete
/******************
[338] Fix | Delete
* Callback types *
[339] Fix | Delete
******************/
[340] Fix | Delete
[341] Fix | Delete
/*
[342] Fix | Delete
* Extensible type for a client/server callbacks
[343] Fix | Delete
* id -- identifies callback type
[344] Fix | Delete
* proc -- procedure call arguments vary based on id
[345] Fix | Delete
* context -- context passed to procedure
[346] Fix | Delete
*/
[347] Fix | Delete
/* Note that any memory that is allocated by the callback needs to be
[348] Fix | Delete
* freed by the application, be it via function call or interaction.
[349] Fix | Delete
*
[350] Fix | Delete
* It may be freed after sasl_*_step returns SASL_OK. if the mechanism
[351] Fix | Delete
* requires this information to persist (for a security layer, for example)
[352] Fix | Delete
* it must maintain a private copy.
[353] Fix | Delete
*/
[354] Fix | Delete
typedef struct sasl_callback {
[355] Fix | Delete
/* Identifies the type of the callback function.
[356] Fix | Delete
* Mechanisms must ignore callbacks with id's they don't recognize.
[357] Fix | Delete
*/
[358] Fix | Delete
unsigned long id;
[359] Fix | Delete
int (*proc)(void); /* Callback function. Types of arguments vary by 'id' */
[360] Fix | Delete
void *context;
[361] Fix | Delete
} sasl_callback_t;
[362] Fix | Delete
[363] Fix | Delete
/* callback ids & functions:
[364] Fix | Delete
*/
[365] Fix | Delete
#define SASL_CB_LIST_END 0 /* end of list */
[366] Fix | Delete
[367] Fix | Delete
/* option reading callback -- this allows a SASL configuration to be
[368] Fix | Delete
* encapsulated in the caller's configuration system. Some implementations
[369] Fix | Delete
* may use default config file(s) if this is omitted. Configuration items
[370] Fix | Delete
* may be plugin-specific and are arbitrary strings.
[371] Fix | Delete
*
[372] Fix | Delete
* inputs:
[373] Fix | Delete
* context -- option context from callback record
[374] Fix | Delete
* plugin_name -- name of plugin (NULL = general SASL option)
[375] Fix | Delete
* option -- name of option
[376] Fix | Delete
* output:
[377] Fix | Delete
* result -- set to result which persists until next getopt in
[378] Fix | Delete
* same thread, unchanged if option not found
[379] Fix | Delete
* len -- length of result (may be NULL)
[380] Fix | Delete
* returns:
[381] Fix | Delete
* SASL_OK -- no error
[382] Fix | Delete
* SASL_FAIL -- error
[383] Fix | Delete
*/
[384] Fix | Delete
typedef int sasl_getopt_t(void *context, const char *plugin_name,
[385] Fix | Delete
const char *option,
[386] Fix | Delete
const char **result, unsigned *len);
[387] Fix | Delete
#define SASL_CB_GETOPT 1
[388] Fix | Delete
[389] Fix | Delete
/* Logging levels for use with the logging callback function. */
[390] Fix | Delete
#define SASL_LOG_NONE 0 /* don't log anything */
[391] Fix | Delete
#define SASL_LOG_ERR 1 /* log unusual errors (default) */
[392] Fix | Delete
#define SASL_LOG_FAIL 2 /* log all authentication failures */
[393] Fix | Delete
#define SASL_LOG_WARN 3 /* log non-fatal warnings */
[394] Fix | Delete
#define SASL_LOG_NOTE 4 /* more verbose than LOG_WARN */
[395] Fix | Delete
#define SASL_LOG_DEBUG 5 /* more verbose than LOG_NOTE */
[396] Fix | Delete
#define SASL_LOG_TRACE 6 /* traces of internal protocols */
[397] Fix | Delete
#define SASL_LOG_PASS 7 /* traces of internal protocols, including
[398] Fix | Delete
* passwords */
[399] Fix | Delete
[400] Fix | Delete
/* logging callback -- this allows plugins and the middleware to
[401] Fix | Delete
* log operations they perform.
[402] Fix | Delete
* inputs:
[403] Fix | Delete
* context -- logging context from the callback record
[404] Fix | Delete
* level -- logging level; see above
[405] Fix | Delete
* message -- message to log
[406] Fix | Delete
* returns:
[407] Fix | Delete
* SASL_OK -- no error
[408] Fix | Delete
* SASL_FAIL -- error
[409] Fix | Delete
*/
[410] Fix | Delete
typedef int sasl_log_t(void *context,
[411] Fix | Delete
int level,
[412] Fix | Delete
const char *message);
[413] Fix | Delete
#define SASL_CB_LOG 2
[414] Fix | Delete
[415] Fix | Delete
/* getpath callback -- this allows applications to specify the
[416] Fix | Delete
* colon-separated path to search for plugins (by default,
[417] Fix | Delete
* taken from an implementation-specific location).
[418] Fix | Delete
* inputs:
[419] Fix | Delete
* context -- getpath context from the callback record
[420] Fix | Delete
* outputs:
[421] Fix | Delete
* path -- colon seperated path
[422] Fix | Delete
* returns:
[423] Fix | Delete
* SASL_OK -- no error
[424] Fix | Delete
* SASL_FAIL -- error
[425] Fix | Delete
*/
[426] Fix | Delete
typedef int sasl_getpath_t(void *context,
[427] Fix | Delete
const char **path);
[428] Fix | Delete
[429] Fix | Delete
#define SASL_CB_GETPATH 3
[430] Fix | Delete
[431] Fix | Delete
/* verify file callback -- this allows applications to check if they
[432] Fix | Delete
* want SASL to use files, file by file. This is intended to allow
[433] Fix | Delete
* applications to sanity check the environment to make sure plugins
[434] Fix | Delete
* or the configuration file can't be written to, etc.
[435] Fix | Delete
* inputs:
[436] Fix | Delete
* context -- verifypath context from the callback record
[437] Fix | Delete
* file -- full path to file to verify
[438] Fix | Delete
* type -- type of file to verify (see below)
[439] Fix | Delete
[440] Fix | Delete
* returns:
[441] Fix | Delete
* SASL_OK -- no error (file can safely be used)
[442] Fix | Delete
* SASL_CONTINUE -- continue WITHOUT using this file
[443] Fix | Delete
* SASL_FAIL -- error
[444] Fix | Delete
*/
[445] Fix | Delete
[446] Fix | Delete
/* these are the types of files libsasl will ask about */
[447] Fix | Delete
typedef enum {
[448] Fix | Delete
SASL_VRFY_PLUGIN=0, /* a DLL/shared library plug-in */
[449] Fix | Delete
SASL_VRFY_CONF=1, /* a configuration file */
[450] Fix | Delete
SASL_VRFY_PASSWD=2, /* a password storage file/db */
[451] Fix | Delete
SASL_VRFY_OTHER=3 /* some other file */
[452] Fix | Delete
} sasl_verify_type_t;
[453] Fix | Delete
[454] Fix | Delete
typedef int sasl_verifyfile_t(void *context,
[455] Fix | Delete
const char *file, sasl_verify_type_t type);
[456] Fix | Delete
#define SASL_CB_VERIFYFILE 4
[457] Fix | Delete
[458] Fix | Delete
/* getconfpath callback -- this allows applications to specify the
[459] Fix | Delete
* colon-separated path to search for config files (by default,
[460] Fix | Delete
* taken from the SASL_CONF_PATH environment variable).
[461] Fix | Delete
* inputs:
[462] Fix | Delete
* context -- getconfpath context from the callback record
[463] Fix | Delete
* outputs:
[464] Fix | Delete
* path -- colon seperated path (allocated on the heap; the
[465] Fix | Delete
* library will free it using the sasl_free_t *
[466] Fix | Delete
* passed to sasl_set_callback, or the standard free()
[467] Fix | Delete
* library call).
[468] Fix | Delete
* returns:
[469] Fix | Delete
* SASL_OK -- no error
[470] Fix | Delete
* SASL_FAIL -- error
[471] Fix | Delete
*/
[472] Fix | Delete
typedef int sasl_getconfpath_t(void *context,
[473] Fix | Delete
char **path);
[474] Fix | Delete
[475] Fix | Delete
#define SASL_CB_GETCONFPATH 5
[476] Fix | Delete
[477] Fix | Delete
/* client/user interaction callbacks:
[478] Fix | Delete
*/
[479] Fix | Delete
/* Simple prompt -- result must persist until next call to getsimple on
[480] Fix | Delete
* same connection or until connection context is disposed
[481] Fix | Delete
* inputs:
[482] Fix | Delete
* context -- context from callback structure
[483] Fix | Delete
* id -- callback id
[484] Fix | Delete
* outputs:
[485] Fix | Delete
* result -- set to NUL terminated string
[486] Fix | Delete
* NULL = user cancel
[487] Fix | Delete
* len -- length of result
[488] Fix | Delete
* returns SASL_OK
[489] Fix | Delete
*/
[490] Fix | Delete
typedef int sasl_getsimple_t(void *context, int id,
[491] Fix | Delete
const char **result, unsigned *len);
[492] Fix | Delete
#define SASL_CB_USER 0x4001 /* client user identity to login as */
[493] Fix | Delete
#define SASL_CB_AUTHNAME 0x4002 /* client authentication name */
[494] Fix | Delete
#define SASL_CB_LANGUAGE 0x4003 /* comma separated list of RFC 1766
[495] Fix | Delete
* language codes in order of preference
[496] Fix | Delete
* to be used to localize client prompts
[497] Fix | Delete
* or server error codes */
[498] Fix | Delete
#define SASL_CB_CNONCE 0x4007 /* caller supplies client-nonce
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function