2 * Copyright (c) 2004 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 #define KRB5_CCAPI_H 1
39 #include <krb5-types.h>
63 ccErrInvalidString
, /* 206 */
64 ccErrInvalidCredentials
,
65 ccErrInvalidCCacheIterator
,
66 ccErrInvalidCredentialsIterator
,
69 ccErrBadName
, /* 211 */
70 ccErrBadCredentialsVersion
,
75 ccErrCCacheLocked
, /* 216 */
79 ccErrCredentialsNotFound
,
81 ccErrCCacheNotFound
, /* 221 */
83 ccErrServerUnavailable
,
85 ccErrServerCantBecomeUID
,
87 ccErrTimeOffsetNotSet
/* 226 */
90 typedef int32_t cc_int32
;
91 typedef uint32_t cc_uint32
;
92 typedef struct cc_context_t
*cc_context_t
;
93 typedef struct cc_ccache_t
*cc_ccache_t
;
94 typedef struct cc_ccache_iterator_t
*cc_ccache_iterator_t
;
95 typedef struct cc_credentials_v5_t cc_credentials_v5_t
;
96 typedef struct cc_credentials_t
*cc_credentials_t
;
97 typedef struct cc_credentials_iterator_t
*cc_credentials_iterator_t
;
98 typedef struct cc_string_t
*cc_string_t
;
99 typedef cc_uint32 cc_time_t
;
101 typedef struct cc_data
{
107 struct cc_credentials_v5_t
{
114 cc_time_t renew_till
;
116 cc_uint32 ticket_flags
;
117 #define KRB5_CCAPI_TKT_FLG_FORWARDABLE 0x40000000
118 #define KRB5_CCAPI_TKT_FLG_FORWARDED 0x20000000
119 #define KRB5_CCAPI_TKT_FLG_PROXIABLE 0x10000000
120 #define KRB5_CCAPI_TKT_FLG_PROXY 0x08000000
121 #define KRB5_CCAPI_TKT_FLG_MAY_POSTDATE 0x04000000
122 #define KRB5_CCAPI_TKT_FLG_POSTDATED 0x02000000
123 #define KRB5_CCAPI_TKT_FLG_INVALID 0x01000000
124 #define KRB5_CCAPI_TKT_FLG_RENEWABLE 0x00800000
125 #define KRB5_CCAPI_TKT_FLG_INITIAL 0x00400000
126 #define KRB5_CCAPI_TKT_FLG_PRE_AUTH 0x00200000
127 #define KRB5_CCAPI_TKT_FLG_HW_AUTH 0x00100000
128 #define KRB5_CCAPI_TKT_FLG_TRANSIT_POLICY_CHECKED 0x00080000
129 #define KRB5_CCAPI_TKT_FLG_OK_AS_DELEGATE 0x00040000
130 #define KRB5_CCAPI_TKT_FLG_ANONYMOUS 0x00020000
133 cc_data second_ticket
;
138 typedef struct cc_string_functions
{
139 cc_int32 (*release
)(cc_string_t
);
140 } cc_string_functions
;
144 const cc_string_functions
*func
;
147 typedef struct cc_credentials_union
{
150 cc_credentials_v5_t
* credentials_v5
;
152 } cc_credentials_union
;
154 struct cc_credentials_functions
{
155 cc_int32 (*release
)(cc_credentials_t
);
156 cc_int32 (*compare
)(cc_credentials_t
, cc_credentials_t
, cc_uint32
*);
159 struct cc_credentials_t
{
160 const cc_credentials_union
* data
;
161 const struct cc_credentials_functions
* func
;
164 struct cc_credentials_iterator_functions
{
165 cc_int32 (*release
)(cc_credentials_iterator_t
);
166 cc_int32 (*next
)(cc_credentials_iterator_t
, cc_credentials_t
*);
169 struct cc_credentials_iterator_t
{
170 const struct cc_credentials_iterator_functions
*func
;
173 struct cc_ccache_iterator_functions
{
174 cc_int32 (*release
) (cc_ccache_iterator_t
);
175 cc_int32 (*next
)(cc_ccache_iterator_t
, cc_ccache_t
*);
178 struct cc_ccache_iterator_t
{
179 const struct cc_ccache_iterator_functions
* func
;
182 typedef struct cc_ccache_functions
{
183 cc_int32 (*release
)(cc_ccache_t
);
184 cc_int32 (*destroy
)(cc_ccache_t
);
185 cc_int32 (*set_default
)(cc_ccache_t
);
186 cc_int32 (*get_credentials_version
)(cc_ccache_t
, cc_uint32
*);
187 cc_int32 (*get_name
)(cc_ccache_t
, cc_string_t
*);
188 cc_int32 (*get_principal
)(cc_ccache_t
, cc_uint32
, cc_string_t
*);
189 cc_int32 (*set_principal
)(cc_ccache_t
, cc_uint32
, const char*);
190 cc_int32 (*store_credentials
)(cc_ccache_t
, const cc_credentials_union
*);
191 cc_int32 (*remove_credentials
)(cc_ccache_t
, cc_credentials_t
);
192 cc_int32 (*new_credentials_iterator
)(cc_ccache_t
,
193 cc_credentials_iterator_t
*);
194 cc_int32 (*move
)(cc_ccache_t
, cc_ccache_t
);
195 cc_int32 (*lock
)(cc_ccache_t
, cc_uint32
, cc_uint32
);
196 cc_int32 (*unlock
)(cc_ccache_t
);
197 cc_int32 (*get_last_default_time
)(cc_ccache_t
, cc_time_t
*);
198 cc_int32 (*get_change_time
)(cc_ccache_t
, cc_time_t
*);
199 cc_int32 (*compare
)(cc_ccache_t
, cc_ccache_t
, cc_uint32
*);
200 cc_int32 (*get_kdc_time_offset
)(cc_ccache_t
, cc_int32
, cc_time_t
*);
201 cc_int32 (*set_kdc_time_offset
)(cc_ccache_t
, cc_int32
, cc_time_t
);
202 cc_int32 (*clear_kdc_time_offset
)(cc_ccache_t
, cc_int32
);
203 } cc_ccache_functions
;
206 const cc_ccache_functions
*func
;
209 struct cc_context_functions
{
210 cc_int32 (*release
)(cc_context_t
);
211 cc_int32 (*get_change_time
)(cc_context_t
, cc_time_t
*);
212 cc_int32 (*get_default_ccache_name
)(cc_context_t
, cc_string_t
*);
213 cc_int32 (*open_ccache
)(cc_context_t
, const char*, cc_ccache_t
*);
214 cc_int32 (*open_default_ccache
)(cc_context_t
, cc_ccache_t
*);
215 cc_int32 (*create_ccache
)(cc_context_t
,const char*, cc_uint32
,
216 const char*, cc_ccache_t
*);
217 cc_int32 (*create_default_ccache
)(cc_context_t
, cc_uint32
,
218 const char*, cc_ccache_t
*);
219 cc_int32 (*create_new_ccache
)(cc_context_t
, cc_uint32
,
220 const char*, cc_ccache_t
*);
221 cc_int32 (*new_ccache_iterator
)(cc_context_t
, cc_ccache_iterator_t
*);
222 cc_int32 (*lock
)(cc_context_t
, cc_uint32
, cc_uint32
);
223 cc_int32 (*unlock
)(cc_context_t
);
224 cc_int32 (*compare
)(cc_context_t
, cc_context_t
, cc_uint32
*);
227 struct cc_context_t
{
228 const struct cc_context_functions
* func
;
232 (*cc_initialize_func
)(cc_context_t
*, cc_int32
, cc_int32
*, char const **);
239 #endif /* KRB5_CCAPI_H */