Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / uts / common / gssapi / include / gssapiP_dummy.h
blob1b4d1ca4a67638f296ab9cfd616fa9585c755712
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _GSSAPIP_DUMMY_H
28 #define _GSSAPIP_DUMMY_H
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 #include <gssapi/gssapi.h>
36 #define SEC_CONTEXT_TOKEN 1
37 #define DUMMY_SIZE_OF_INT 4
39 typedef void * dummy_token_t;
41 /* dummy name structure for internal representation. */
42 typedef struct {
43 gss_OID type;
44 gss_buffer_t buffer;
45 } dummy_name_desc, *dummy_name_t;
47 /* Structure for context handle */
48 typedef struct {
49 OM_uint32 last_stat;
50 int token_number;
51 int established;
52 } dummy_gss_ctx_id_rec, *dummy_gss_ctx_id_t;
54 /* Dummy oid structure */
55 static const gss_OID_desc dummy_oids[] = {
56 {10, "\053\006\001\004\001\052\002\032\001\002"},
58 const gss_OID_desc * const gss_mech_dummy = dummy_oids+0;
59 static const gss_OID_set_desc dummy_oidsets[] = {
60 {1, (gss_OID) dummy_oids+0},
62 const gss_OID_set_desc * const gss_mech_set_dummy = dummy_oidsets+0;
64 #define TWRITE_STR(ptr, str, len) \
65 (void) memcpy((ptr), (char *) (str), (len)); \
66 (ptr) += (len);
67 #ifndef _KERNEL
69 #ifdef DEBUG_ON
71 #define dprintf(a) printf(a)
72 #define dprintf1(a, b) printf(a, b)
74 #else
76 #define dprintf(a)
77 #define dprintf1(a, b)
78 #define DUMMY_STATIC
80 #endif /* DEBUG_ON */
82 #else /* _KERNEL */
84 #if defined(DEBUG) && !defined(DUMMY_MECH_DEBUG)
85 #define DUMMY_MECH_DEBUG
86 #endif
88 #ifdef DUMMY_MECH_DEBUG
89 #define DUMMY_MECH_LOG(A, B, C) \
90 ((void)((dummy_mech_log & (A)) && (printf((B), (C)), TRUE)))
91 #define DUMMY_MECH_LOG0(A, B) \
92 ((void)((dummy_mech_log & (A)) && (printf(B), TRUE)))
93 #else
94 #define DUMMY_MECH_LOG(A, B, C)
95 #define DUMMY_MECH_LOG0(A, B)
97 #endif
99 #define dprintf(a) DUMMY_MECH_LOG0(8, a)
100 #define dprintf1(a, b) DUMMY_MECH_LOG(8, a, b)
101 #define DUMMY_STATIC static
103 #endif /* _KERNEL */
106 * declarations of internal name mechanism functions
109 OM_uint32 dummy_gss_acquire_cred
111 void *, /* dummy context */
112 OM_uint32 *, /* minor_status */
113 gss_name_t, /* desired_name */
114 OM_uint32, /* time_req */
115 gss_OID_set, /* desired_mechs */
116 gss_cred_usage_t, /* cred_usage */
117 gss_cred_id_t *, /* output_cred_handle */
118 gss_OID_set *, /* actual_mechs */
119 OM_uint32 * /* time_rec */
120 /* */);
122 OM_uint32 dummy_gss_release_cred
124 void *, /* dummy context */
125 OM_uint32 *, /* minor_status */
126 gss_cred_id_t * /* cred_handle */
127 /* */);
129 OM_uint32 dummy_gss_init_sec_context
131 void *, /* dummy context */
132 OM_uint32 *, /* minor_status */
133 gss_cred_id_t, /* claimant_cred_handle */
134 gss_ctx_id_t *, /* context_handle */
135 gss_name_t, /* target_name */
136 gss_OID, /* mech_type */
137 OM_uint32, /* req_flags */
138 OM_uint32, /* time_req */
139 gss_channel_bindings_t, /* input_chan_bindings */
140 gss_buffer_t, /* input_token */
141 gss_OID *, /* actual_mech_type */
142 gss_buffer_t, /* output_token */
143 OM_uint32 *, /* ret_flags */
144 OM_uint32 * /* time_rec */
145 /* */);
147 OM_uint32 dummy_gss_accept_sec_context
149 void *, /* dummy context */
150 OM_uint32 *, /* minor_status */
151 gss_ctx_id_t *, /* context_handle */
152 gss_cred_id_t, /* verifier_cred_handle */
153 gss_buffer_t, /* input_token_buffer */
154 gss_channel_bindings_t, /* input_chan_bindings */
155 gss_name_t *, /* src_name */
156 gss_OID *, /* mech_type */
157 gss_buffer_t, /* output_token */
158 OM_uint32 *, /* ret_flags */
159 OM_uint32 *, /* time_rec */
160 gss_cred_id_t * /* delegated_cred_handle */
161 /* */);
163 OM_uint32 dummy_gss_process_context_token
165 void *, /* dummy context */
166 OM_uint32 *, /* minor_status */
167 gss_ctx_id_t, /* context_handle */
168 gss_buffer_t /* token_buffer */
169 /* */);
171 DUMMY_STATIC OM_uint32 dummy_gss_delete_sec_context
173 void *, /* dummy context */
174 OM_uint32 *, /* minor_status */
175 gss_ctx_id_t *, /* context_handle */
176 gss_buffer_t /* output_token */
177 #ifdef _KERNEL
178 /* */, OM_uint32
179 #endif
180 /* */);
182 OM_uint32 dummy_gss_context_time
184 void *, /* dummy context */
185 OM_uint32 *, /* minor_status */
186 gss_ctx_id_t, /* context_handle */
187 OM_uint32 * /* time_rec */
188 /* */);
190 DUMMY_STATIC OM_uint32 dummy_gss_sign
192 void *, /* dummy context */
193 OM_uint32 *, /* minor_status */
194 gss_ctx_id_t, /* context_handle */
195 int, /* qop_req */
196 gss_buffer_t, /* message_buffer */
197 gss_buffer_t /* message_token */
198 #ifdef _KERNEL
199 /* */, OM_uint32
200 #endif
201 /* */);
203 DUMMY_STATIC OM_uint32 dummy_gss_verify
205 void *, /* dummy context */
206 OM_uint32 *, /* minor_status */
207 gss_ctx_id_t, /* context_handle */
208 gss_buffer_t, /* message_buffer */
209 gss_buffer_t, /* token_buffer */
210 int * /* qop_state */
211 #ifdef _KERNEL
212 /* */, OM_uint32
214 #endif
215 /* */);
217 DUMMY_STATIC OM_uint32 dummy_gss_seal
219 void *, /* dummy context */
220 OM_uint32 *, /* minor_status */
221 gss_ctx_id_t, /* context_handle */
222 int, /* conf_req_flag */
223 int, /* qop_req */
224 gss_buffer_t, /* input_message_buffer */
225 int *, /* conf_state */
226 gss_buffer_t /* output_message_buffer */
227 #ifdef _KERNEL
228 /* */, OM_uint32
229 #endif
230 /* */);
232 DUMMY_STATIC OM_uint32 dummy_gss_unseal
234 void *, /* dummy context */
235 OM_uint32 *, /* minor_status */
236 gss_ctx_id_t, /* context_handle */
237 gss_buffer_t, /* input_message_buffer */
238 gss_buffer_t, /* output_message_buffer */
239 int *, /* conf_state */
240 int * /* qop_state */
241 #ifdef _KERNEL
242 /* */, OM_uint32
243 #endif
244 /* */);
246 OM_uint32 dummy_gss_display_status
248 void *, /* dummy context */
249 OM_uint32 *, /* minor_status */
250 OM_uint32, /* status_value */
251 int, /* status_type */
252 gss_OID, /* mech_type */
253 OM_uint32 *, /* message_context */
254 gss_buffer_t /* status_string */
255 /* */);
257 OM_uint32 dummy_gss_indicate_mechs
259 void *, /* dummy context */
260 OM_uint32 *, /* minor_status */
261 gss_OID_set * /* mech_set */
262 /* */);
264 OM_uint32 dummy_gss_compare_name
266 void *, /* dummy context */
267 OM_uint32 *, /* minor_status */
268 gss_name_t, /* name1 */
269 gss_name_t, /* name2 */
270 int * /* name_equal */
271 /* */);
273 OM_uint32 dummy_gss_display_name
275 void *, /* dummy context */
276 OM_uint32 *, /* minor_status */
277 gss_name_t, /* input_name */
278 gss_buffer_t, /* output_name_buffer */
279 gss_OID * /* output_name_type */
280 /* */);
282 OM_uint32 dummy_gss_import_name
284 void *, /* dummy context */
285 OM_uint32 *, /* minor_status */
286 gss_buffer_t, /* input_name_buffer */
287 gss_OID, /* input_name_type */
288 gss_name_t * /* output_name */
289 /* */);
291 OM_uint32 dummy_gss_release_name
293 void *, /* dummy context */
294 OM_uint32 *, /* minor_status */
295 gss_name_t * /* input_name */
296 /* */);
298 OM_uint32 dummy_gss_inquire_cred
300 void *, /* dummy context */
301 OM_uint32 *, /* minor_status */
302 gss_cred_id_t, /* cred_handle */
303 gss_name_t *, /* name */
304 OM_uint32 *, /* lifetime */
305 gss_cred_usage_t *, /* cred_usage */
306 gss_OID_set * /* mechanisms */
307 /* */);
309 OM_uint32 dummy_gss_inquire_context
311 void *, /* dummy context */
312 OM_uint32 *, /* minor_status */
313 gss_ctx_id_t, /* context_handle */
314 gss_name_t *, /* initiator_name */
315 gss_name_t *, /* acceptor_name */
316 OM_uint32 *, /* lifetime_rec */
317 gss_OID *, /* mech_type */
318 OM_uint32 *, /* ret_flags */
319 int *, /* locally_initiated */
320 int * /* open */
321 /* */);
323 /* New V2 entry points */
324 OM_uint32 dummy_gss_get_mic
326 void *, /* dummy context */
327 OM_uint32 *, /* minor_status */
328 gss_ctx_id_t, /* context_handle */
329 gss_qop_t, /* qop_req */
330 gss_buffer_t, /* message_buffer */
331 gss_buffer_t /* message_token */
332 /* */);
334 OM_uint32 dummy_gss_verify_mic
336 void *, /* dummy context */
337 OM_uint32 *, /* minor_status */
338 gss_ctx_id_t, /* context_handle */
339 gss_buffer_t, /* message_buffer */
340 gss_buffer_t, /* message_token */
341 gss_qop_t * /* qop_state */
342 /* */);
344 OM_uint32 dummy_gss_wrap
346 void *, /* dummy context */
347 OM_uint32 *, /* minor_status */
348 gss_ctx_id_t, /* context_handle */
349 int, /* conf_req_flag */
350 gss_qop_t, /* qop_req */
351 gss_buffer_t, /* input_message_buffer */
352 int *, /* conf_state */
353 gss_buffer_t /* output_message_buffer */
354 /* */);
356 OM_uint32 dummy_gss_unwrap
358 void *, /* dummy context */
359 OM_uint32 *, /* minor_status */
360 gss_ctx_id_t, /* context_handle */
361 gss_buffer_t, /* input_message_buffer */
362 gss_buffer_t, /* output_message_buffer */
363 int *, /* conf_state */
364 gss_qop_t * /* qop_state */
365 /* */);
367 OM_uint32 dummy_gss_wrap_size_limit
369 void *, /* dummy context */
370 OM_uint32 *, /* minor_status */
371 gss_ctx_id_t, /* context_handle */
372 int, /* conf_req_flag */
373 gss_qop_t, /* qop_req */
374 OM_uint32, /* req_output_size */
375 OM_uint32 * /* max_input_size */
376 /* */);
378 OM_uint32 dummy_gss_add_cred
380 void *, /* dummy context */
381 OM_uint32 *, /* minor_status */
382 gss_cred_id_t, /* input_cred_handle */
383 gss_name_t, /* desired_name */
384 gss_OID, /* desired_mech */
385 gss_cred_usage_t, /* cred_usage */
386 OM_uint32, /* initiator_time_req */
387 OM_uint32, /* acceptor_time_req */
388 gss_cred_id_t *, /* output_cred_handle */
389 gss_OID_set *, /* actual_mechs */
390 OM_uint32 *, /* initiator_time_rec */
391 OM_uint32 * /* acceptor_time_rec */
392 /* */);
394 OM_uint32 dummy_gss_inquire_cred_by_mech
396 void *, /* dummy context */
397 OM_uint32 *, /* minor_status */
398 gss_cred_id_t, /* cred_handle */
399 gss_OID, /* mech_type */
400 gss_name_t *, /* name */
401 OM_uint32 *, /* initiator_lifetime */
402 OM_uint32 *, /* acceptor_lifetime */
403 gss_cred_usage_t * /* cred_usage */
404 /* */);
406 OM_uint32 dummy_gss_export_sec_context
408 void *, /* dummy context */
409 OM_uint32 *, /* minor_status */
410 gss_ctx_id_t *, /* context_handle */
411 gss_buffer_t /* interprocess_token */
412 /* */);
414 OM_uint32 dummy_gss_import_sec_context
416 void *, /* dummy context */
417 OM_uint32 *, /* minor_status */
418 gss_buffer_t, /* interprocess_token */
419 gss_ctx_id_t * /* context_handle */
420 /* */);
422 #if 0
423 OM_uint32 dummy_gss_release_oid
425 OM_uint32 *, /* minor_status */
426 gss_OID * /* oid */
427 /* */);
428 #endif
430 OM_uint32 dummy_gss_internal_release_oid
432 void *, /* dummy context */
433 OM_uint32 *, /* minor_status */
434 gss_OID * /* oid */
435 /* */);
437 OM_uint32 dummy_gss_inquire_names_for_mech
439 void *, /* dummy context */
440 OM_uint32 *, /* minor_status */
441 gss_OID, /* mechanism */
442 gss_OID_set * /* name_types */
443 /* */);
445 OM_uint32 dummy_pname_to_uid
447 void *, /* dummy context */
448 OM_uint32 *, /* minor status */
449 const gss_name_t, /* pname */
450 uid_t * /* uidOut */
451 /* */);
454 #ifdef __cplusplus
456 #endif
458 #endif /* _GSSAPIP_DUMMY_H */