passdb.h revision 74674a53a72dab535c61f455b2246ef2797844ea
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch ((pass)[0] != '\0' && (pass)[0] != '*' && (pass)[0] != '!')
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainentypedef void verify_plain_callback_t(enum passdb_result result,
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Boschtypedef void lookup_credentials_callback_t(enum passdb_result result,
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainen const unsigned char *credentials,
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainentypedef void set_credentials_callback_t(bool success,
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainen struct passdb_module *(*preinit)(pool_t pool, const char *args);
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainen /* Check if plaintext password matches */
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainen void (*verify_plain)(struct auth_request *request, const char *password,
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainen /* Return authentication credentials, set in
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainen auth_request->credentials. */
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainen void (*lookup_credentials)(struct auth_request *request,
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainen /* Update credentials */
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainen int (*set_credentials)(struct auth_request *request,
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainen /* The default caching key for this module, or NULL if caching isn't
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainen wanted. This is updated by settings in auth_passdb. */
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch#define default_cache_key cache_key /* FIXME: remove in v2.3 - for API backwards compatibility */
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch /* Default password scheme for this module.
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch If cache_key is set, must not be NULL. */
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch /* If blocking is set to TRUE, use child processes to access
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch this passdb. */
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch /* id is used by blocking passdb to identify the passdb */
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch unsigned int id;
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch /* number of time init() has been called */
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch/* Try to get credentials in wanted scheme (request->credentials_scheme) from
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch given input. Returns FALSE if this wasn't possible (unknown scheme,
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch conversion not possible or invalid credentials).
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch If wanted scheme is "", the credentials are returned as-is without any
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Bosch checks. This is useful mostly just to see if there exist any credentials
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainenbool passdb_get_credentials(struct auth_request *auth_request,
83773f7eb5e12e68f5efee7278bdab35d2ee84c0Timo Sirainen const unsigned char **credentials_r,
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Boschvoid passdb_handle_credentials(enum passdb_result result,
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Boschpassdb_preinit(pool_t pool, const struct auth_passdb_settings *set);
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Boschvoid passdb_init(struct passdb_module *passdb);
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Boschvoid passdb_deinit(struct passdb_module *passdb);
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Boschvoid passdb_register_module(struct passdb_module_interface *iface);
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Boschvoid passdb_unregister_module(struct passdb_module_interface *iface);
836e690c0e2d7494b8c0a6f4984dd13248841f2fStephan Boschvoid passdbs_generate_md5(unsigned char md5[MD5_RESULTLEN]);