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