summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/ccache/ccapi/stdcc.h
blob: 4fe6027995fddba2b71b449ad4522c5d978dcc67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#include "k5-int.h"	/* loads krb5.h */
	
#ifdef USE_CCAPI_V3
#include <CredentialsCache.h>
#else
#ifdef USE_CCAPI
#include <CredentialsCache2.h>
#else
#if defined(_WIN32)
#include "cacheapi.h"
#endif
#endif
#endif


#define kStringLiteralLen 255

/* globals to be exported */
extern krb5_cc_ops krb5_cc_stdcc_ops;

/*
 * structure to stash in the cache's data field
 */
typedef struct _stdccCacheData {
     	char *cache_name;
#ifdef USE_CCAPI_V3
        cc_ccache_t NamedCache;
#else
	ccache_p *NamedCache;
#endif
} stdccCacheData, *stdccCacheDataPtr;


/* function protoypes  */

void krb5_stdcc_shutdown(void);

#ifdef USE_CCAPI_V3

krb5_error_code KRB5_CALLCONV krb5_stdccv3_close
        (krb5_context, krb5_ccache id );

krb5_error_code KRB5_CALLCONV krb5_stdccv3_destroy 
        (krb5_context, krb5_ccache id );

krb5_error_code KRB5_CALLCONV krb5_stdccv3_end_seq_get 
        (krb5_context, krb5_ccache id , krb5_cc_cursor *cursor );

krb5_error_code KRB5_CALLCONV krb5_stdccv3_generate_new 
        (krb5_context, krb5_ccache *id );

const char * KRB5_CALLCONV krb5_stdccv3_get_name 
        (krb5_context, krb5_ccache id );

krb5_error_code KRB5_CALLCONV krb5_stdccv3_get_principal 
        (krb5_context, krb5_ccache id , krb5_principal *princ );

krb5_error_code KRB5_CALLCONV krb5_stdccv3_initialize 
        (krb5_context, krb5_ccache id , krb5_principal princ );

krb5_error_code KRB5_CALLCONV krb5_stdccv3_next_cred 
        (krb5_context, 
		   krb5_ccache id , 
		   krb5_cc_cursor *cursor , 
		   krb5_creds *creds );

krb5_error_code KRB5_CALLCONV krb5_stdccv3_resolve 
        (krb5_context, krb5_ccache *id , const char *residual );
     
krb5_error_code KRB5_CALLCONV krb5_stdccv3_retrieve 
        (krb5_context, 
		   krb5_ccache id , 
		   krb5_flags whichfields , 
		   krb5_creds *mcreds , 
		   krb5_creds *creds );

krb5_error_code KRB5_CALLCONV krb5_stdccv3_start_seq_get 
        (krb5_context, krb5_ccache id , krb5_cc_cursor *cursor );

krb5_error_code KRB5_CALLCONV krb5_stdccv3_store 
        (krb5_context, krb5_ccache id , krb5_creds *creds );

krb5_error_code KRB5_CALLCONV krb5_stdccv3_set_flags 
        (krb5_context, krb5_ccache id , krb5_flags flags );

krb5_error_code KRB5_CALLCONV krb5_stdccv3_get_flags 
        (krb5_context, krb5_ccache id , krb5_flags *flags );

krb5_error_code KRB5_CALLCONV krb5_stdccv3_remove 
        (krb5_context, krb5_ccache id , krb5_flags flags, krb5_creds *creds);

krb5_error_code KRB5_CALLCONV krb5_stdccv3_ptcursor_new
		(krb5_context context, krb5_cc_ptcursor *cursor);

krb5_error_code KRB5_CALLCONV krb5_stdccv3_ptcursor_next
		(krb5_context context, krb5_cc_ptcursor cursor, krb5_ccache *ccache);

krb5_error_code KRB5_CALLCONV krb5_stdccv3_ptcursor_free
		(krb5_context context, krb5_cc_ptcursor *cursor);


#else

krb5_error_code KRB5_CALLCONV krb5_stdcc_close
        (krb5_context, krb5_ccache id );

krb5_error_code KRB5_CALLCONV krb5_stdcc_destroy 
        (krb5_context, krb5_ccache id );

krb5_error_code KRB5_CALLCONV krb5_stdcc_end_seq_get 
        (krb5_context, krb5_ccache id , krb5_cc_cursor *cursor );

krb5_error_code KRB5_CALLCONV krb5_stdcc_generate_new 
        (krb5_context, krb5_ccache *id );

const char * KRB5_CALLCONV krb5_stdcc_get_name 
        (krb5_context, krb5_ccache id );

krb5_error_code KRB5_CALLCONV krb5_stdcc_get_principal 
        (krb5_context, krb5_ccache id , krb5_principal *princ );

krb5_error_code KRB5_CALLCONV krb5_stdcc_initialize 
        (krb5_context, krb5_ccache id , krb5_principal princ );

krb5_error_code KRB5_CALLCONV krb5_stdcc_next_cred 
        (krb5_context, 
		   krb5_ccache id , 
		   krb5_cc_cursor *cursor , 
		   krb5_creds *creds );

krb5_error_code KRB5_CALLCONV krb5_stdcc_resolve 
        (krb5_context, krb5_ccache *id , const char *residual );
     
krb5_error_code KRB5_CALLCONV krb5_stdcc_retrieve 
        (krb5_context, 
		   krb5_ccache id , 
		   krb5_flags whichfields , 
		   krb5_creds *mcreds , 
		   krb5_creds *creds );

krb5_error_code KRB5_CALLCONV krb5_stdcc_start_seq_get 
        (krb5_context, krb5_ccache id , krb5_cc_cursor *cursor );

krb5_error_code KRB5_CALLCONV krb5_stdcc_store 
        (krb5_context, krb5_ccache id , krb5_creds *creds );

krb5_error_code KRB5_CALLCONV krb5_stdcc_set_flags 
        (krb5_context, krb5_ccache id , krb5_flags flags );

krb5_error_code KRB5_CALLCONV krb5_stdcc_get_flags 
        (krb5_context, krb5_ccache id , krb5_flags *flags );

krb5_error_code KRB5_CALLCONV krb5_stdcc_remove 
        (krb5_context, krb5_ccache id , krb5_flags flags, krb5_creds *creds);
#endif