X-Git-Url: https://git.hcoop.net/hcoop/debian/courier-authlib.git/blobdiff_plain/2c58f61c7faca7723da35ffd7924af764108e9fd..4c84ffe42fc2303e8675ff7fffd063e5fe687828:/courierauth.h diff --git a/courierauth.h b/courierauth.h index b94b0cb..0ee0faa 100644 --- a/courierauth.h +++ b/courierauth.h @@ -13,7 +13,9 @@ extern "C" { #endif -static const char courierauth_h_rcsid[]="$Id: courierauth.h,v 1.6 2009/12/18 04:33:45 mrsam Exp $"; +#if 0 +} +#endif /* Callback authentication structure: @@ -124,9 +126,68 @@ extern char *auth_getoption(const char *options, const char *keyword); int auth_callback_default(struct authinfo *ainfo); +/* +** If the AUTH_MKHOMEDIR_SKEL environment variable is set, and the +** authenticated account's home directory does not exist, the home directory +** gets created, with its initial contents copied from AUTH_MKHOMEDIR_SKEL +** which must be a directory, typically /etc/skel. +*/ + +int auth_mkhomedir(struct authinfo *info); + +/* +** Like auth_callback_default, but calls auth_mkhomedir(). +*/ + +int auth_callback_default_autocreate(struct authinfo *ainfo); + /* Utility function: escape LDAP special characters */ char *courier_auth_ldap_escape(const char *str); + +struct cram_callback_info { + struct hmac_hashinfo *h; + char *user; + char *challenge; + char *response; + int (*callback_func)(struct authinfo *, void *); + void *callback_arg; + }; + +extern int auth_cram_callback(struct authinfo *a, void *vp); + +/* +** auth_get_cram parses out an authentication request. It checks whether +** we have the requisite hash function installed, and, if so, base64decodes +** the challenge and the response. +*/ + +struct hmac_hashinfo; + +int auth_get_cram(const char *authtype, /* authtype */ + char *authdata, /* authdata */ + + struct cram_callback_info *craminfo); + /* Initializes craminfo */ + +/* auth_get_cram_silent() is auth_get_cram(), but without logging */ + +int auth_get_cram_silent(const char *authtype, char *authdata, + struct cram_callback_info *craminfo); + +/* +** auth_verify_cram attempts to verify the secret cookie. +*/ + +int auth_verify_cram(struct hmac_hashinfo *, /* The hash function */ + const char *, /* The challenge */ + const char *, /* The response */ + const char *); /* Hashed secret, in hex */ + +#if 0 +{ +#endif + #ifdef __cplusplus } #endif