xref: /xnu-11215.41.3/osfmk/gssd/gssd_mach.defs (revision 33de042d024d46de5ff4e89f2471de6608e37fa4)
1/*
2 * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#include <mach/std_types.defs>
30#include <mach/mach_types.defs>
31
32#ifdef KERNEL
33import <gssd/gssd_mach_types.h>;
34#else
35import <System/gssd/gssd_mach_types.h>;
36#endif
37
38type gssd_mechtype = int32_t;
39type gssd_nametype = int32_t;
40type gssd_string = c_string[*:1024]; /* MAX_PRINC_STR must be < 1024 */
41type gssd_dstring = c_string[*:128]; /* MAX_DISPLAY_STR must be < 128 */
42type gssd_byte_buffer = array [] of uint8_t;
43type gssd_verifier =  uint64_t;
44type gssd_gid_list = array [*:16] of uint32_t;
45type gssd_ctx = uint64_t;
46type gssd_cred = uint64_t;
47type gssd_etype_list = array [*:64] of int32_t;
48
49subsystem
50#if KERNEL_USER
51KernelUser
52#endif
53gssd_mach  999;
54
55serverprefix svc_;
56
57Routine mach_gss_init_sec_context(
58	server			: mach_port_t;
59	in  mech		: gssd_mechtype;
60	in  intoken		: gssd_byte_buffer;
61	in  uid			: uint32_t;
62	in  princ_namestr	: gssd_string;
63	in  svc_namestr		: gssd_string;
64	in  flags		: uint32_t;
65	in  gssd_flags		: uint32_t;
66	inout context		: gssd_ctx;
67	inout cred_handle	: gssd_cred;
68	ServerAuditToken atoken	: audit_token_t;
69	out  ret_flags		: uint32_t;
70	out  key		: gssd_byte_buffer, dealloc;
71	out outtoken		: gssd_byte_buffer, dealloc;
72	out major_stat		: uint32_t;
73	out minor_stat		: uint32_t
74);
75
76routine mach_gss_accept_sec_context(
77	server			: mach_port_t;
78	in  intoken		: gssd_byte_buffer;
79	in  svc_namestr		: gssd_string;
80	in  gssd_flags		: uint32_t;
81	inout context		: gssd_ctx;
82	inout cred_handle	: gssd_cred;
83	ServerAuditToken atoken	: audit_token_t;
84	out flags		: uint32_t;
85	out uid			: uint32_t;
86	out gids		: gssd_gid_list;
87	out key			: gssd_byte_buffer, dealloc;
88	out outtoken		: gssd_byte_buffer, dealloc;
89	out major_stat		: uint32_t;
90	out minor_stat		: uint32_t
91);
92
93simpleroutine mach_gss_log_error(
94	server			: mach_port_t;
95	in  mnt			: gssd_string;
96	in  uid			: uint32_t;
97	in  source		: gssd_string;
98	in  major_stat		: uint32_t;
99	in  minor_stat		: uint32_t;
100	ServerAuditToken atoken	: audit_token_t
101);
102
103routine mach_gss_init_sec_context_v2(
104	server			: mach_port_t;
105	in  mech		: gssd_mechtype;
106	in  intoken		: gssd_byte_buffer;
107	in  uid			: uint32_t;
108	in  clnt_nt		: gssd_nametype;
109	in  clnt_princ		: gssd_byte_buffer;
110	in  svc_nt		: gssd_nametype;
111	in  svc_princ		: gssd_byte_buffer;
112	in  flags		: uint32_t;
113	inout gssd_flags	: uint32_t;
114	inout context		: gssd_ctx;
115	inout cred_handle	: gssd_cred;
116	ServerAuditToken atoken	: audit_token_t;
117	out  ret_flags		: uint32_t;
118	out  key		: gssd_byte_buffer, dealloc;
119	out outtoken		: gssd_byte_buffer, dealloc;
120	out displayname		: gssd_dstring;
121	out major_stat		: uint32_t;
122	out minor_stat		: uint32_t
123);
124
125routine mach_gss_accept_sec_context_v2(
126	server			: mach_port_t;
127	in  intoken		: gssd_byte_buffer;
128	in  svc_nt		: gssd_nametype;
129	in  svc_princ		: gssd_byte_buffer;
130	inout gssd_flags	: uint32_t;
131	inout context		: gssd_ctx;
132	inout cred_handle	: gssd_cred;
133	ServerAuditToken atoken	: audit_token_t;
134	out flags		: uint32_t;
135	out uid			: uint32_t;
136	out gids		: gssd_gid_list;
137	out key			: gssd_byte_buffer, dealloc;
138	out outtoken		: gssd_byte_buffer, dealloc;
139	out major_stat		: uint32_t;
140	out minor_stat		: uint32_t
141);
142
143routine mach_gss_init_sec_context_v3(
144	server			: mach_port_t;
145	in  mech		: gssd_mechtype;
146	in  intoken		: gssd_byte_buffer;
147	in  uid			: uint32_t;
148	in  clnt_nt		: gssd_nametype;
149	in  clnt_princ		: gssd_byte_buffer;
150	in  svc_nt		: gssd_nametype;
151	in  svc_princ		: gssd_byte_buffer;
152	in  flags		: uint32_t;
153	in  etypes		: gssd_etype_list;
154	inout gssd_flags	: uint32_t;
155	inout context		: gssd_ctx;
156	inout cred_handle	: gssd_cred;
157	ServerAuditToken atoken	: audit_token_t;
158	out  ret_flags		: uint32_t;
159	out key			: gssd_byte_buffer, dealloc;
160	out outtoken		: gssd_byte_buffer, dealloc;
161	out displayname		: gssd_dstring;
162	out major_stat		: uint32_t;
163	out minor_stat		: uint32_t
164);
165
166routine mach_gss_hold_cred(
167	server			: mach_port_t;
168	in  mech		: gssd_mechtype;
169	in  nt			: gssd_nametype;
170	in  princ		: gssd_byte_buffer;
171	ServerAuditToken atoken	: audit_token_t;
172	out major_stat		: uint32_t;
173	out minor_stat		: uint32_t
174);
175
176routine mach_gss_unhold_cred(
177	server			: mach_port_t;
178	in  mech		: gssd_mechtype;
179	in  nt			: gssd_nametype;
180	in  princ		: gssd_byte_buffer;
181	ServerAuditToken atoken	: audit_token_t;
182	out major_stat		: uint32_t;
183	out minor_stat		: uint32_t
184);
185
186routine mach_gss_lookup(
187	server			: mach_port_t;
188	in  uid			: uint32_t;
189	in  asid		: int32_t;
190	ServerAuditToken atoken	: audit_token_t;
191	out gssd_session_port	: mach_port_t
192);
193