1
/* Copyright 2010 Justin Erenkrantz and Greg Stein
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
7
* http://www.apache.org/licenses/LICENSE-2.0
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
20
#include <apr_pools.h>
22
#if defined(SERF_HAVE_SSPI)
23
#define SERF_HAVE_KERB
25
#elif defined(SERF_HAVE_GSSAPI)
26
#define SERF_HAVE_KERB
27
#define SERF_USE_GSSAPI
36
typedef struct serf__kerb_context_t serf__kerb_context_t;
38
typedef struct serf__kerb_buffer_t {
41
} serf__kerb_buffer_t;
43
/* Create outbound security context.
45
* All temporary allocations will be performed in SCRATCH_POOL, while security
46
* context will be allocated in result_pool and will be destroyed automatically
47
* on RESULT_POOL cleanup.
51
serf__kerb_create_sec_context(serf__kerb_context_t **ctx_p,
52
apr_pool_t *scratch_pool,
53
apr_pool_t *result_pool);
55
/* Initialize outbound security context.
57
* The function is used to build a security context between the client
58
* application and a remote peer.
60
* CTX is pointer to existing context created using
61
* serf__kerb_create_sec_context() function.
63
* SERVICE is name of Kerberos service name. Usually 'HTTP'. HOSTNAME is
64
* canonical name of destination server. Caller should resolve server's alias
67
* INPUT_BUF is pointer structure describing input token if any. Should be
68
* zero length on first call.
70
* OUTPUT_BUF will be populated with pointer to output data that should send
71
* to destination server. This buffer will be automatically freed on
72
* RESULT_POOL cleanup.
74
* All temporary allocations will be performed in SCRATCH_POOL.
77
* - APR_EAGAIN The client must send the output token to the server and wait
80
* - APR_SUCCESS The security context was successfully initialized. There is no
81
* need for another serf__kerb_init_sec_context call. If the function returns
82
* an output token, that is, if the OUTPUT_BUF is of nonzero length, that
83
* token must be sent to the server.
85
* Other returns values indicates error.
88
serf__kerb_init_sec_context(serf__kerb_context_t *ctx,
91
serf__kerb_buffer_t *input_buf,
92
serf__kerb_buffer_t *output_buf,
93
apr_pool_t *scratch_pool,
94
apr_pool_t *result_pool
101
#endif /* SERF_HAVE_KERB */
103
#endif /* !AUTH_KERB_H */