1 /* $Id: authsasl.c,v 1.3 2004/10/21 00:10:49 mrsam Exp $ */
4 ** Copyright 1998 - 2000 Double Precision, Inc. See COPYING for
5 ** distribution information.
8 #include "courier_auth_config.h"
9 #include "courierauthsasl.h"
15 /* Use the SASL_LIST macro to build authsasl_list */
17 #define SASL(a,b,c) int b(const char *, const char *, \
18 char *(*)(const char *, void *), \
26 #define SASL(a,b,c) {a, b},
28 struct authsasl_info authsasl_list
[] = {
34 int auth_sasl(const char *method
,
35 const char *initreply
,
36 char *(*callback_func
)(const char *, void *),
38 char **authtype_ptr
, /* Returned - AUTHTYPE */
44 if ((p
=malloc(strlen(method
)+1)) == 0)
48 *q
=toupper((int)(unsigned char)*q
);
50 for (i
=0; authsasl_list
[i
].sasl_method
; i
++)
52 if (strcmp(p
, authsasl_list
[i
].sasl_method
) == 0)
55 return ( (*authsasl_list
[i
].sasl_func
)
57 initreply
, callback_func
,
59 authtype_ptr
, authdata_ptr
));
64 return (AUTHSASL_ERROR
);