xref: /freebsd/crypto/krb5/src/windows/lib/cacheapi.h (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert /* windows/lib/cacheapi.h */
2*7f2fe78bSCy Schubert /*
3*7f2fe78bSCy Schubert  * Copyright 1997 by the Regents of the University of Michigan
4*7f2fe78bSCy Schubert  *
5*7f2fe78bSCy Schubert  * This software is being provided to you, the LICENSEE, by the
6*7f2fe78bSCy Schubert  * Regents of the University of Michigan (UM) under the following
7*7f2fe78bSCy Schubert  * license.  By obtaining, using and/or copying this software, you agree
8*7f2fe78bSCy Schubert  * that you have read, understood, and will comply with these terms and
9*7f2fe78bSCy Schubert  * conditions:
10*7f2fe78bSCy Schubert  *
11*7f2fe78bSCy Schubert  * Permission to use, copy, modify and distribute this software and its
12*7f2fe78bSCy Schubert  * documentation for any purpose and without fee or royalty is hereby
13*7f2fe78bSCy Schubert  * granted, provided that you agree to comply with the following copyright
14*7f2fe78bSCy Schubert  * notice and statements, including the disclaimer, and that the same
15*7f2fe78bSCy Schubert  * appear on ALL copies of the software and documentation, including
16*7f2fe78bSCy Schubert  * modifications that you make for internal use or for distribution:
17*7f2fe78bSCy Schubert  *
18*7f2fe78bSCy Schubert  * Copyright 1997 by the Regents of the University of Michigan.
19*7f2fe78bSCy Schubert  * All rights reserved.
20*7f2fe78bSCy Schubert  *
21*7f2fe78bSCy Schubert  * THIS SOFTWARE IS PROVIDED "AS IS", AND UM MAKES NO REPRESENTATIONS
22*7f2fe78bSCy Schubert  * OR WARRANTIES, EXPRESS OR IMPLIED.  By way of example, but not
23*7f2fe78bSCy Schubert  * limitation, UM MAKES NO REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY
24*7f2fe78bSCy Schubert  * OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED
25*7f2fe78bSCy Schubert  * SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS,
26*7f2fe78bSCy Schubert  * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
27*7f2fe78bSCy Schubert  *
28*7f2fe78bSCy Schubert  * The name of the University of Michigan or UM may NOT be used in
29*7f2fe78bSCy Schubert  * advertising or publicity pertaining to distribution of the software.
30*7f2fe78bSCy Schubert  * Title to copyright in this software and any associated documentation
31*7f2fe78bSCy Schubert  * shall at all times remain with UM, and USER agrees to preserve same.
32*7f2fe78bSCy Schubert  *
33*7f2fe78bSCy Schubert  * The University of Michigan
34*7f2fe78bSCy Schubert  * c/o Steve Rothwell <sgr@umich.edu>
35*7f2fe78bSCy Schubert  * 535 W. William Street
36*7f2fe78bSCy Schubert  * Ann Arbor, Michigan 48013-4943
37*7f2fe78bSCy Schubert  * U.S.A.
38*7f2fe78bSCy Schubert  */
39*7f2fe78bSCy Schubert 
40*7f2fe78bSCy Schubert /*
41*7f2fe78bSCy Schubert **  CacheAPI.h
42*7f2fe78bSCy Schubert **
43*7f2fe78bSCy Schubert **      The externally visible functions and data structures
44*7f2fe78bSCy Schubert **      for the Kerberos Common Cache DLL
45*7f2fe78bSCy Schubert **      This should be the ONLY externally visible file.
46*7f2fe78bSCy Schubert **      This is ALL anyone should need to call the API.
47*7f2fe78bSCy Schubert **
48*7f2fe78bSCy Schubert **
49*7f2fe78bSCy Schubert */
50*7f2fe78bSCy Schubert 
51*7f2fe78bSCy Schubert #ifndef Krb_CCacheAPI_h_
52*7f2fe78bSCy Schubert #define Krb_CCacheAPI_h_
53*7f2fe78bSCy Schubert 
54*7f2fe78bSCy Schubert #include <windows.h>
55*7f2fe78bSCy Schubert 
56*7f2fe78bSCy Schubert //typedef int cc_int32;
57*7f2fe78bSCy Schubert #define cc_int32  long
58*7f2fe78bSCy Schubert #define cc_uint32 unsigned long
59*7f2fe78bSCy Schubert 
60*7f2fe78bSCy Schubert typedef cc_int32  cc_time_t;
61*7f2fe78bSCy Schubert 
62*7f2fe78bSCy Schubert #define CC_API_VER_1	1
63*7f2fe78bSCy Schubert #define CC_API_VER_2	2
64*7f2fe78bSCy Schubert 
65*7f2fe78bSCy Schubert //enum {
66*7f2fe78bSCy Schubert //	CC_API_VER_1 = 1,
67*7f2fe78bSCy Schubert //	CC_API_VER_2 = 2
68*7f2fe78bSCy Schubert //};
69*7f2fe78bSCy Schubert 
70*7f2fe78bSCy Schubert #define CCACHE_API __declspec(dllexport) cc_int32
71*7f2fe78bSCy Schubert 
72*7f2fe78bSCy Schubert /*
73*7f2fe78bSCy Schubert ** The Official Error Codes
74*7f2fe78bSCy Schubert */
75*7f2fe78bSCy Schubert #define CC_NOERROR           0
76*7f2fe78bSCy Schubert #define CC_BADNAME           1
77*7f2fe78bSCy Schubert #define CC_NOTFOUND          2
78*7f2fe78bSCy Schubert #define CC_END               3
79*7f2fe78bSCy Schubert #define CC_IO                4
80*7f2fe78bSCy Schubert #define CC_WRITE             5
81*7f2fe78bSCy Schubert #define CC_NOMEM             6
82*7f2fe78bSCy Schubert #define CC_FORMAT            7
83*7f2fe78bSCy Schubert #define CC_LOCKED            8
84*7f2fe78bSCy Schubert #define CC_BAD_API_VERSION   9
85*7f2fe78bSCy Schubert #define CC_NO_EXIST          10
86*7f2fe78bSCy Schubert #define CC_NOT_SUPP          11
87*7f2fe78bSCy Schubert #define CC_BAD_PARM          12
88*7f2fe78bSCy Schubert #define CC_ERR_CACHE_ATTACH  13
89*7f2fe78bSCy Schubert #define CC_ERR_CACHE_RELEASE 14
90*7f2fe78bSCy Schubert #define CC_ERR_CACHE_FULL    15
91*7f2fe78bSCy Schubert #define CC_ERR_CRED_VERSION  16
92*7f2fe78bSCy Schubert 
93*7f2fe78bSCy Schubert /*
94*7f2fe78bSCy Schubert ** types, structs, & constants
95*7f2fe78bSCy Schubert */
96*7f2fe78bSCy Schubert // Flag bits promised by Ted "RSN"
97*7f2fe78bSCy Schubert #define CC_FLAGS_RESERVED 0xFFFFFFFF
98*7f2fe78bSCy Schubert 
99*7f2fe78bSCy Schubert typedef cc_uint32 cc_nc_flags;       // set via constants above
100*7f2fe78bSCy Schubert 
101*7f2fe78bSCy Schubert typedef struct opaque_dll_control_block_type* apiCB;
102*7f2fe78bSCy Schubert typedef struct opaque_ccache_pointer_type* ccache_p;
103*7f2fe78bSCy Schubert typedef struct opaque_credential_iterator_type* ccache_cit;
104*7f2fe78bSCy Schubert 
105*7f2fe78bSCy Schubert typedef struct _cc_data
106*7f2fe78bSCy Schubert {
107*7f2fe78bSCy Schubert     cc_uint32       type;		// should be one of _cc_data_type
108*7f2fe78bSCy Schubert     cc_uint32       length;
109*7f2fe78bSCy Schubert     unsigned char*  data;		// the proverbial bag-o-bits
110*7f2fe78bSCy Schubert } cc_data;
111*7f2fe78bSCy Schubert 
112*7f2fe78bSCy Schubert // V5 Credentials
113*7f2fe78bSCy Schubert typedef struct _cc_creds {
114*7f2fe78bSCy Schubert     char*           client;
115*7f2fe78bSCy Schubert     char*           server;
116*7f2fe78bSCy Schubert     cc_data         keyblock;
117*7f2fe78bSCy Schubert     cc_time_t       authtime;
118*7f2fe78bSCy Schubert     cc_time_t       starttime;
119*7f2fe78bSCy Schubert     cc_time_t       endtime;
120*7f2fe78bSCy Schubert     cc_time_t       renew_till;
121*7f2fe78bSCy Schubert     cc_uint32       is_skey;
122*7f2fe78bSCy Schubert     cc_uint32       ticket_flags;
123*7f2fe78bSCy Schubert     cc_data **  addresses;
124*7f2fe78bSCy Schubert     cc_data         ticket;
125*7f2fe78bSCy Schubert     cc_data         second_ticket;
126*7f2fe78bSCy Schubert     cc_data **  authdata;
127*7f2fe78bSCy Schubert } cc_creds;
128*7f2fe78bSCy Schubert 
129*7f2fe78bSCy Schubert 
130*7f2fe78bSCy Schubert typedef union cred_ptr_union_type {
131*7f2fe78bSCy Schubert     cc_creds*    pV5Cred;
132*7f2fe78bSCy Schubert } cred_ptr_union;
133*7f2fe78bSCy Schubert 
134*7f2fe78bSCy Schubert typedef struct cred_union_type {
135*7f2fe78bSCy Schubert     cc_int32        cred_type;
136*7f2fe78bSCy Schubert     cred_ptr_union  cred;
137*7f2fe78bSCy Schubert } cred_union;
138*7f2fe78bSCy Schubert 
139*7f2fe78bSCy Schubert typedef struct _infoNC {
140*7f2fe78bSCy Schubert     char*     name;
141*7f2fe78bSCy Schubert     char*     principal;
142*7f2fe78bSCy Schubert     cc_int32  vers;
143*7f2fe78bSCy Schubert } infoNC;
144*7f2fe78bSCy Schubert 
145*7f2fe78bSCy Schubert /*
146*7f2fe78bSCy Schubert ** The official (externally visible) API
147*7f2fe78bSCy Schubert */
148*7f2fe78bSCy Schubert 
149*7f2fe78bSCy Schubert #ifdef __cplusplus
150*7f2fe78bSCy Schubert extern "C" /* this entire list of functions */
151*7f2fe78bSCy Schubert {
152*7f2fe78bSCy Schubert #endif /* __cplusplus */
153*7f2fe78bSCy Schubert 
154*7f2fe78bSCy Schubert /*
155*7f2fe78bSCy Schubert ** Main cache routines : initialize, shutdown, get_cache_names, & get_change_time
156*7f2fe78bSCy Schubert */
157*7f2fe78bSCy Schubert CCACHE_API
158*7f2fe78bSCy Schubert cc_initialize(
159*7f2fe78bSCy Schubert     apiCB** cc_ctx,           // <  DLL's primary control structure.
160*7f2fe78bSCy Schubert                               //    returned here, passed everywhere else
161*7f2fe78bSCy Schubert     cc_int32 api_version,     // >  ver supported by caller (use CC_API_VER_1)
162*7f2fe78bSCy Schubert     cc_int32*  api_supported, // <  if ~NULL, max ver supported by DLL
163*7f2fe78bSCy Schubert     const char** vendor       // <  if ~NULL, vendor name in read only C string
164*7f2fe78bSCy Schubert     );
165*7f2fe78bSCy Schubert 
166*7f2fe78bSCy Schubert CCACHE_API
167*7f2fe78bSCy Schubert cc_shutdown(
168*7f2fe78bSCy Schubert     apiCB** cc_ctx            // <> DLL's primary control structure. NULL after call.
169*7f2fe78bSCy Schubert     );
170*7f2fe78bSCy Schubert 
171*7f2fe78bSCy Schubert CCACHE_API
172*7f2fe78bSCy Schubert cc_get_change_time(
173*7f2fe78bSCy Schubert     apiCB* cc_ctx,       // >  DLL's primary control structure
174*7f2fe78bSCy Schubert     cc_time_t* time      // <  time of last change to main cache
175*7f2fe78bSCy Schubert     );
176*7f2fe78bSCy Schubert 
177*7f2fe78bSCy Schubert /*
178*7f2fe78bSCy Schubert ** Named Cache (NC) routines
179*7f2fe78bSCy Schubert **   create, open, close, destroy, get_principal, get_cred_version, &
180*7f2fe78bSCy Schubert **   lock_request
181*7f2fe78bSCy Schubert **
182*7f2fe78bSCy Schubert ** Multiple NCs are allowed within the main cache.  Each has a Name and
183*7f2fe78bSCy Schubert ** kerberos version # (V5).  Caller gets "ccache_ptr"s for NCs.
184*7f2fe78bSCy Schubert */
185*7f2fe78bSCy Schubert CCACHE_API
186*7f2fe78bSCy Schubert cc_create(
187*7f2fe78bSCy Schubert     apiCB* cc_ctx,          // >  DLL's primary control structure
188*7f2fe78bSCy Schubert     const char* name,       // >  name of cache to be [destroyed if exists, then] created
189*7f2fe78bSCy Schubert     const char* principal,
190*7f2fe78bSCy Schubert     cc_int32 vers,          // >  ticket version (CC_CRED_V5)
191*7f2fe78bSCy Schubert     cc_uint32 cc_flags,     // >  options
192*7f2fe78bSCy Schubert     ccache_p** ccache_ptr   // <  NC control structure
193*7f2fe78bSCy Schubert     );
194*7f2fe78bSCy Schubert 
195*7f2fe78bSCy Schubert CCACHE_API
196*7f2fe78bSCy Schubert cc_open(
197*7f2fe78bSCy Schubert     apiCB* cc_ctx,          // >  DLL's primary control structure
198*7f2fe78bSCy Schubert     const char* name,       // >  name of pre-created cache
199*7f2fe78bSCy Schubert     cc_int32 vers,          // >  ticket version (CC_CRED_V5)
200*7f2fe78bSCy Schubert     cc_uint32 cc_flags,     // >  options
201*7f2fe78bSCy Schubert     ccache_p** ccache_ptr   // <  NC control structure
202*7f2fe78bSCy Schubert     );
203*7f2fe78bSCy Schubert 
204*7f2fe78bSCy Schubert CCACHE_API
205*7f2fe78bSCy Schubert cc_close(
206*7f2fe78bSCy Schubert     apiCB* cc_ctx,         // >  DLL's primary control structure
207*7f2fe78bSCy Schubert     ccache_p** ccache_ptr  // <> NC control structure. NULL after call.
208*7f2fe78bSCy Schubert     );
209*7f2fe78bSCy Schubert 
210*7f2fe78bSCy Schubert CCACHE_API
211*7f2fe78bSCy Schubert cc_destroy(
212*7f2fe78bSCy Schubert     apiCB* cc_ctx,         // >  DLL's primary control structure
213*7f2fe78bSCy Schubert     ccache_p** ccache_ptr  // <> NC control structure. NULL after call.
214*7f2fe78bSCy Schubert     );
215*7f2fe78bSCy Schubert 
216*7f2fe78bSCy Schubert /*
217*7f2fe78bSCy Schubert ** Ways to get information about the NCs
218*7f2fe78bSCy Schubert */
219*7f2fe78bSCy Schubert 
220*7f2fe78bSCy Schubert CCACHE_API
221*7f2fe78bSCy Schubert cc_seq_fetch_NCs_begin(
222*7f2fe78bSCy Schubert     apiCB* cc_ctx,
223*7f2fe78bSCy Schubert     ccache_cit** itNCs
224*7f2fe78bSCy Schubert     );
225*7f2fe78bSCy Schubert 
226*7f2fe78bSCy Schubert CCACHE_API
227*7f2fe78bSCy Schubert cc_seq_fetch_NCs_end(
228*7f2fe78bSCy Schubert     apiCB* cc_ctx,
229*7f2fe78bSCy Schubert     ccache_cit** itNCs
230*7f2fe78bSCy Schubert     );
231*7f2fe78bSCy Schubert 
232*7f2fe78bSCy Schubert CCACHE_API
233*7f2fe78bSCy Schubert cc_seq_fetch_NCs_next(
234*7f2fe78bSCy Schubert     apiCB* cc_ctx,
235*7f2fe78bSCy Schubert     ccache_p** ccache_ptr,
236*7f2fe78bSCy Schubert     ccache_cit* itNCs
237*7f2fe78bSCy Schubert     );
238*7f2fe78bSCy Schubert 
239*7f2fe78bSCy Schubert CCACHE_API
240*7f2fe78bSCy Schubert cc_seq_fetch_NCs(
241*7f2fe78bSCy Schubert     apiCB* cc_ctx,         // >  DLL's primary control structure
242*7f2fe78bSCy Schubert     ccache_p** ccache_ptr, // <  NC control structure (free via cc_close())
243*7f2fe78bSCy Schubert     ccache_cit** itNCs     // <> iterator used by DLL,
244*7f2fe78bSCy Schubert                            //    set to NULL before first call
245*7f2fe78bSCy Schubert                            //    returned NULL at CC_END
246*7f2fe78bSCy Schubert     );
247*7f2fe78bSCy Schubert 
248*7f2fe78bSCy Schubert CCACHE_API
249*7f2fe78bSCy Schubert cc_get_NC_info(
250*7f2fe78bSCy Schubert     apiCB* cc_ctx,          // >  DLL's primary control structure
251*7f2fe78bSCy Schubert     struct _infoNC*** ppNCi // <  (NULL before call) null terminated,
252*7f2fe78bSCy Schubert                             //    list of a structs (free via cc_free_infoNC())
253*7f2fe78bSCy Schubert     );
254*7f2fe78bSCy Schubert 
255*7f2fe78bSCy Schubert CCACHE_API
256*7f2fe78bSCy Schubert cc_free_NC_info(
257*7f2fe78bSCy Schubert     apiCB* cc_ctx,
258*7f2fe78bSCy Schubert     struct _infoNC*** ppNCi // <  free list of structs returned by
259*7f2fe78bSCy Schubert                             //    cc_get_cache_names().  set to NULL on return
260*7f2fe78bSCy Schubert     );
261*7f2fe78bSCy Schubert 
262*7f2fe78bSCy Schubert /*
263*7f2fe78bSCy Schubert ** Functions that provide distinguishing characteristics of NCs.
264*7f2fe78bSCy Schubert */
265*7f2fe78bSCy Schubert 
266*7f2fe78bSCy Schubert CCACHE_API
267*7f2fe78bSCy Schubert cc_get_name(
268*7f2fe78bSCy Schubert     apiCB* cc_ctx,              // > DLL's primary control structure
269*7f2fe78bSCy Schubert     const ccache_p* ccache_ptr, // > NC control structure
270*7f2fe78bSCy Schubert     char** name                 // < name of NC associated with ccache_ptr
271*7f2fe78bSCy Schubert                                 //   (free via cc_free_name())
272*7f2fe78bSCy Schubert     );
273*7f2fe78bSCy Schubert 
274*7f2fe78bSCy Schubert CCACHE_API
275*7f2fe78bSCy Schubert cc_set_principal(
276*7f2fe78bSCy Schubert     apiCB* cc_ctx,                  // > DLL's primary control structure
277*7f2fe78bSCy Schubert     const ccache_p* ccache_pointer, // > NC control structure
278*7f2fe78bSCy Schubert     const cc_int32 vers,
279*7f2fe78bSCy Schubert     const char* principal           // > name of principal associated with NC
280*7f2fe78bSCy Schubert                                     //   Free via cc_free_principal()
281*7f2fe78bSCy Schubert     );
282*7f2fe78bSCy Schubert 
283*7f2fe78bSCy Schubert CCACHE_API
284*7f2fe78bSCy Schubert cc_get_principal(
285*7f2fe78bSCy Schubert     apiCB* cc_ctx,                  // > DLL's primary control structure
286*7f2fe78bSCy Schubert     const ccache_p* ccache_pointer, // > NC control structure
287*7f2fe78bSCy Schubert     char** principal                // < name of principal associated with NC
288*7f2fe78bSCy Schubert                                     //   Free via cc_free_principal()
289*7f2fe78bSCy Schubert     );
290*7f2fe78bSCy Schubert 
291*7f2fe78bSCy Schubert CCACHE_API
292*7f2fe78bSCy Schubert cc_get_cred_version(
293*7f2fe78bSCy Schubert     apiCB* cc_ctx,              // > DLL's primary control structure
294*7f2fe78bSCy Schubert     const ccache_p* ccache_ptr, // > NC control structure
295*7f2fe78bSCy Schubert     cc_int32* vers              // < ticket version associated with NC
296*7f2fe78bSCy Schubert     );
297*7f2fe78bSCy Schubert 
298*7f2fe78bSCy Schubert #define CC_LOCK_UNLOCK   1
299*7f2fe78bSCy Schubert #define CC_LOCK_READER   2
300*7f2fe78bSCy Schubert #define CC_LOCK_WRITER   3
301*7f2fe78bSCy Schubert #define CC_LOCK_NOBLOCK 16
302*7f2fe78bSCy Schubert 
303*7f2fe78bSCy Schubert CCACHE_API
304*7f2fe78bSCy Schubert cc_lock_request(
305*7f2fe78bSCy Schubert     apiCB* cc_ctx,     	        // > DLL's primary control structure
306*7f2fe78bSCy Schubert     const ccache_p* ccache_ptr, // > NC control structure
307*7f2fe78bSCy Schubert     const cc_int32 lock_type    // > one (or combination) of above defined
308*7f2fe78bSCy Schubert                                 //   lock types
309*7f2fe78bSCy Schubert     );
310*7f2fe78bSCy Schubert 
311*7f2fe78bSCy Schubert /*
312*7f2fe78bSCy Schubert ** Credentials routines (work within an NC)
313*7f2fe78bSCy Schubert ** store, remove_cred, seq_fetch_creds
314*7f2fe78bSCy Schubert */
315*7f2fe78bSCy Schubert CCACHE_API
316*7f2fe78bSCy Schubert cc_store(
317*7f2fe78bSCy Schubert     apiCB* cc_ctx,               // > DLL's primary control structure
318*7f2fe78bSCy Schubert     ccache_p* ccache_ptr,        // > NC control structure
319*7f2fe78bSCy Schubert     const cred_union creds       // > credentials to be copied into NC
320*7f2fe78bSCy Schubert     );
321*7f2fe78bSCy Schubert 
322*7f2fe78bSCy Schubert CCACHE_API
323*7f2fe78bSCy Schubert cc_remove_cred(
324*7f2fe78bSCy Schubert     apiCB* cc_ctx,            // > DLL's primary control structure
325*7f2fe78bSCy Schubert     ccache_p* ccache_ptr,     // > NC control structure
326*7f2fe78bSCy Schubert     const cred_union cred     // > credentials to remove from NC
327*7f2fe78bSCy Schubert     );
328*7f2fe78bSCy Schubert 
329*7f2fe78bSCy Schubert CCACHE_API
330*7f2fe78bSCy Schubert cc_seq_fetch_creds(
331*7f2fe78bSCy Schubert     apiCB* cc_ctx,              // > DLL's primary control structure
332*7f2fe78bSCy Schubert     const ccache_p* ccache_ptr, // > NC control structure
333*7f2fe78bSCy Schubert     cred_union** creds,         // < filled in by DLL, free via cc_free_creds()
334*7f2fe78bSCy Schubert     ccache_cit** itCreds        // <> iterator used by DLL, set to NULL
335*7f2fe78bSCy Schubert                                 //    before first call -- Also NULL for final
336*7f2fe78bSCy Schubert                                 //    call if loop ends before CC_END
337*7f2fe78bSCy Schubert     );
338*7f2fe78bSCy Schubert 
339*7f2fe78bSCy Schubert CCACHE_API
340*7f2fe78bSCy Schubert cc_seq_fetch_creds_begin(
341*7f2fe78bSCy Schubert     apiCB* cc_ctx,
342*7f2fe78bSCy Schubert     const ccache_p* ccache_ptr,
343*7f2fe78bSCy Schubert     ccache_cit** itCreds
344*7f2fe78bSCy Schubert     );
345*7f2fe78bSCy Schubert 
346*7f2fe78bSCy Schubert CCACHE_API
347*7f2fe78bSCy Schubert cc_seq_fetch_creds_end(
348*7f2fe78bSCy Schubert     apiCB* cc_ctx,
349*7f2fe78bSCy Schubert     ccache_cit** itCreds
350*7f2fe78bSCy Schubert     );
351*7f2fe78bSCy Schubert 
352*7f2fe78bSCy Schubert CCACHE_API
353*7f2fe78bSCy Schubert cc_seq_fetch_creds_next(
354*7f2fe78bSCy Schubert     apiCB* cc_ctx,
355*7f2fe78bSCy Schubert     cred_union** cred,
356*7f2fe78bSCy Schubert     ccache_cit* itCreds
357*7f2fe78bSCy Schubert     );
358*7f2fe78bSCy Schubert 
359*7f2fe78bSCy Schubert /*
360*7f2fe78bSCy Schubert ** methods of liberation,
361*7f2fe78bSCy Schubert ** or freeing space via the free that goes with the malloc used to get it
362*7f2fe78bSCy Schubert ** It's important to use the free carried in the DLL, not the one supplied
363*7f2fe78bSCy Schubert ** by your compiler vendor.
364*7f2fe78bSCy Schubert **
365*7f2fe78bSCy Schubert ** freeing a NULL pointer is not treated as an error
366*7f2fe78bSCy Schubert */
367*7f2fe78bSCy Schubert CCACHE_API
368*7f2fe78bSCy Schubert cc_free_principal(
369*7f2fe78bSCy Schubert     apiCB* cc_ctx,   // >  DLL's primary control structure
370*7f2fe78bSCy Schubert     char** principal // <> ptr to principal to be freed, returned as NULL
371*7f2fe78bSCy Schubert                      //    (from cc_get_principal())
372*7f2fe78bSCy Schubert     );
373*7f2fe78bSCy Schubert 
374*7f2fe78bSCy Schubert CCACHE_API
375*7f2fe78bSCy Schubert cc_free_name(
376*7f2fe78bSCy Schubert     apiCB* cc_ctx,   // >  DLL's primary control structure
377*7f2fe78bSCy Schubert     char** name      // <> ptr to name to be freed, returned as NULL
378*7f2fe78bSCy Schubert                      //    (from cc_get_name())
379*7f2fe78bSCy Schubert     );
380*7f2fe78bSCy Schubert 
381*7f2fe78bSCy Schubert CCACHE_API
382*7f2fe78bSCy Schubert cc_free_creds(
383*7f2fe78bSCy Schubert     apiCB* cc_ctx,     // > DLL's primary control structure
384*7f2fe78bSCy Schubert     cred_union** pCred // <> cred (from cc_seq_fetch_creds()) to be freed
385*7f2fe78bSCy Schubert                        //    Returned as NULL.
386*7f2fe78bSCy Schubert     );
387*7f2fe78bSCy Schubert 
388*7f2fe78bSCy Schubert #ifdef __cplusplus
389*7f2fe78bSCy Schubert } /* end extern "C" */
390*7f2fe78bSCy Schubert #endif /* __cplusplus */
391*7f2fe78bSCy Schubert 
392*7f2fe78bSCy Schubert #endif /* Krb_CCacheAPI_h_ */
393