|
|
char *mail_auth(char *mechanism, authresponse_t resp, int argc, char *argv[]);
This server function searches the list of authenticators that was established by auth_link for an authenticator with the given name. If an authenticator is found, authentication is initialized. The function pointed to by resp is called as the authenticator requires responses.
AUTHENTICATOR *mail_lookup_auth(unsigned int i);
This function returns the ith authenticator in the list, where i is the value of it.
unsigned int mail_lookup_auth_name(char *mechanism);
This function searches the list of authenticators for an authenticator with the given name, and returns its position in the authenticator list.
The functions below are provided by C client client drivers or by servers to support the protocol-dependent parts of authentication.
typedef void *(*authchallenge_t)(void *stream, unsigned long *len);
This driver function is called by an authenticator to read a challenge from the given protocol stream in a protocol-dependent way. It returns that challenge in binary and its length in octets to the authenticator.
typedef long (*authrespond_t)(void *stream, char *s, unsigned long size);
This driver function is called by an authenticator to send a challenge response to the given stream in a protocol-dependent way. It returns T if successful, NIL if failure.
typedef char *(*authresponse_t)(void *challenge, unsigned long clen, unsigned long *rlen);
This server function is called with a challenge string of clen octets. It sends, according to whatever protocol (IMAP, POP, and so on) it uses, and returns the received response and response length in octets.
typedef long (*authclient_t)(authchallenge_t challenger, authrespond_t responder, NETMBX *mb, void *s, unsigned long trial);
This client authenticator function negotiates reading challenges and sending responses for a particular authenticator over the protocol, and returns T if authenticated or NIL if failed.
typedef char *(*authserver_t)(authresponse_t responder, int argc, char *argv[]);
This server authenticator function negotiates sending challenges and reading responses for a particular authenticator, and returns either the authenticated user name or NIL if authentication failed.