| sasl.h | | sasl.h | |
| | | | |
| skipping to change at line 90 | | skipping to change at line 90 | |
| * 6. continue with application protocol until connection closes | | * 6. continue with application protocol until connection closes | |
| * call sasl_getprop/sasl_encode/sasl_decode() if using security layer | | * call sasl_getprop/sasl_encode/sasl_decode() if using security layer | |
| * 7. call sasl_dispose(), may return to step 2 | | * 7. call sasl_dispose(), may return to step 2 | |
| * 8. call sasl_done() when program terminates | | * 8. call sasl_done() when program terminates | |
| * | | * | |
| */ | | */ | |
| | | | |
| #ifndef SASL_H | | #ifndef SASL_H | |
| #define SASL_H 1 | | #define SASL_H 1 | |
| | | | |
|
| | | #define SASL_VERSION_MAJOR 1 | |
| | | #define SASL_VERSION_MINOR 5 | |
| | | #define SASL_VERSION_STEP 15 | |
| | | | |
| /* The following ifdef block is the standard way of creating macros | | /* The following ifdef block is the standard way of creating macros | |
| * which make exporting from a DLL simpler. All files within this DLL | | * which make exporting from a DLL simpler. All files within this DLL | |
| * are compiled with the LIBSASL_EXPORTS symbol defined on the command | | * are compiled with the LIBSASL_EXPORTS symbol defined on the command | |
| * line. this symbol should not be defined on any project that uses | | * line. this symbol should not be defined on any project that uses | |
| * this DLL. This way any other project whose source files include | | * this DLL. This way any other project whose source files include | |
| * this file see LIBSASL_API functions as being imported from a DLL, | | * this file see LIBSASL_API functions as being imported from a DLL, | |
| * wheras this DLL sees symbols defined with this macro as being | | * wheras this DLL sees symbols defined with this macro as being | |
| * exported. */ | | * exported. */ | |
| /* Under Unix, life is simpler: we just need to mark library functions | | /* Under Unix, life is simpler: we just need to mark library functions | |
| * as extern. (Technically, we don't even have to do that.) */ | | * as extern. (Technically, we don't even have to do that.) */ | |
| #ifdef WIN32 | | #ifdef WIN32 | |
| # ifdef LIBSASL_EXPORTS | | # ifdef LIBSASL_EXPORTS | |
| # define LIBSASL_API __declspec(dllexport) | | # define LIBSASL_API __declspec(dllexport) | |
| # else /* LIBSASL_EXPORTS */ | | # else /* LIBSASL_EXPORTS */ | |
| # define LIBSASL_API __declspec(dllimport) | | # define LIBSASL_API __declspec(dllimport) | |
| # endif /* LIBSASL_EXPORTS */ | | # endif /* LIBSASL_EXPORTS */ | |
| #else /* WIN32 */ | | #else /* WIN32 */ | |
| # define LIBSASL_API extern | | # define LIBSASL_API extern | |
| #endif /* WIN32 */ | | #endif /* WIN32 */ | |
| | | | |
|
| LIBSASL_API int _sasl_debug; | | | |
| | | | |
| /************* | | /************* | |
| * Basic API * | | * Basic API * | |
| *************/ | | *************/ | |
| | | | |
| /* SASL result codes: */ | | /* SASL result codes: */ | |
| #define SASL_CONTINUE (1) /* another step is needed in authentication */ | | #define SASL_CONTINUE (1) /* another step is needed in authentication */ | |
| #define SASL_OK (0) /* successful result */ | | #define SASL_OK (0) /* successful result */ | |
| #define SASL_FAIL (-1) /* generic failure */ | | #define SASL_FAIL (-1) /* generic failure */ | |
| #define SASL_NOMEM (-2) /* memory shortage failure */ | | #define SASL_NOMEM (-2) /* memory shortage failure */ | |
| #define SASL_BUFOVER (-3) /* overflowed buffer */ | | #define SASL_BUFOVER (-3) /* overflowed buffer */ | |
| | | | |
| skipping to change at line 458 | | skipping to change at line 460 | |
| | | | |
| /* prompt (or autoselect) the realm to do authentication in. | | /* prompt (or autoselect) the realm to do authentication in. | |
| * may get a list of valid realms. | | * may get a list of valid realms. | |
| * input: | | * input: | |
| * context -- context from callback structure | | * context -- context from callback structure | |
| * id -- callback id | | * id -- callback id | |
| * availrealms -- available realms; string list; NULL terminated | | * availrealms -- available realms; string list; NULL terminated | |
| * output: | | * output: | |
| * result -- NUL terminated realm; NULL is equivalent to "" | | * result -- NUL terminated realm; NULL is equivalent to "" | |
| * returns SASL_OK | | * returns SASL_OK | |
|
| | | * result must persist until the next callback | |
| */ | | */ | |
|
| | | | |
| /* If there is an interaction with SASL_CB_GETREALM the challenge of | | /* If there is an interaction with SASL_CB_GETREALM the challenge of | |
| * the sasl_interact_t will be of the format: {realm1, realm2, | | * the sasl_interact_t will be of the format: {realm1, realm2, | |
| * ...}. That is a list of possible realms seperated by comma spaces | | * ...}. That is a list of possible realms seperated by comma spaces | |
| * enclosed by brackets. | | * enclosed by brackets. | |
| */ | | */ | |
|
| | | | |
| typedef int sasl_getrealm_t(void *context, int id, | | typedef int sasl_getrealm_t(void *context, int id, | |
| const char **availrealms, | | const char **availrealms, | |
| const char **result); | | const char **result); | |
| #define SASL_CB_GETREALM (0x4007) /* realm to attempt authentication in */ | | #define SASL_CB_GETREALM (0x4007) /* realm to attempt authentication in */ | |
| | | | |
| /* server callbacks: | | /* server callbacks: | |
| */ | | */ | |
| /* callback to verify authorization | | /* callback to verify authorization | |
| * requested_user -- the identity/username to authorize | | * requested_user -- the identity/username to authorize | |
| * auth_identity -- the identity associated with the secret | | * auth_identity -- the identity associated with the secret | |
|
| | | * if the identity is not in the realm specified in | |
| | | * sasl_server_new, it will be of the form user@realm | |
| * return: | | * return: | |
| * user -- NULL = requested_user, otherwise canonicalized | | * user -- NULL = requested_user, otherwise canonicalized | |
| * errstr -- can be set to error string on failure | | * errstr -- can be set to error string on failure | |
| * returns SASL_OK on success, SASL_BADAUTH or other SASL response on failu
re | | * returns SASL_OK on success, SASL_BADAUTH or other SASL response on failu
re | |
| */ | | */ | |
| typedef int sasl_authorize_t(void *context, | | typedef int sasl_authorize_t(void *context, | |
| const char *auth_identity, | | const char *auth_identity, | |
| const char *requested_user, | | const char *requested_user, | |
| const char **user, | | const char **user, | |
| const char **errstr); | | const char **errstr); | |
| #define SASL_CB_PROXY_POLICY (0x8001) | | #define SASL_CB_PROXY_POLICY (0x8001) | |
| | | | |
| /* callback to lookup a user's secret for a mechanism | | /* callback to lookup a user's secret for a mechanism | |
| * mechanism -- the mechanism requesting its secret | | * mechanism -- the mechanism requesting its secret | |
| * auth_identity -- the identity being looked up | | * auth_identity -- the identity being looked up | |
|
| | | * realm -- the realm the identity is in | |
| * return: | | * return: | |
| * secret -- the secret associated with this user | | * secret -- the secret associated with this user | |
| * for this mechanism | | * for this mechanism | |
| * returns SASL_OK on success or other SASL response on failure | | * returns SASL_OK on success or other SASL response on failure | |
| */ | | */ | |
| typedef int sasl_server_getsecret_t(void *context, | | typedef int sasl_server_getsecret_t(void *context, | |
| const char *mechanism, | | const char *mechanism, | |
| const char *auth_identity, | | const char *auth_identity, | |
|
| | | const char *realm, | |
| sasl_secret_t ** secret); | | sasl_secret_t ** secret); | |
| #define SASL_CB_SERVER_GETSECRET (0x8002) | | #define SASL_CB_SERVER_GETSECRET (0x8002) | |
| | | | |
| /* callback to store a user's secret for a mechanism | | /* callback to store a user's secret for a mechanism | |
| * mechanism -- the mechanism storing its secret | | * mechanism -- the mechanism storing its secret | |
| * auth_identity -- the identity being stored | | * auth_identity -- the identity being stored | |
|
| | | * realm -- the realm the identity is in | |
| * secret -- the secret associated with this user | | * secret -- the secret associated with this user | |
| * for this mechanism. If NULL, user's secret | | * for this mechanism. If NULL, user's secret | |
| * for this mechanism will be erased. | | * for this mechanism will be erased. | |
| * returns SASL_OK on success or other SASL response on failure | | * returns SASL_OK on success or other SASL response on failure | |
| */ | | */ | |
| typedef int sasl_server_putsecret_t(void *context, | | typedef int sasl_server_putsecret_t(void *context, | |
| const char *mechanism, | | const char *mechanism, | |
| const char *auth_identity, | | const char *auth_identity, | |
|
| | | const char *realm, | |
| const sasl_secret_t * secret); | | const sasl_secret_t * secret); | |
| #define SASL_CB_SERVER_PUTSECRET (0x8003) | | #define SASL_CB_SERVER_PUTSECRET (0x8003) | |
| | | | |
| /********************************** | | /********************************** | |
| * Common Client/server functions * | | * Common Client/server functions * | |
| **********************************/ | | **********************************/ | |
| | | | |
| /* dispose of all SASL plugins. Connection | | /* dispose of all SASL plugins. Connection | |
| * states have to be disposed of before calling this. | | * states have to be disposed of before calling this. | |
| */ | | */ | |
| | | | |
End of changes. 10 change blocks. |
| 4 lines changed or deleted | | 11 lines changed or added | |
|