~ubuntu-branches/ubuntu/trusty/serf/trusty-proposed

« back to all changes in this revision

Viewing changes to auth/auth_kerb.h

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2013-12-31 13:17:16 UTC
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20131231131716-z7lpavv1il3sxb7g
Tags: upstream-1.3.3
ImportĀ upstreamĀ versionĀ 1.3.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright 2010 Justin Erenkrantz and Greg Stein
2
 
 *
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
6
 
 *
7
 
 *     http://www.apache.org/licenses/LICENSE-2.0
8
 
 *
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.
14
 
 */
15
 
 
16
 
#ifndef AUTH_KERB_H
17
 
#define AUTH_KERB_H
18
 
 
19
 
#include <apr.h>
20
 
#include <apr_pools.h>
21
 
 
22
 
#if defined(SERF_HAVE_SSPI)
23
 
#define SERF_HAVE_KERB
24
 
#define SERF_USE_SSPI
25
 
#elif defined(SERF_HAVE_GSSAPI)
26
 
#define SERF_HAVE_KERB
27
 
#define SERF_USE_GSSAPI
28
 
#endif
29
 
 
30
 
#ifdef SERF_HAVE_KERB
31
 
 
32
 
#ifdef __cplusplus
33
 
extern "C" {
34
 
#endif
35
 
 
36
 
typedef struct serf__kerb_context_t serf__kerb_context_t;
37
 
 
38
 
typedef struct serf__kerb_buffer_t {
39
 
    apr_size_t length;
40
 
    void *value;
41
 
} serf__kerb_buffer_t;
42
 
 
43
 
/* Create outbound security context.
44
 
 *
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.
48
 
 *
49
 
 */
50
 
apr_status_t
51
 
serf__kerb_create_sec_context(serf__kerb_context_t **ctx_p,
52
 
                              apr_pool_t *scratch_pool,
53
 
                              apr_pool_t *result_pool);
54
 
 
55
 
/* Initialize outbound security context.
56
 
 *
57
 
 * The function is used to build a security context between the client
58
 
 * application and a remote peer.
59
 
 *
60
 
 * CTX is pointer to existing context created using
61
 
 * serf__kerb_create_sec_context() function.
62
 
 *
63
 
 * SERVICE is name of Kerberos service name. Usually 'HTTP'. HOSTNAME is
64
 
 * canonical name of destination server. Caller should resolve server's alias
65
 
 * to canonical name.
66
 
 *
67
 
 * INPUT_BUF is pointer structure describing input token if any. Should be
68
 
 * zero length on first call.
69
 
 *
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.
73
 
 *
74
 
 * All temporary allocations will be performed in SCRATCH_POOL.
75
 
 *
76
 
 * Return value:
77
 
 * - APR_EAGAIN The client must send the output token to the server and wait
78
 
 *   for a return token.
79
 
 *
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.
84
 
 *
85
 
 * Other returns values indicates error.
86
 
 */
87
 
apr_status_t
88
 
serf__kerb_init_sec_context(serf__kerb_context_t *ctx,
89
 
                            const char *service,
90
 
                            const char *hostname,
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
95
 
                            );
96
 
 
97
 
#ifdef __cplusplus
98
 
}
99
 
#endif
100
 
 
101
 
#endif    /* SERF_HAVE_KERB */
102
 
 
103
 
#endif    /* !AUTH_KERB_H */