More work on keeping cred_store functions optional
[mod_auth_gssapi.git] / src / mod_auth_gssapi.h
1 /* Copyright (C) 2014 mod_auth_gssapi authors - See COPYING for (C) terms */
2
3 #include <stdbool.h>
4 #include <stdint.h>
5 #include <time.h>
6 #include <gssapi/gssapi.h>
7 #include <gssapi/gssapi_ext.h>
8 #include <gssapi/gssapi_krb5.h>
9
10 #define APR_WANT_STRFUNC
11 #include "apr_want.h"
12 #include <apr_strings.h>
13 #include <apr_base64.h>
14
15 #include <httpd.h>
16 #include <http_core.h>
17 #include <http_connection.h>
18 #include <http_log.h>
19 #include <http_request.h>
20 #include <mod_session.h>
21 #include <mod_ssl.h>
22
23 /* apache's httpd.h drags in empty PACKAGE_* variables.
24  * undefine them to avoid annoying compile warnings as they
25  * are re-defined in config.h */
26 #undef PACKAGE_BUGREPORT
27 #undef PACKAGE_NAME
28 #undef PACKAGE_STRING
29 #undef PACKAGE_TARNAME
30 #undef PACKAGE_VERSION
31 #include "config.h"
32
33 #include "crypto.h"
34 #include "sessions.h"
35
36 #define MIN_SESS_EXP_TIME 300 /* 5 minutes validity minimum */
37
38 #ifdef HAVE_GSS_ACQUIRE_CRED_FROM
39 #  ifdef HAVE_GSS_STORE_CRED_INTO
40 #define HAVE_CRED_STORE 1
41 #  endif
42 #endif
43
44 struct mag_config {
45     apr_pool_t *pool;
46     bool ssl_only;
47     bool map_to_local;
48     bool gss_conn_ctx;
49     bool send_persist;
50     bool use_sessions;
51 #ifdef HAVE_CRED_STORE
52     bool use_s4u2proxy;
53     char *deleg_ccache_dir;
54     gss_key_value_set_desc *cred_store;
55 #endif
56     struct seal_key *mag_skey;
57     bool use_basic_auth;
58 };
59
60 struct mag_conn {
61     apr_pool_t *parent;
62     gss_ctx_id_t ctx;
63     bool established;
64     const char *user_name;
65     const char *gss_name;
66     time_t expiration;
67     const char *auth_type;
68 };