1 /*- 2 * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ 3 * Authors: Doug Rabson <dfr@rabson.org> 4 * Developed with Red Inc: Alfred Perlstein <alfred@freebsd.org> 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28 29 #ifdef RPC_HDR 30 31 %#ifdef _KERNEL 32 %#include <kgssapi/gssapi.h> 33 %#else 34 %#include <gssapi/gssapi.h> 35 %#include <netdb.h> 36 %#endif 37 38 %extern bool_t xdr_gss_buffer_desc(XDR *xdrs, gss_buffer_desc *buf); 39 %extern bool_t xdr_gss_OID_desc(XDR *xdrs, gss_OID_desc *oid); 40 %extern bool_t xdr_gss_OID(XDR *xdrs, gss_OID *oidp); 41 %extern bool_t xdr_gss_OID_set_desc(XDR *xdrs, gss_OID_set_desc *set); 42 %extern bool_t xdr_gss_OID_set(XDR *xdrs, gss_OID_set *setp); 43 %extern bool_t xdr_gss_channel_bindings_t(XDR *xdrs, gss_channel_bindings_t *chp); 44 45 #endif 46 47 typedef uint64_t gssd_ctx_id_t; 48 typedef uint64_t gssd_cred_id_t; 49 typedef uint64_t gssd_name_t; 50 51 struct kgss_lucid_desc { 52 uint32_t initiate; 53 uint32_t endtime; 54 uint64_t send_seq; 55 uint64_t recv_seq; 56 uint32_t protocol; 57 uint32_t rfc_sign; 58 uint32_t rfc_seal; 59 uint32_t have_subkey; 60 uint32_t ctx_type; 61 gss_buffer_desc ctx_key; 62 uint32_t subkey_type; 63 gss_buffer_desc subkey_key; 64 }; 65 66 struct init_sec_context_res { 67 uint32_t major_status; 68 uint32_t minor_status; 69 gssd_ctx_id_t ctx; 70 gss_OID actual_mech_type; 71 gss_buffer_desc output_token; 72 uint32_t ret_flags; 73 uint32_t time_rec; 74 }; 75 76 struct init_sec_context_args { 77 uint32_t uid; 78 gssd_cred_id_t cred; 79 gssd_ctx_id_t ctx; 80 gssd_name_t name; 81 gss_OID mech_type; 82 uint32_t req_flags; 83 uint32_t time_req; 84 gss_channel_bindings_t input_chan_bindings; 85 gss_buffer_desc input_token; 86 }; 87 88 struct init_sec_context_lucid_v1_res { 89 uint32_t major_status; 90 uint32_t minor_status; 91 gssd_ctx_id_t ctx; 92 gss_OID actual_mech_type; 93 gss_buffer_desc output_token; 94 uint32_t ret_flags; 95 uint32_t time_rec; 96 kgss_lucid_desc lucid; 97 }; 98 99 struct init_sec_context_lucid_v1_args { 100 uint32_t uid; 101 gssd_cred_id_t cred; 102 gssd_ctx_id_t ctx; 103 gssd_name_t name; 104 gss_OID mech_type; 105 uint32_t req_flags; 106 uint32_t time_req; 107 gss_channel_bindings_t input_chan_bindings; 108 gss_buffer_desc input_token; 109 }; 110 111 struct accept_sec_context_res { 112 uint32_t major_status; 113 uint32_t minor_status; 114 gssd_ctx_id_t ctx; 115 gssd_name_t src_name; 116 gss_OID mech_type; 117 gss_buffer_desc output_token; 118 uint32_t ret_flags; 119 uint32_t time_rec; 120 gssd_cred_id_t delegated_cred_handle; 121 }; 122 123 struct accept_sec_context_args { 124 gssd_ctx_id_t ctx; 125 gssd_cred_id_t cred; 126 gss_buffer_desc input_token; 127 gss_channel_bindings_t input_chan_bindings; 128 }; 129 130 struct accept_sec_context_lucid_v1_res { 131 uint32_t major_status; 132 uint32_t minor_status; 133 gssd_ctx_id_t ctx; 134 gssd_name_t src_name; 135 gss_OID mech_type; 136 gss_buffer_desc output_token; 137 uint32_t ret_flags; 138 uint32_t time_rec; 139 gssd_cred_id_t delegated_cred_handle; 140 kgss_lucid_desc lucid; 141 gss_buffer_desc exported_name; 142 uint32_t uid; 143 uint32_t gid; 144 uint32_t gidlist<>; 145 }; 146 147 struct accept_sec_context_lucid_v1_args { 148 gssd_ctx_id_t ctx; 149 gssd_cred_id_t cred; 150 gss_buffer_desc input_token; 151 gss_channel_bindings_t input_chan_bindings; 152 }; 153 154 struct delete_sec_context_res { 155 uint32_t major_status; 156 uint32_t minor_status; 157 gss_buffer_desc output_token; 158 }; 159 160 struct delete_sec_context_args { 161 gssd_ctx_id_t ctx; 162 }; 163 164 enum sec_context_format { 165 KGSS_HEIMDAL_0_6, 166 KGSS_HEIMDAL_1_1, 167 MIT_V1 168 }; 169 170 struct export_sec_context_res { 171 uint32_t major_status; 172 uint32_t minor_status; 173 enum sec_context_format format; 174 gss_buffer_desc interprocess_token; 175 }; 176 177 struct export_sec_context_args { 178 gssd_ctx_id_t ctx; 179 }; 180 181 struct import_name_res { 182 uint32_t major_status; 183 uint32_t minor_status; 184 gssd_name_t output_name; 185 }; 186 187 struct import_name_args { 188 gss_buffer_desc input_name_buffer; 189 gss_OID input_name_type; 190 }; 191 192 struct canonicalize_name_res { 193 uint32_t major_status; 194 uint32_t minor_status; 195 gssd_name_t output_name; 196 }; 197 198 struct canonicalize_name_args { 199 gssd_name_t input_name; 200 gss_OID mech_type; 201 }; 202 203 struct export_name_res { 204 uint32_t major_status; 205 uint32_t minor_status; 206 gss_buffer_desc exported_name; 207 }; 208 209 struct export_name_args { 210 gssd_name_t input_name; 211 }; 212 213 struct release_name_res { 214 uint32_t major_status; 215 uint32_t minor_status; 216 }; 217 218 struct release_name_args { 219 gssd_name_t input_name; 220 }; 221 222 struct pname_to_uid_res { 223 uint32_t major_status; 224 uint32_t minor_status; 225 uint32_t uid; 226 uint32_t gid; 227 uint32_t gidlist<>; 228 }; 229 230 struct pname_to_uid_args { 231 gssd_name_t pname; 232 gss_OID mech; 233 }; 234 235 struct acquire_cred_res { 236 uint32_t major_status; 237 uint32_t minor_status; 238 gssd_cred_id_t output_cred; 239 gss_OID_set actual_mechs; 240 uint32_t time_rec; 241 }; 242 243 struct acquire_cred_args { 244 uint32_t uid; 245 gssd_name_t desired_name; 246 uint32_t time_req; 247 gss_OID_set desired_mechs; 248 int cred_usage; 249 }; 250 251 struct set_cred_option_res { 252 uint32_t major_status; 253 uint32_t minor_status; 254 }; 255 256 struct set_cred_option_args { 257 gssd_cred_id_t cred; 258 gss_OID option_name; 259 gss_buffer_desc option_value; 260 }; 261 262 struct release_cred_res { 263 uint32_t major_status; 264 uint32_t minor_status; 265 }; 266 267 struct release_cred_args { 268 gssd_cred_id_t cred; 269 }; 270 271 struct display_status_res { 272 uint32_t major_status; 273 uint32_t minor_status; 274 uint32_t message_context; 275 gss_buffer_desc status_string; 276 }; 277 278 struct display_status_args { 279 uint32_t status_value; 280 int status_type; 281 gss_OID mech_type; 282 uint32_t message_context; 283 }; 284 285 struct ip_to_dns_res { 286 uint32_t major_status; 287 uint32_t minor_status; 288 char dns_name<NI_MAXHOST>; 289 }; 290 291 struct ip_to_dns_args { 292 char ip_addr<NI_MAXHOST>; 293 }; 294 295 struct supports_lucid_res { 296 uint32_t major_status; 297 uint32_t vers; 298 }; 299 300 program GSSD { 301 version GSSDVERS { 302 void GSSD_NULL(void) = 0; 303 304 init_sec_context_res 305 GSSD_INIT_SEC_CONTEXT(init_sec_context_args) = 1; 306 307 accept_sec_context_res 308 GSSD_ACCEPT_SEC_CONTEXT(accept_sec_context_args) = 2; 309 310 delete_sec_context_res 311 GSSD_DELETE_SEC_CONTEXT(delete_sec_context_args) = 3; 312 313 export_sec_context_res 314 GSSD_EXPORT_SEC_CONTEXT(export_sec_context_args) = 4; 315 316 import_name_res 317 GSSD_IMPORT_NAME(import_name_args) = 5; 318 319 canonicalize_name_res 320 GSSD_CANONICALIZE_NAME(canonicalize_name_args) = 6; 321 322 export_name_res 323 GSSD_EXPORT_NAME(export_name_args) = 7; 324 325 release_name_res 326 GSSD_RELEASE_NAME(release_name_args) = 8; 327 328 pname_to_uid_res 329 GSSD_PNAME_TO_UID(pname_to_uid_args) = 9; 330 331 acquire_cred_res 332 GSSD_ACQUIRE_CRED(acquire_cred_args) = 10; 333 334 set_cred_option_res 335 GSSD_SET_CRED_OPTION(set_cred_option_args) = 11; 336 337 release_cred_res 338 GSSD_RELEASE_CRED(release_cred_args) = 12; 339 340 display_status_res 341 GSSD_DISPLAY_STATUS(display_status_args) = 13; 342 343 ip_to_dns_res 344 GSSD_IP_TO_DNS(ip_to_dns_args) = 14; 345 346 init_sec_context_lucid_v1_res 347 GSSD_INIT_SEC_CONTEXT_LUCID_V1(init_sec_context_lucid_v1_args) = 15; 348 349 accept_sec_context_lucid_v1_res 350 GSSD_ACCEPT_SEC_CONTEXT_LUCID_V1(accept_sec_context_lucid_v1_args) = 16; 351 352 supports_lucid_res 353 GSSD_SUPPORTS_LUCID(void) = 17; 354 } = 1; 355 } = 0x40677373; 356