1 /* Copyright (C) 2014 mod_auth_gssapi authors - See COPYING for (C) terms */
7 #define APR_WANT_STRFUNC
9 #include <apr_strings.h>
10 #include <apr_base64.h>
13 #include <http_core.h>
14 #include <http_connection.h>
16 #include <http_request.h>
17 #include <mod_session.h>
20 /* apache's httpd.h drags in empty PACKAGE_* variables.
21 * undefine them to avoid annoying compile warnings as they
22 * are re-defined in config.h */
23 #undef PACKAGE_BUGREPORT
26 #undef PACKAGE_TARNAME
27 #undef PACKAGE_VERSION
30 #include <gssapi/gssapi.h>
31 #include <gssapi/gssapi_ext.h>
32 #include <gssapi/gssapi_krb5.h>
33 #ifdef HAVE_GSSAPI_GSSAPI_NTLMSSP_H
34 # include <gssapi/gssapi_ntlmssp.h>
41 #define MIN_SESS_EXP_TIME 300 /* 5 minutes validity minimum */
43 #ifdef HAVE_GSS_ACQUIRE_CRED_FROM
44 # ifdef HAVE_GSS_STORE_CRED_INTO
45 #define HAVE_CRED_STORE 1
54 struct mag_name_attributes {
57 struct mag_na_map map[];
67 #ifdef HAVE_CRED_STORE
69 char *deleg_ccache_dir;
70 gss_key_value_set_desc *cred_store;
72 struct seal_key *mag_skey;
75 gss_OID_set_desc *allowed_mechs;
76 gss_OID_set_desc *basic_mechs;
78 struct mag_name_attributes *name_attributes;
81 struct mag_server_config {
82 gss_OID_set default_mechs;
83 struct seal_key *mag_skey;
88 struct mag_config *cfg;
89 gss_OID_set desired_mechs;
92 const char *req_proto;
93 const char *rep_proto;
94 struct seal_key *mag_skey;
106 const char *user_name;
107 const char *gss_name;
111 struct databuf basic_hash;
114 struct mag_attr *name_attributes;
117 #define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
119 struct mag_conn *mag_new_conn_ctx(apr_pool_t *pool);
120 const char *mag_str_auth_type(int auth_type);
121 char *mag_gss_name_to_ccache_name(request_rec *req,
122 char *dir, const char *gss_name);
123 char *mag_error(request_rec *req, const char *msg, uint32_t maj, uint32_t min);