Import Debian changes 0.69.0-2
[hcoop/debian/courier-authlib.git] / courierauthsasl.h
index ac00fec..e57b21e 100644 (file)
@@ -2,7 +2,7 @@
 #define        courierauthsasl_h
 
 /*
-** Copyright 1998 - 2004 Double Precision, Inc.  See COPYING for
+** Copyright 1998 - 2013 Double Precision, Inc.  See COPYING for
 ** distribution information.
 */
 
@@ -13,7 +13,6 @@
 extern "C" {
 #endif
 
-static const char courierauthsasl_h_rcsid[]="$Id: courierauthsasl.h,v 1.1 2004/10/21 00:10:49 mrsam Exp $";
 
 /*
        These family of functions are used to implement the SASL interface
@@ -23,7 +22,7 @@ static const char courierauthsasl_h_rcsid[]="$Id: courierauthsasl.h,v 1.1 2004/1
 */
 
 /*
-**     auth_sasl searched for the right method, and calls the appropriate
+**     auth_sasl searches for the right method, and calls the appropriate
 **     sasl function.  authsasl received the following arguments:
 **
 **     initresponse -- initial response for the authentication request,
@@ -49,6 +48,29 @@ int auth_sasl(const char *,          /* Method */
              char **,                  /* Returned - AUTHTYPE */
              char **);                 /* Returned - AUTHDATA */
 
+/*
+** auth_sasl_ex() is a version of auth_sasl that takes an extra parameter,
+** externalauth. If method is "EXTERNAL" and externalauth is not a NULL pointer
+** and does not point to an empty string, it is recognized as a SASL EXTERRNAL
+** authentication.
+*/
+
+int auth_sasl_ex(const char *method,
+                const char *initresponse,
+                const char *externalauth, /* out-of-band authentified identity */
+                char *(*callback_func)(const char *, void *),
+                void *callback_arg,
+                char **authtype_ptr,
+                char **authdata_ptr);
+
+       /*
+       ** Given authtype and authdata, return the userid in the authentication
+       ** request. Returns a malloced buffer.
+       */
+char *auth_sasl_extract_userid(const char *authtype,
+                              const char *authdata);
+
+
 
        /* INTERNAL FUNCTIONS BELOW */