Adding testing CLI client (based off the Heimdal testing sample)
[mod_auth_kerb.cvs/.git] / mod_auth_gssapi.h
1 #ifndef __MOD_AUTH_GSSAPI_H__
2 #define __MOD_AUTH_GSSAPI_H__
3
4 #include <httpd.h>
5 #include <http_config.h>
6 #include <http_core.h>
7 #include <http_log.h>
8 #include <http_protocol.h>
9 #include <http_request.h>
10
11 #include <apr_base64.h>
12 #include <apr_strings.h>
13
14 #include <gssapi.h>
15 /* XXX */
16 #define GSS_KRB5_NT_PRINCIPAL_NAME 0xdeaddead
17
18 #ifndef GSSAPI_SUPPORTS_SPNEGO
19 #include "spnegokrb5.h"
20 #endif
21
22 #define SERVICE_NAME "HTTP"
23
24 typedef struct {
25     const char *service_name;
26     const char *krb5_keytab;
27 } gss_auth_config;
28
29 typedef struct gss_conn_ctx_t {
30     gss_ctx_id_t context;
31     enum {
32         GSS_CTX_EMPTY,
33         GSS_CTX_IN_PROGRESS,
34         GSS_CTX_ESTABLISHED,
35     } state;
36     char *user;
37 } *gss_conn_ctx;
38
39 void
40 gss_log(const char *file, int line, int level, int status,
41         const request_rec *r, const char *fmt, ...);
42
43 int
44 gss_authenticate(request_rec *r, gss_auth_config *conf, gss_conn_ctx ctx,
45                  const char *auth_line, char **negotiate_ret_value);
46 #endif