diff options
author | Arno Töll <arno@debian.org> | 2012-11-21 23:03:34 +0100 |
---|---|---|
committer | Arno Töll <arno@debian.org> | 2012-11-21 23:03:34 +0100 |
commit | eb45c46b906e492f063f1469486190e93ff340ff (patch) | |
tree | 85d615969fa7bf8056a05b59006f77bc63e85892 /src/http_auth.h | |
parent | 6426b37107707a1d95ffd03f68620cbda8bdb942 (diff) | |
download | lighttpd-eb45c46b906e492f063f1469486190e93ff340ff.tar.gz |
Imported Upstream version 1.4.10upstream/1.4.10
Diffstat (limited to 'src/http_auth.h')
-rw-r--r-- | src/http_auth.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/http_auth.h b/src/http_auth.h new file mode 100644 index 0000000..0b664fa --- /dev/null +++ b/src/http_auth.h @@ -0,0 +1,68 @@ +#ifndef _HTTP_AUTH_H_ +#define _HTTP_AUTH_H_ + +#include "server.h" +#include "plugin.h" + +#if defined(HAVE_LDAP_H) && defined(HAVE_LBER_H) && defined(HAVE_LIBLDAP) && defined(HAVE_LIBLBER) +# define USE_LDAP +# include <ldap.h> +#endif + +typedef enum { AUTH_BACKEND_UNSET, AUTH_BACKEND_PLAIN, + AUTH_BACKEND_LDAP, AUTH_BACKEND_HTPASSWD, + AUTH_BACKEND_HTDIGEST, AUTH_BACKEND_PAM } auth_backend_t; + +typedef struct { + /* auth */ + array *auth_require; + + buffer *auth_plain_groupfile; + buffer *auth_plain_userfile; + + buffer *auth_htdigest_userfile; + buffer *auth_htpasswd_userfile; + + buffer *auth_backend_conf; + + buffer *auth_ldap_hostname; + buffer *auth_ldap_basedn; + buffer *auth_ldap_binddn; + buffer *auth_ldap_bindpw; + buffer *auth_ldap_filter; + buffer *auth_ldap_cafile; + unsigned short auth_ldap_starttls; + + unsigned short auth_debug; + + /* generated */ + auth_backend_t auth_backend; + +#ifdef USE_LDAP + LDAP *ldap; + + buffer *ldap_filter_pre; + buffer *ldap_filter_post; +#endif +} mod_auth_plugin_config; + +typedef struct { + PLUGIN_DATA; + buffer *tmp_buf; + + buffer *auth_user; + +#ifdef USE_LDAP + buffer *ldap_filter; +#endif + + mod_auth_plugin_config **config_storage; + + mod_auth_plugin_config conf; /* this is only used as long as no handler_ctx is setup */ +} mod_auth_plugin_data; + +int http_auth_basic_check(server *srv, connection *con, mod_auth_plugin_data *p, array *req, buffer *url, const char *realm_str); +int http_auth_digest_check(server *srv, connection *con, mod_auth_plugin_data *p, array *req, buffer *url, const char *realm_str); +int http_auth_digest_generate_nonce(server *srv, mod_auth_plugin_data *p, buffer *fn, char hh[33]); + +#endif |