]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/kgssapi/gssapi.h
THIS BRANCH IS OBSOLETE, PLEASE READ:
[FreeBSD/FreeBSD.git] / sys / kgssapi / gssapi.h
1 /*
2  * Copyright (C) The Internet Society (2000).  All Rights Reserved.
3  *
4  * This document and translations of it may be copied and furnished to
5  * others, and derivative works that comment on or otherwise explain it
6  * or assist in its implementation may be prepared, copied, published
7  * and distributed, in whole or in part, without restriction of any
8  * kind, provided that the above copyright notice and this paragraph are
9  * included on all such copies and derivative works.  However, this
10  * document itself may not be modified in any way, such as by removing
11  * the copyright notice or references to the Internet Society or other
12  * Internet organizations, except as needed for the purpose of
13  * developing Internet standards in which case the procedures for
14  * copyrights defined in the Internet Standards process must be
15  * followed, or as required to translate it into languages other than
16  * English.
17  *
18  * The limited permissions granted above are perpetual and will not be
19  * revoked by the Internet Society or its successors or assigns.
20  *
21  * This document and the information contained herein is provided on an
22  * "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
23  * TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
24  * BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
25  * HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
26  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
27  *
28  * $FreeBSD$
29  */
30
31 #ifndef _KGSSAPI_GSSAPI_H_
32 #define _KGSSAPI_GSSAPI_H_
33
34 /*
35  * A cut-down version of the GSS-API for in-kernel use
36  */
37
38 /*
39  * Now define the three implementation-dependent types.
40  */
41 typedef struct _gss_ctx_id_t *gss_ctx_id_t;
42 typedef struct _gss_cred_id_t *gss_cred_id_t;
43 typedef struct _gss_name_t *gss_name_t;
44
45 /*
46  * We can't use X/Open definitions, so roll our own.
47  */
48 typedef uint32_t OM_uint32;
49 typedef uint64_t OM_uint64;
50
51 typedef struct gss_OID_desc_struct {
52   OM_uint32 length;
53   void      *elements;
54 } gss_OID_desc, *gss_OID;
55
56 typedef struct gss_OID_set_desc_struct  {
57   size_t     count;
58   gss_OID    elements;
59 } gss_OID_set_desc, *gss_OID_set;
60
61 typedef struct gss_buffer_desc_struct {
62   size_t length;
63   void *value;
64 } gss_buffer_desc, *gss_buffer_t;
65
66 typedef struct gss_channel_bindings_struct {
67   OM_uint32 initiator_addrtype;
68   gss_buffer_desc initiator_address;
69   OM_uint32 acceptor_addrtype;
70   gss_buffer_desc acceptor_address;
71   gss_buffer_desc application_data;
72 } *gss_channel_bindings_t;
73
74 /*
75  * For now, define a QOP-type as an OM_uint32
76  */
77 typedef OM_uint32 gss_qop_t;
78
79 typedef int gss_cred_usage_t;
80
81 /*
82  * Flag bits for context-level services.
83  */
84 #define GSS_C_DELEG_FLAG      1
85 #define GSS_C_MUTUAL_FLAG     2
86 #define GSS_C_REPLAY_FLAG     4
87 #define GSS_C_SEQUENCE_FLAG   8
88 #define GSS_C_CONF_FLAG       16
89 #define GSS_C_INTEG_FLAG      32
90 #define GSS_C_ANON_FLAG       64
91 #define GSS_C_PROT_READY_FLAG 128
92 #define GSS_C_TRANS_FLAG      256
93
94 /*
95  * Credential usage options
96  */
97 #define GSS_C_BOTH     0
98 #define GSS_C_INITIATE 1
99 #define GSS_C_ACCEPT   2
100
101 /*
102  * Status code types for gss_display_status
103  */
104 #define GSS_C_GSS_CODE  1
105 #define GSS_C_MECH_CODE 2
106
107 /*
108  * The constant definitions for channel-bindings address families
109  */
110 #define GSS_C_AF_UNSPEC     0
111 #define GSS_C_AF_LOCAL      1
112 #define GSS_C_AF_INET       2
113 #define GSS_C_AF_IMPLINK    3
114 #define GSS_C_AF_PUP        4
115 #define GSS_C_AF_CHAOS      5
116 #define GSS_C_AF_NS         6
117 #define GSS_C_AF_NBS        7
118 #define GSS_C_AF_ECMA       8
119 #define GSS_C_AF_DATAKIT    9
120 #define GSS_C_AF_CCITT      10
121 #define GSS_C_AF_SNA        11
122 #define GSS_C_AF_DECnet     12
123 #define GSS_C_AF_DLI        13
124 #define GSS_C_AF_LAT        14
125 #define GSS_C_AF_HYLINK     15
126 #define GSS_C_AF_APPLETALK  16
127 #define GSS_C_AF_BSC        17
128 #define GSS_C_AF_DSS        18
129 #define GSS_C_AF_OSI        19
130 #define GSS_C_AF_X25        21
131 #define GSS_C_AF_NULLADDR   255
132
133 /*
134  * Various Null values
135  */
136 #define GSS_C_NO_NAME ((gss_name_t) 0)
137 #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
138 #define GSS_C_NO_OID ((gss_OID) 0)
139 #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
140 #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
141 #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
142 #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
143 #define GSS_C_EMPTY_BUFFER {0, NULL}
144
145 /*
146  * Some alternate names for a couple of the above
147  * values.  These are defined for V1 compatibility.
148  */
149 #define GSS_C_NULL_OID GSS_C_NO_OID
150 #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
151
152 /*
153  * Define the default Quality of Protection for per-message
154  * services.  Note that an implementation that offers multiple
155  * levels of QOP may define GSS_C_QOP_DEFAULT to be either zero
156  * (as done here) to mean "default protection", or to a specific
157  * explicit QOP value.  However, a value of 0 should always be
158  * interpreted by a GSS-API implementation as a request for the
159  * default protection level.
160  */
161 #define GSS_C_QOP_DEFAULT 0
162
163 /*
164  * Expiration time of 2^32-1 seconds means infinite lifetime for a
165  * credential or security context
166  */
167 #define GSS_C_INDEFINITE 0xfffffffful
168
169 /*
170  * The implementation must reserve static storage for a
171  * gss_OID_desc object containing the value
172  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
173  * "\x01\x02\x01\x01"},
174  * corresponding to an object-identifier value of
175  * {iso(1) member-body(2) United States(840) mit(113554)
176  * infosys(1) gssapi(2) generic(1) user_name(1)}.  The constant
177  * GSS_C_NT_USER_NAME should be initialized to point
178  * to that gss_OID_desc.
179  */
180 extern gss_OID GSS_C_NT_USER_NAME;
181
182 /*
183  * The implementation must reserve static storage for a
184  * gss_OID_desc object containing the value
185  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
186  *              "\x01\x02\x01\x02"},
187  * corresponding to an object-identifier value of
188  * {iso(1) member-body(2) United States(840) mit(113554)
189  * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
190  * The constant GSS_C_NT_MACHINE_UID_NAME should be
191  * initialized to point to that gss_OID_desc.
192  */
193 extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
194
195 /*
196  * The implementation must reserve static storage for a
197  * gss_OID_desc object containing the value
198  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
199  *              "\x01\x02\x01\x03"},
200  * corresponding to an object-identifier value of
201  * {iso(1) member-body(2) United States(840) mit(113554)
202  * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
203  * The constant GSS_C_NT_STRING_UID_NAME should be
204  * initialized to point to that gss_OID_desc.
205  */
206 extern gss_OID GSS_C_NT_STRING_UID_NAME;
207
208 /*
209  * The implementation must reserve static storage for a
210  * gss_OID_desc object containing the value
211  * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
212  * corresponding to an object-identifier value of
213  * {iso(1) org(3) dod(6) internet(1) security(5)
214  * nametypes(6) gss-host-based-services(2)).  The constant
215  * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
216  * to that gss_OID_desc.  This is a deprecated OID value, and
217  * implementations wishing to support hostbased-service names
218  * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
219  * defined below, to identify such names;
220  * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
221  * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
222  * parameter, but should not be emitted by GSS-API
223  * implementations
224  */
225 extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
226
227 /*
228  * The implementation must reserve static storage for a
229  * gss_OID_desc object containing the value
230  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
231  *              "\x01\x02\x01\x04"}, corresponding to an
232  * object-identifier value of {iso(1) member-body(2)
233  * Unites States(840) mit(113554) infosys(1) gssapi(2)
234  * generic(1) service_name(4)}.  The constant
235  * GSS_C_NT_HOSTBASED_SERVICE should be initialized
236  * to point to that gss_OID_desc.
237  */
238 extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
239
240 /*
241  * The implementation must reserve static storage for a
242  * gss_OID_desc object containing the value
243  * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
244  * corresponding to an object identifier value of
245  * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
246  * 6(nametypes), 3(gss-anonymous-name)}.  The constant
247  * and GSS_C_NT_ANONYMOUS should be initialized to point
248  * to that gss_OID_desc.
249  */
250 extern gss_OID GSS_C_NT_ANONYMOUS;
251
252 /*
253  * The implementation must reserve static storage for a
254  * gss_OID_desc object containing the value
255  * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
256  * corresponding to an object-identifier value of
257  * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
258  * 6(nametypes), 4(gss-api-exported-name)}.  The constant
259  * GSS_C_NT_EXPORT_NAME should be initialized to point
260  * to that gss_OID_desc.
261  */
262 extern gss_OID GSS_C_NT_EXPORT_NAME;
263
264 /*
265  *   This name form shall be represented by the Object Identifier {iso(1)
266  *   member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
267  *   krb5(2) krb5_name(1)}.  The recommended symbolic name for this type
268  *   is "GSS_KRB5_NT_PRINCIPAL_NAME".
269  */
270 extern gss_OID GSS_KRB5_NT_PRINCIPAL_NAME;
271
272 /*
273  * This name form shall be represented by the Object Identifier {iso(1)
274  * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
275  * generic(1) user_name(1)}.  The recommended symbolic name for this
276  * type is "GSS_KRB5_NT_USER_NAME".
277  */
278 extern gss_OID GSS_KRB5_NT_USER_NAME;
279
280 /*
281  * This name form shall be represented by the Object Identifier {iso(1)
282  * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
283  * generic(1) machine_uid_name(2)}.  The recommended symbolic name for
284  * this type is "GSS_KRB5_NT_MACHINE_UID_NAME".
285  */
286 extern gss_OID GSS_KRB5_NT_MACHINE_UID_NAME;
287
288 /*
289  * This name form shall be represented by the Object Identifier {iso(1)
290  * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
291  * generic(1) string_uid_name(3)}.  The recommended symbolic name for
292  * this type is "GSS_KRB5_NT_STRING_UID_NAME".
293  */
294 extern gss_OID GSS_KRB5_NT_STRING_UID_NAME;
295
296 /* Major status codes */
297
298 #define GSS_S_COMPLETE 0
299
300 /*
301  * Some "helper" definitions to make the status code macros obvious.
302  */
303 #define GSS_C_CALLING_ERROR_OFFSET 24
304 #define GSS_C_ROUTINE_ERROR_OFFSET 16
305 #define GSS_C_SUPPLEMENTARY_OFFSET 0
306 #define GSS_C_CALLING_ERROR_MASK 0377ul
307 #define GSS_C_ROUTINE_ERROR_MASK 0377ul
308 #define GSS_C_SUPPLEMENTARY_MASK 0177777ul
309
310 /*
311  * The macros that test status codes for error conditions.
312  * Note that the GSS_ERROR() macro has changed slightly from
313  * the V1 GSS-API so that it now evaluates its argument
314  * only once.
315  */
316 #define GSS_CALLING_ERROR(x) \
317  (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
318 #define GSS_ROUTINE_ERROR(x) \
319  (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
320 #define GSS_SUPPLEMENTARY_INFO(x) \
321  (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
322 #define GSS_ERROR(x) \
323  (x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
324        (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
325
326 /*
327  * Now the actual status code definitions
328  */
329
330 /*
331  * Calling errors:
332  */
333 #define GSS_S_CALL_INACCESSIBLE_READ \
334 (1ul << GSS_C_CALLING_ERROR_OFFSET)
335 #define GSS_S_CALL_INACCESSIBLE_WRITE \
336 (2ul << GSS_C_CALLING_ERROR_OFFSET)
337 #define GSS_S_CALL_BAD_STRUCTURE \
338 (3ul << GSS_C_CALLING_ERROR_OFFSET)
339
340 /*
341  * Routine errors:
342  */
343 #define GSS_S_BAD_MECH             (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
344 #define GSS_S_BAD_NAME             (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
345 #define GSS_S_BAD_NAMETYPE         (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
346 #define GSS_S_BAD_BINDINGS         (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
347 #define GSS_S_BAD_STATUS           (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
348 #define GSS_S_BAD_SIG              (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
349 #define GSS_S_BAD_MIC              GSS_S_BAD_SIG
350 #define GSS_S_NO_CRED              (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
351 #define GSS_S_NO_CONTEXT           (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
352 #define GSS_S_DEFECTIVE_TOKEN      (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
353 #define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
354 #define GSS_S_CREDENTIALS_EXPIRED  (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
355 #define GSS_S_CONTEXT_EXPIRED      (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
356 #define GSS_S_FAILURE              (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
357 #define GSS_S_BAD_QOP              (14ul << GSS_C_ROUTINE_ERROR_OFFSET)
358 #define GSS_S_UNAUTHORIZED         (15ul << GSS_C_ROUTINE_ERROR_OFFSET)
359 #define GSS_S_UNAVAILABLE          (16ul << GSS_C_ROUTINE_ERROR_OFFSET)
360 #define GSS_S_DUPLICATE_ELEMENT    (17ul << GSS_C_ROUTINE_ERROR_OFFSET)
361 #define GSS_S_NAME_NOT_MN          (18ul << GSS_C_ROUTINE_ERROR_OFFSET)
362
363 /*
364  * Supplementary info bits:
365  */
366 #define GSS_S_CONTINUE_NEEDED \
367          (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
368 #define GSS_S_DUPLICATE_TOKEN \
369          (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
370 #define GSS_S_OLD_TOKEN \
371          (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
372 #define GSS_S_UNSEQ_TOKEN \
373          (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
374 #define GSS_S_GAP_TOKEN \
375          (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
376
377 __BEGIN_DECLS
378
379 /*
380  * Finally, function prototypes for the GSS-API routines.
381  */
382 OM_uint32 gss_acquire_cred
383               (OM_uint32 *,            /* minor_status */
384                const gss_name_t,       /* desired_name */
385                OM_uint32,              /* time_req */
386                const gss_OID_set,      /* desired_mechs */
387                gss_cred_usage_t,       /* cred_usage */
388                gss_cred_id_t *,        /* output_cred_handle */
389                gss_OID_set *,          /* actual_mechs */
390                OM_uint32 *             /* time_rec */
391               );
392
393 OM_uint32 gss_release_cred
394               (OM_uint32 *,            /* minor_status */
395                gss_cred_id_t *         /* cred_handle */
396               );
397
398 OM_uint32 gss_init_sec_context
399               (OM_uint32 *,            /* minor_status */
400                const gss_cred_id_t,    /* initiator_cred_handle */
401                gss_ctx_id_t *,         /* context_handle */
402                const gss_name_t,       /* target_name */
403                const gss_OID,          /* mech_type */
404                OM_uint32,              /* req_flags */
405                OM_uint32,              /* time_req */
406                const gss_channel_bindings_t,
407                                        /* input_chan_bindings */
408                const gss_buffer_t,     /* input_token */
409                gss_OID *,              /* actual_mech_type */
410                gss_buffer_t,           /* output_token */
411                OM_uint32 *,            /* ret_flags */
412                OM_uint32 *             /* time_rec */
413               );
414
415 OM_uint32 gss_accept_sec_context
416               (OM_uint32 *,            /* minor_status */
417                gss_ctx_id_t *,         /* context_handle */
418                const gss_cred_id_t,    /* acceptor_cred_handle */
419                const gss_buffer_t,     /* input_token_buffer */
420                const gss_channel_bindings_t,
421                                        /* input_chan_bindings */
422                gss_name_t *,           /* src_name */
423                gss_OID *,              /* mech_type */
424                gss_buffer_t,           /* output_token */
425                OM_uint32 *,            /* ret_flags */
426                OM_uint32 *,            /* time_rec */
427                gss_cred_id_t *         /* delegated_cred_handle */
428               );
429
430 OM_uint32 gss_delete_sec_context
431               (OM_uint32 *,            /* minor_status */
432                gss_ctx_id_t *,         /* context_handle */
433                gss_buffer_t            /* output_token */
434               );
435
436 OM_uint32 gss_get_mic
437               (OM_uint32 *,            /* minor_status */
438                const gss_ctx_id_t,     /* context_handle */
439                gss_qop_t,              /* qop_req */
440                const gss_buffer_t,     /* message_buffer */
441                gss_buffer_t            /* message_token */
442               );
443
444 OM_uint32 gss_verify_mic
445               (OM_uint32 *,            /* minor_status */
446                const gss_ctx_id_t,     /* context_handle */
447                const gss_buffer_t,     /* message_buffer */
448                const gss_buffer_t,     /* token_buffer */
449                gss_qop_t *             /* qop_state */
450               );
451
452 OM_uint32 gss_wrap
453               (OM_uint32 *,            /* minor_status */
454                const gss_ctx_id_t,     /* context_handle */
455                int,                    /* conf_req_flag */
456                gss_qop_t,              /* qop_req */
457                const gss_buffer_t,     /* input_message_buffer */
458                int *,                  /* conf_state */
459                gss_buffer_t            /* output_message_buffer */
460               );
461
462 OM_uint32 gss_unwrap
463               (OM_uint32 *,            /* minor_status */
464                const gss_ctx_id_t,     /* context_handle */
465                const gss_buffer_t,     /* input_message_buffer */
466                gss_buffer_t,           /* output_message_buffer */
467                int *,                  /* conf_state */
468                gss_qop_t *             /* qop_state */
469               );
470
471 OM_uint32 gss_display_status
472               (OM_uint32 *,            /* minor_status */
473                OM_uint32,              /* status_value */
474                int,                    /* status_type */
475                const gss_OID,          /* mech_type */
476                OM_uint32 *,            /* message_context */
477                gss_buffer_t            /* status_string */
478               );
479
480 OM_uint32 gss_import_name
481               (OM_uint32 *,            /* minor_status */
482                const gss_buffer_t,     /* input_name_buffer */
483                const gss_OID,          /* input_name_type */
484                gss_name_t *            /* output_name */
485               );
486
487 OM_uint32 gss_export_name
488               (OM_uint32 *,            /* minor_status */
489                const gss_name_t,       /* input_name */
490                gss_buffer_t            /* exported_name */
491               );
492
493 OM_uint32 gss_release_name
494               (OM_uint32 *,            /* minor_status */
495                gss_name_t *            /* input_name */
496               );
497
498 OM_uint32 gss_release_buffer
499               (OM_uint32 *,            /* minor_status */
500                gss_buffer_t            /* buffer */
501               );
502
503 OM_uint32 gss_release_oid_set
504               (OM_uint32 *,            /* minor_status */
505                gss_OID_set *           /* set */
506               );
507
508 OM_uint32 gss_wrap_size_limit (
509                OM_uint32 *,            /* minor_status */
510                const gss_ctx_id_t,     /* context_handle */
511                int,                    /* conf_req_flag */
512                gss_qop_t,              /* qop_req */
513                OM_uint32,              /* req_output_size */
514                OM_uint32 *             /* max_input_size */
515               );
516
517 OM_uint32 gss_create_empty_oid_set (
518                OM_uint32 *,            /* minor_status */
519                gss_OID_set *           /* oid_set */
520               );
521
522 OM_uint32 gss_add_oid_set_member (
523                OM_uint32 *,            /* minor_status */
524                const gss_OID,          /* member_oid */
525                gss_OID_set *           /* oid_set */
526               );
527
528 OM_uint32 gss_test_oid_set_member (
529                OM_uint32 *,            /* minor_status */
530                const gss_OID,          /* member */
531                const gss_OID_set,      /* set */
532                int *                   /* present */
533               );
534
535 OM_uint32 gss_canonicalize_name (
536                OM_uint32 *,            /* minor_status */
537                const gss_name_t,       /* input_name */
538                const gss_OID,          /* mech_type */
539                gss_name_t *            /* output_name */
540               );
541
542 /*
543  * Other extensions and helper functions.
544  */
545
546 OM_uint32 gss_set_cred_option
547               (OM_uint32 *,             /* minor status */
548                gss_cred_id_t *,         /* cred */
549                const gss_OID,           /* option to set */
550                const gss_buffer_t       /* option value */
551               );
552
553 OM_uint32 gss_pname_to_uid
554               (OM_uint32 *,             /* minor status */
555                const gss_name_t pname,  /* principal name */
556                const gss_OID mech,      /* mechanism to query */
557                uid_t *uidp              /* pointer to UID for result */
558               );
559
560 /*
561  * On entry, *numgroups is set to the maximum number of groups to return. On exit, *numgroups is set to the actual number of groups returned.
562  */
563 OM_uint32 gss_pname_to_unix_cred
564               (OM_uint32 *,             /* minor status */
565                const gss_name_t pname,  /* principal name */
566                const gss_OID mech,      /* mechanism to query */
567                uid_t *uidp,             /* pointer to UID for result */
568                gid_t *gidp,             /* pointer to GID for result */
569                int *numgroups,          /* number of groups */
570                gid_t *groups            /* pointer to group list */
571               );
572
573 /*
574  * Mbuf oriented message signing and encryption.
575  *
576  * Get_mic allocates an mbuf to hold the message checksum. Verify_mic
577  * may modify the passed-in mic but will not free it.
578  *
579  * Wrap and unwrap
580  * consume the message and generate a new mbuf chain with the
581  * result. The original message is freed on error.
582  */
583 struct mbuf;
584 OM_uint32 gss_get_mic_mbuf
585               (OM_uint32 *,            /* minor_status */
586                const gss_ctx_id_t,     /* context_handle */
587                gss_qop_t,              /* qop_req */
588                struct mbuf *,          /* message_buffer */
589                struct mbuf **          /* message_token */
590               );
591
592 OM_uint32 gss_verify_mic_mbuf
593               (OM_uint32 *,            /* minor_status */
594                const gss_ctx_id_t,     /* context_handle */
595                struct mbuf *,          /* message_buffer */
596                struct mbuf *,          /* token_buffer */
597                gss_qop_t *             /* qop_state */
598               );
599
600 OM_uint32 gss_wrap_mbuf
601               (OM_uint32 *,            /* minor_status */
602                const gss_ctx_id_t,     /* context_handle */
603                int,                    /* conf_req_flag */
604                gss_qop_t,              /* qop_req */
605                struct mbuf **,         /* message_buffer */
606                int *                   /* conf_state */
607               );
608
609 OM_uint32 gss_unwrap_mbuf
610               (OM_uint32 *,            /* minor_status */
611                const gss_ctx_id_t,     /* context_handle */
612                struct mbuf **,         /* message_buffer */
613                int *,                  /* conf_state */
614                gss_qop_t *             /* qop_state */
615               );
616
617 __END_DECLS
618
619 #endif /* _KGSSAPI_GSSAPI_H_ */