17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5ab9b2e15Sgtb * Common Development and Distribution License (the "License"). 6ab9b2e15Sgtb * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 225e01956fSGlenn Barry * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 237c478bd9Sstevel@tonic-gate */ 247c478bd9Sstevel@tonic-gate 25ab9b2e15Sgtb /* 26ab9b2e15Sgtb * This header contains the private mechglue definitions. 27ab9b2e15Sgtb * 28ab9b2e15Sgtb */ 297c478bd9Sstevel@tonic-gate 30ab9b2e15Sgtb #ifndef _GSS_MECHGLUEP_H 31ab9b2e15Sgtb #define _GSS_MECHGLUEP_H 32ab9b2e15Sgtb 33ab9b2e15Sgtb #if 0 /* SUNW15resync - disable for sake of non-krb5 mechs */ 34ab9b2e15Sgtb #include "autoconf.h" 357c478bd9Sstevel@tonic-gate #endif 367c478bd9Sstevel@tonic-gate 37ab9b2e15Sgtb /* SUNW15resync */ 38ab9b2e15Sgtb #ifndef GSS_DLLIMP 39ab9b2e15Sgtb #define GSS_DLLIMP 40ab9b2e15Sgtb #endif 41ab9b2e15Sgtb 42ab9b2e15Sgtb #include <gssapi/gssapi_ext.h> /* SUNW15resync - mechglue.h in mit 1.5 */ 435e01956fSGlenn Barry #if 0 /* Solaris Kerberos */ 445e01956fSGlenn Barry #include "gssapiP_generic.h" 455e01956fSGlenn Barry #endif 46ab9b2e15Sgtb 47ab9b2e15Sgtb #ifdef _KERNEL 48ab9b2e15Sgtb #include <rpc/rpc.h> 49ab9b2e15Sgtb #endif 50ab9b2e15Sgtb 51ab9b2e15Sgtb #ifndef g_OID_copy /* SUNW15resync */ 52ab9b2e15Sgtb #define g_OID_copy(o1, o2) \ 53ab9b2e15Sgtb do { \ 54ab9b2e15Sgtb memcpy((o1)->elements, (o2)->elements, (o2)->length); \ 55ab9b2e15Sgtb (o1)->length = (o2)->length; \ 56ab9b2e15Sgtb } while (0) 57ab9b2e15Sgtb #endif 58ab9b2e15Sgtb 59ab9b2e15Sgtb #define GSS_EMPTY_BUFFER(buf) ((buf) == NULL ||\ 60ab9b2e15Sgtb (buf)->value == NULL || (buf)->length == 0) 61ab9b2e15Sgtb 627c478bd9Sstevel@tonic-gate /* 637c478bd9Sstevel@tonic-gate * Array of context IDs typed by mechanism OID 647c478bd9Sstevel@tonic-gate */ 657c478bd9Sstevel@tonic-gate typedef struct gss_union_ctx_id_t { 667c478bd9Sstevel@tonic-gate gss_OID mech_type; 677c478bd9Sstevel@tonic-gate gss_ctx_id_t internal_ctx_id; 687c478bd9Sstevel@tonic-gate } gss_union_ctx_id_desc, *gss_union_ctx_id_t; 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gate /* 717c478bd9Sstevel@tonic-gate * Generic GSSAPI names. A name can either be a generic name, or a 727c478bd9Sstevel@tonic-gate * mechanism specific name.... 737c478bd9Sstevel@tonic-gate */ 74ba7b222eSGlenn Barry typedef struct gss_name_struct { 75ba7b222eSGlenn Barry struct gss_name_struct *loopback; 767c478bd9Sstevel@tonic-gate gss_OID name_type; 777c478bd9Sstevel@tonic-gate gss_buffer_t external_name; 787c478bd9Sstevel@tonic-gate /* 797c478bd9Sstevel@tonic-gate * These last two fields are only filled in for mechanism 807c478bd9Sstevel@tonic-gate * names. 817c478bd9Sstevel@tonic-gate */ 827c478bd9Sstevel@tonic-gate gss_OID mech_type; 837c478bd9Sstevel@tonic-gate gss_name_t mech_name; 847c478bd9Sstevel@tonic-gate } gss_union_name_desc, *gss_union_name_t; 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate /* 877c478bd9Sstevel@tonic-gate * Structure for holding list of mechanism-specific name types 887c478bd9Sstevel@tonic-gate */ 897c478bd9Sstevel@tonic-gate typedef struct gss_mech_spec_name_t { 907c478bd9Sstevel@tonic-gate gss_OID name_type; 917c478bd9Sstevel@tonic-gate gss_OID mech; 927c478bd9Sstevel@tonic-gate struct gss_mech_spec_name_t *next, *prev; 937c478bd9Sstevel@tonic-gate } gss_mech_spec_name_desc, *gss_mech_spec_name; 947c478bd9Sstevel@tonic-gate 957c478bd9Sstevel@tonic-gate /* 967c478bd9Sstevel@tonic-gate * Credential auxiliary info, used in the credential structure 977c478bd9Sstevel@tonic-gate */ 987c478bd9Sstevel@tonic-gate typedef struct gss_union_cred_auxinfo { 997c478bd9Sstevel@tonic-gate gss_buffer_desc name; 1007c478bd9Sstevel@tonic-gate gss_OID name_type; 1017c478bd9Sstevel@tonic-gate OM_uint32 creation_time; 1027c478bd9Sstevel@tonic-gate OM_uint32 time_rec; 1037c478bd9Sstevel@tonic-gate int cred_usage; 1047c478bd9Sstevel@tonic-gate } gss_union_cred_auxinfo; 1057c478bd9Sstevel@tonic-gate 1067c478bd9Sstevel@tonic-gate /* 1077c478bd9Sstevel@tonic-gate * Set of Credentials typed on mechanism OID 1087c478bd9Sstevel@tonic-gate */ 1097c478bd9Sstevel@tonic-gate typedef struct gss_union_cred_t { 1107c478bd9Sstevel@tonic-gate int count; 1117c478bd9Sstevel@tonic-gate gss_OID mechs_array; 1127c478bd9Sstevel@tonic-gate gss_cred_id_t *cred_array; 1137c478bd9Sstevel@tonic-gate gss_union_cred_auxinfo auxinfo; 1147c478bd9Sstevel@tonic-gate } gss_union_cred_desc, *gss_union_cred_t; 1157c478bd9Sstevel@tonic-gate 116ab9b2e15Sgtb /* Solaris Kerberos */ 1177c478bd9Sstevel@tonic-gate typedef OM_uint32 (*gss_acquire_cred_with_password_sfct)( 1187c478bd9Sstevel@tonic-gate void *, /* context */ 1197c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 1207c478bd9Sstevel@tonic-gate const gss_name_t, /* desired_name */ 1217c478bd9Sstevel@tonic-gate const gss_buffer_t, /* password */ 1227c478bd9Sstevel@tonic-gate OM_uint32, /* time_req */ 1237c478bd9Sstevel@tonic-gate const gss_OID_set, /* desired_mechs */ 1247c478bd9Sstevel@tonic-gate int, /* cred_usage */ 1257c478bd9Sstevel@tonic-gate gss_cred_id_t *, /* output_cred_handle */ 1267c478bd9Sstevel@tonic-gate gss_OID_set *, /* actual_mechs */ 1277c478bd9Sstevel@tonic-gate OM_uint32 * /* time_rec */ 1287c478bd9Sstevel@tonic-gate /* */); 1297c478bd9Sstevel@tonic-gate 1305e01956fSGlenn Barry /* 1315e01956fSGlenn Barry * Rudimentary pointer validation macro to check whether the 1325e01956fSGlenn Barry * "loopback" field of an opaque struct points back to itself. This 1335e01956fSGlenn Barry * field also catches some programming errors where an opaque pointer 1345e01956fSGlenn Barry * is passed to a function expecting the address of the opaque 1355e01956fSGlenn Barry * pointer. 1365e01956fSGlenn Barry */ 1375e01956fSGlenn Barry #if 0 /* Solaris Kerberos - revisit for full 1.7/next resync */ 1385e01956fSGlenn Barry #define GSSINT_CHK_LOOP(p) (!((p) != NULL && (p)->loopback == (p))) 1395e01956fSGlenn Barry #else 1405e01956fSGlenn Barry #define GSSINT_CHK_LOOP(p) ((p) == NULL) 1415e01956fSGlenn Barry #endif 142ab9b2e15Sgtb 143ab9b2e15Sgtb 144ab9b2e15Sgtb /********************************************************/ 145ab9b2e15Sgtb /* The Mechanism Dispatch Table -- a mechanism needs to */ 146ab9b2e15Sgtb /* define one of these and provide a function to return */ 147ab9b2e15Sgtb /* it to initialize the GSSAPI library */ 148ab9b2e15Sgtb 1497c478bd9Sstevel@tonic-gate /* 1507c478bd9Sstevel@tonic-gate * This is the definition of the mechs_array struct, which is used to 1517c478bd9Sstevel@tonic-gate * define the mechs array table. This table is used to indirectly 1527c478bd9Sstevel@tonic-gate * access mechanism specific versions of the gssapi routines through 1537c478bd9Sstevel@tonic-gate * the routines in the glue module (gssd_mech_glue.c) 1547c478bd9Sstevel@tonic-gate * 155ab9b2e15Sgtb * This contants all of the functions defined in gssapi.h except for 1567c478bd9Sstevel@tonic-gate * gss_release_buffer() and gss_release_oid_set(), which I am 1577c478bd9Sstevel@tonic-gate * assuming, for now, to be equal across mechanisms. 1587c478bd9Sstevel@tonic-gate */ 1597c478bd9Sstevel@tonic-gate 1607c478bd9Sstevel@tonic-gate typedef struct gss_config { 161ab9b2e15Sgtb #if 0 /* Solaris Kerberos */ 162ab9b2e15Sgtb OM_uint32 priority; 163ab9b2e15Sgtb char * mechNameStr; 164ab9b2e15Sgtb #endif 1657c478bd9Sstevel@tonic-gate gss_OID_desc mech_type; 1667c478bd9Sstevel@tonic-gate void * context; 1677c478bd9Sstevel@tonic-gate #ifdef _KERNEL 1687c478bd9Sstevel@tonic-gate struct gss_config *next; 1697c478bd9Sstevel@tonic-gate bool_t uses_kmod; 1707c478bd9Sstevel@tonic-gate #endif 1717c478bd9Sstevel@tonic-gate 1727c478bd9Sstevel@tonic-gate #ifndef _KERNEL 1737c478bd9Sstevel@tonic-gate OM_uint32 (*gss_acquire_cred) 1747c478bd9Sstevel@tonic-gate ( 1757c478bd9Sstevel@tonic-gate void *, /* context */ 176ba7b222eSGlenn Barry 1777c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 1787c478bd9Sstevel@tonic-gate const gss_name_t, /* desired_name */ 1797c478bd9Sstevel@tonic-gate OM_uint32, /* time_req */ 1807c478bd9Sstevel@tonic-gate const gss_OID_set, /* desired_mechs */ 1817c478bd9Sstevel@tonic-gate int, /* cred_usage */ 1827c478bd9Sstevel@tonic-gate gss_cred_id_t *, /* output_cred_handle */ 1837c478bd9Sstevel@tonic-gate gss_OID_set *, /* actual_mechs */ 1847c478bd9Sstevel@tonic-gate OM_uint32 * /* time_rec */ 1857c478bd9Sstevel@tonic-gate /* */); 1867c478bd9Sstevel@tonic-gate OM_uint32 (*gss_release_cred) 1877c478bd9Sstevel@tonic-gate ( 188ba7b222eSGlenn Barry 1897c478bd9Sstevel@tonic-gate void *, /* context */ 1907c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 1917c478bd9Sstevel@tonic-gate gss_cred_id_t * /* cred_handle */ 1927c478bd9Sstevel@tonic-gate /* */); 1937c478bd9Sstevel@tonic-gate OM_uint32 (*gss_init_sec_context) 1947c478bd9Sstevel@tonic-gate ( 1957c478bd9Sstevel@tonic-gate void *, /* context */ 1967c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 1977c478bd9Sstevel@tonic-gate const gss_cred_id_t, /* claimant_cred_handle */ 1987c478bd9Sstevel@tonic-gate gss_ctx_id_t *, /* context_handle */ 1997c478bd9Sstevel@tonic-gate const gss_name_t, /* target_name */ 2007c478bd9Sstevel@tonic-gate const gss_OID, /* mech_type */ 2017c478bd9Sstevel@tonic-gate OM_uint32, /* req_flags */ 2027c478bd9Sstevel@tonic-gate OM_uint32, /* time_req */ 2037c478bd9Sstevel@tonic-gate const gss_channel_bindings_t, /* input_chan_bindings */ 2047c478bd9Sstevel@tonic-gate const gss_buffer_t, /* input_token */ 2057c478bd9Sstevel@tonic-gate gss_OID*, /* actual_mech_type */ 2067c478bd9Sstevel@tonic-gate gss_buffer_t, /* output_token */ 2077c478bd9Sstevel@tonic-gate OM_uint32 *, /* ret_flags */ 2087c478bd9Sstevel@tonic-gate OM_uint32 * /* time_rec */ 2097c478bd9Sstevel@tonic-gate /* */); 2107c478bd9Sstevel@tonic-gate OM_uint32 (*gss_accept_sec_context) 2117c478bd9Sstevel@tonic-gate ( 2127c478bd9Sstevel@tonic-gate void *, /* context */ 2137c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 2147c478bd9Sstevel@tonic-gate gss_ctx_id_t *, /* context_handle */ 2157c478bd9Sstevel@tonic-gate const gss_cred_id_t, /* verifier_cred_handle */ 2167c478bd9Sstevel@tonic-gate const gss_buffer_t, /* input_token_buffer */ 2177c478bd9Sstevel@tonic-gate const gss_channel_bindings_t, /* input_chan_bindings */ 2187c478bd9Sstevel@tonic-gate gss_name_t *, /* src_name */ 2197c478bd9Sstevel@tonic-gate gss_OID*, /* mech_type */ 2207c478bd9Sstevel@tonic-gate gss_buffer_t, /* output_token */ 2217c478bd9Sstevel@tonic-gate OM_uint32 *, /* ret_flags */ 2227c478bd9Sstevel@tonic-gate OM_uint32 *, /* time_rec */ 2237c478bd9Sstevel@tonic-gate gss_cred_id_t * /* delegated_cred_handle */ 2247c478bd9Sstevel@tonic-gate /* */); 2257c478bd9Sstevel@tonic-gate /* EXPORT DELETE START */ /* CRYPT DELETE START */ 2267c478bd9Sstevel@tonic-gate #endif /* ! _KERNEL */ 2277c478bd9Sstevel@tonic-gate 2287c478bd9Sstevel@tonic-gate /* 2297c478bd9Sstevel@tonic-gate * Note: there are two gss_unseal's in here. Make any changes to both. 2307c478bd9Sstevel@tonic-gate */ 2317c478bd9Sstevel@tonic-gate OM_uint32 (*gss_unseal) 2327c478bd9Sstevel@tonic-gate ( 2337c478bd9Sstevel@tonic-gate void *, /* context */ 2347c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 2357c478bd9Sstevel@tonic-gate const gss_ctx_id_t, /* context_handle */ 2367c478bd9Sstevel@tonic-gate const gss_buffer_t, /* input_message_buffer */ 2377c478bd9Sstevel@tonic-gate gss_buffer_t, /* output_message_buffer */ 2387c478bd9Sstevel@tonic-gate int *, /* conf_state */ 2397c478bd9Sstevel@tonic-gate int * /* qop_state */ 2407c478bd9Sstevel@tonic-gate #ifdef _KERNEL 2417c478bd9Sstevel@tonic-gate /* */, OM_uint32 2427c478bd9Sstevel@tonic-gate #endif 2437c478bd9Sstevel@tonic-gate /* */); 2447c478bd9Sstevel@tonic-gate #ifndef _KERNEL 2457c478bd9Sstevel@tonic-gate /* EXPORT DELETE END */ /* CRYPT DELETE END */ 2467c478bd9Sstevel@tonic-gate OM_uint32 (*gss_process_context_token) 2477c478bd9Sstevel@tonic-gate ( 2487c478bd9Sstevel@tonic-gate void *, /* context */ 2497c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 2507c478bd9Sstevel@tonic-gate const gss_ctx_id_t, /* context_handle */ 2517c478bd9Sstevel@tonic-gate const gss_buffer_t /* token_buffer */ 2527c478bd9Sstevel@tonic-gate /* */); 2537c478bd9Sstevel@tonic-gate #endif /* ! _KERNEL */ 2547c478bd9Sstevel@tonic-gate OM_uint32 (*gss_delete_sec_context) 2557c478bd9Sstevel@tonic-gate ( 2567c478bd9Sstevel@tonic-gate void *, /* context */ 2577c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 2587c478bd9Sstevel@tonic-gate gss_ctx_id_t *, /* context_handle */ 2597c478bd9Sstevel@tonic-gate gss_buffer_t /* output_token */ 2607c478bd9Sstevel@tonic-gate #ifdef _KERNEL 2617c478bd9Sstevel@tonic-gate /* */, OM_uint32 2627c478bd9Sstevel@tonic-gate #endif 2637c478bd9Sstevel@tonic-gate /* */); 2647c478bd9Sstevel@tonic-gate #ifndef _KERNEL 2657c478bd9Sstevel@tonic-gate OM_uint32 (*gss_context_time) 2667c478bd9Sstevel@tonic-gate ( 2677c478bd9Sstevel@tonic-gate void *, /* context */ 2687c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 2697c478bd9Sstevel@tonic-gate const gss_ctx_id_t, /* context_handle */ 2707c478bd9Sstevel@tonic-gate OM_uint32 * /* time_rec */ 2717c478bd9Sstevel@tonic-gate /* */); 2727c478bd9Sstevel@tonic-gate OM_uint32 (*gss_display_status) 2737c478bd9Sstevel@tonic-gate ( 2747c478bd9Sstevel@tonic-gate void *, /* context */ 2757c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 2767c478bd9Sstevel@tonic-gate OM_uint32, /* status_value */ 2777c478bd9Sstevel@tonic-gate int, /* status_type */ 2787c478bd9Sstevel@tonic-gate const gss_OID, /* mech_type */ 2797c478bd9Sstevel@tonic-gate OM_uint32 *, /* message_context */ 2807c478bd9Sstevel@tonic-gate gss_buffer_t /* status_string */ 2817c478bd9Sstevel@tonic-gate /* */); 2827c478bd9Sstevel@tonic-gate OM_uint32 (*gss_indicate_mechs) 2837c478bd9Sstevel@tonic-gate ( 2847c478bd9Sstevel@tonic-gate void *, /* context */ 2857c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 2867c478bd9Sstevel@tonic-gate gss_OID_set * /* mech_set */ 2877c478bd9Sstevel@tonic-gate /* */); 2887c478bd9Sstevel@tonic-gate OM_uint32 (*gss_compare_name) 2897c478bd9Sstevel@tonic-gate ( 2907c478bd9Sstevel@tonic-gate void *, /* context */ 2917c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 2927c478bd9Sstevel@tonic-gate const gss_name_t, /* name1 */ 2937c478bd9Sstevel@tonic-gate const gss_name_t, /* name2 */ 2947c478bd9Sstevel@tonic-gate int * /* name_equal */ 2957c478bd9Sstevel@tonic-gate /* */); 2967c478bd9Sstevel@tonic-gate OM_uint32 (*gss_display_name) 2977c478bd9Sstevel@tonic-gate ( 2987c478bd9Sstevel@tonic-gate void *, /* context */ 2997c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 3007c478bd9Sstevel@tonic-gate const gss_name_t, /* input_name */ 3017c478bd9Sstevel@tonic-gate gss_buffer_t, /* output_name_buffer */ 3027c478bd9Sstevel@tonic-gate gss_OID* /* output_name_type */ 3037c478bd9Sstevel@tonic-gate /* */); 3047c478bd9Sstevel@tonic-gate OM_uint32 (*gss_import_name) 3057c478bd9Sstevel@tonic-gate ( 3067c478bd9Sstevel@tonic-gate void *, /* context */ 3077c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 3087c478bd9Sstevel@tonic-gate const gss_buffer_t, /* input_name_buffer */ 3097c478bd9Sstevel@tonic-gate const gss_OID, /* input_name_type */ 3107c478bd9Sstevel@tonic-gate gss_name_t * /* output_name */ 3117c478bd9Sstevel@tonic-gate /* */); 3127c478bd9Sstevel@tonic-gate OM_uint32 (*gss_release_name) 3137c478bd9Sstevel@tonic-gate ( 3147c478bd9Sstevel@tonic-gate void *, /* context */ 3157c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 3167c478bd9Sstevel@tonic-gate gss_name_t * /* input_name */ 3177c478bd9Sstevel@tonic-gate /* */); 3187c478bd9Sstevel@tonic-gate OM_uint32 (*gss_inquire_cred) 3197c478bd9Sstevel@tonic-gate ( 3207c478bd9Sstevel@tonic-gate void *, /* context */ 3217c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 3227c478bd9Sstevel@tonic-gate const gss_cred_id_t, /* cred_handle */ 3237c478bd9Sstevel@tonic-gate gss_name_t *, /* name */ 3247c478bd9Sstevel@tonic-gate OM_uint32 *, /* lifetime */ 3257c478bd9Sstevel@tonic-gate int *, /* cred_usage */ 3267c478bd9Sstevel@tonic-gate gss_OID_set * /* mechanisms */ 3277c478bd9Sstevel@tonic-gate /* */); 3287c478bd9Sstevel@tonic-gate OM_uint32 (*gss_add_cred) 3297c478bd9Sstevel@tonic-gate ( 3307c478bd9Sstevel@tonic-gate void *, /* context */ 3317c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 3327c478bd9Sstevel@tonic-gate const gss_cred_id_t, /* input_cred_handle */ 3337c478bd9Sstevel@tonic-gate const gss_name_t, /* desired_name */ 3347c478bd9Sstevel@tonic-gate const gss_OID, /* desired_mech */ 3357c478bd9Sstevel@tonic-gate gss_cred_usage_t, /* cred_usage */ 3367c478bd9Sstevel@tonic-gate OM_uint32, /* initiator_time_req */ 3377c478bd9Sstevel@tonic-gate OM_uint32, /* acceptor_time_req */ 3387c478bd9Sstevel@tonic-gate gss_cred_id_t *, /* output_cred_handle */ 3397c478bd9Sstevel@tonic-gate gss_OID_set *, /* actual_mechs */ 3407c478bd9Sstevel@tonic-gate OM_uint32 *, /* initiator_time_rec */ 3417c478bd9Sstevel@tonic-gate OM_uint32 * /* acceptor_time_rec */ 3427c478bd9Sstevel@tonic-gate /* */); 3437c478bd9Sstevel@tonic-gate /* EXPORT DELETE START */ /* CRYPT DELETE START */ 3447c478bd9Sstevel@tonic-gate #endif /* ! _KERNEL */ 3457c478bd9Sstevel@tonic-gate /* 3467c478bd9Sstevel@tonic-gate * Note: there are two gss_seal's in here. Make any changes to both. 3477c478bd9Sstevel@tonic-gate */ 3487c478bd9Sstevel@tonic-gate OM_uint32 (*gss_seal) 3497c478bd9Sstevel@tonic-gate ( 3507c478bd9Sstevel@tonic-gate void *, /* context */ 3517c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 3527c478bd9Sstevel@tonic-gate const gss_ctx_id_t, /* context_handle */ 3537c478bd9Sstevel@tonic-gate int, /* conf_req_flag */ 3547c478bd9Sstevel@tonic-gate int, /* qop_req */ 3557c478bd9Sstevel@tonic-gate const gss_buffer_t, /* input_message_buffer */ 3567c478bd9Sstevel@tonic-gate int *, /* conf_state */ 3577c478bd9Sstevel@tonic-gate gss_buffer_t /* output_message_buffer */ 3587c478bd9Sstevel@tonic-gate #ifdef _KERNEL 3597c478bd9Sstevel@tonic-gate /* */, OM_uint32 3607c478bd9Sstevel@tonic-gate #endif 3617c478bd9Sstevel@tonic-gate /* */); 3627c478bd9Sstevel@tonic-gate #ifndef _KERNEL 3637c478bd9Sstevel@tonic-gate /* EXPORT DELETE END */ /* CRYPT DELETE END */ 3647c478bd9Sstevel@tonic-gate OM_uint32 (*gss_export_sec_context) 3657c478bd9Sstevel@tonic-gate ( 3667c478bd9Sstevel@tonic-gate void *, /* context */ 3677c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 3687c478bd9Sstevel@tonic-gate gss_ctx_id_t *, /* context_handle */ 3697c478bd9Sstevel@tonic-gate gss_buffer_t /* interprocess_token */ 3707c478bd9Sstevel@tonic-gate /* */); 3717c478bd9Sstevel@tonic-gate #endif /* ! _KERNEL */ 3727c478bd9Sstevel@tonic-gate OM_uint32 (*gss_import_sec_context) 3737c478bd9Sstevel@tonic-gate ( 3747c478bd9Sstevel@tonic-gate void *, /* context */ 3757c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 3767c478bd9Sstevel@tonic-gate const gss_buffer_t, /* interprocess_token */ 3777c478bd9Sstevel@tonic-gate gss_ctx_id_t * /* context_handle */ 3787c478bd9Sstevel@tonic-gate /* */); 3797c478bd9Sstevel@tonic-gate #ifndef _KERNEL 3807c478bd9Sstevel@tonic-gate OM_uint32 (*gss_inquire_cred_by_mech) 3817c478bd9Sstevel@tonic-gate ( 3827c478bd9Sstevel@tonic-gate void *, /* context */ 3837c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 3847c478bd9Sstevel@tonic-gate const gss_cred_id_t, /* cred_handle */ 3857c478bd9Sstevel@tonic-gate const gss_OID, /* mech_type */ 3867c478bd9Sstevel@tonic-gate gss_name_t *, /* name */ 3877c478bd9Sstevel@tonic-gate OM_uint32 *, /* initiator_lifetime */ 3887c478bd9Sstevel@tonic-gate OM_uint32 *, /* acceptor_lifetime */ 3897c478bd9Sstevel@tonic-gate gss_cred_usage_t * /* cred_usage */ 3907c478bd9Sstevel@tonic-gate /* */); 3917c478bd9Sstevel@tonic-gate OM_uint32 (*gss_inquire_names_for_mech) 3927c478bd9Sstevel@tonic-gate ( 3937c478bd9Sstevel@tonic-gate void *, /* context */ 3947c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 3957c478bd9Sstevel@tonic-gate const gss_OID, /* mechanism */ 3967c478bd9Sstevel@tonic-gate gss_OID_set * /* name_types */ 3977c478bd9Sstevel@tonic-gate /* */); 3987c478bd9Sstevel@tonic-gate OM_uint32 (*gss_inquire_context) 3997c478bd9Sstevel@tonic-gate ( 4007c478bd9Sstevel@tonic-gate void *, /* context */ 4017c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 4027c478bd9Sstevel@tonic-gate const gss_ctx_id_t, /* context_handle */ 4037c478bd9Sstevel@tonic-gate gss_name_t *, /* src_name */ 4047c478bd9Sstevel@tonic-gate gss_name_t *, /* targ_name */ 4057c478bd9Sstevel@tonic-gate OM_uint32 *, /* lifetime_rec */ 4067c478bd9Sstevel@tonic-gate gss_OID *, /* mech_type */ 4077c478bd9Sstevel@tonic-gate OM_uint32 *, /* ctx_flags */ 4087c478bd9Sstevel@tonic-gate int *, /* locally_initiated */ 4097c478bd9Sstevel@tonic-gate int * /* open */ 4107c478bd9Sstevel@tonic-gate /* */); 4117c478bd9Sstevel@tonic-gate OM_uint32 (*gss_internal_release_oid) 4127c478bd9Sstevel@tonic-gate ( 4137c478bd9Sstevel@tonic-gate void *, /* context */ 4147c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 4157c478bd9Sstevel@tonic-gate gss_OID * /* OID */ 4167c478bd9Sstevel@tonic-gate /* */); 4177c478bd9Sstevel@tonic-gate OM_uint32 (*gss_wrap_size_limit) 4187c478bd9Sstevel@tonic-gate ( 4197c478bd9Sstevel@tonic-gate void *, /* context */ 4207c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 4217c478bd9Sstevel@tonic-gate const gss_ctx_id_t, /* context_handle */ 4227c478bd9Sstevel@tonic-gate int, /* conf_req_flag */ 4237c478bd9Sstevel@tonic-gate gss_qop_t, /* qop_req */ 4247c478bd9Sstevel@tonic-gate OM_uint32, /* req_output_size */ 4257c478bd9Sstevel@tonic-gate OM_uint32 * /* max_input_size */ 4267c478bd9Sstevel@tonic-gate /* */); 4277c478bd9Sstevel@tonic-gate OM_uint32 (*pname_to_uid) 4287c478bd9Sstevel@tonic-gate ( 4297c478bd9Sstevel@tonic-gate void *, /* context */ 4307c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 4317c478bd9Sstevel@tonic-gate const gss_name_t, /* pname */ 4327c478bd9Sstevel@tonic-gate uid_t * /* uid */ 4337c478bd9Sstevel@tonic-gate /* */); 4347c478bd9Sstevel@tonic-gate OM_uint32 (*__gss_userok) 4357c478bd9Sstevel@tonic-gate ( 4367c478bd9Sstevel@tonic-gate void *, /* context */ 4377c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 4387c478bd9Sstevel@tonic-gate const gss_name_t, /* pname */ 4397c478bd9Sstevel@tonic-gate const char *, /* local user */ 4407c478bd9Sstevel@tonic-gate int * /* user ok? */ 4417c478bd9Sstevel@tonic-gate /* */); 4427c478bd9Sstevel@tonic-gate OM_uint32 (*gss_export_name) 4437c478bd9Sstevel@tonic-gate ( 4447c478bd9Sstevel@tonic-gate void *, /* context */ 4457c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 4467c478bd9Sstevel@tonic-gate const gss_name_t, /* input_name */ 4477c478bd9Sstevel@tonic-gate gss_buffer_t /* exported_name */ 4487c478bd9Sstevel@tonic-gate /* */); 4497c478bd9Sstevel@tonic-gate #endif /* ! _KERNEL */ 4507c478bd9Sstevel@tonic-gate /* EXPORT DELETE START */ 4517c478bd9Sstevel@tonic-gate /* CRYPT DELETE START */ 4527c478bd9Sstevel@tonic-gate /* 4537c478bd9Sstevel@tonic-gate * This block comment is Sun Proprietary: Need-To-Know. 4547c478bd9Sstevel@tonic-gate * What we are doing is leaving the seal and unseal entry points 4557c478bd9Sstevel@tonic-gate * in an obvious place before sign and unsign for the Domestic customer 4567c478bd9Sstevel@tonic-gate * of the Solaris Source Product. The Domestic customer of the Solaris Source 4577c478bd9Sstevel@tonic-gate * Product will have to deal with the problem of creating exportable libgss 4587c478bd9Sstevel@tonic-gate * binaries. 4597c478bd9Sstevel@tonic-gate * In the binary product that Sun builds, these entry points are elsewhere, 4607c478bd9Sstevel@tonic-gate * and bracketed with special comments so that the CRYPT_SRC and EXPORT_SRC 4617c478bd9Sstevel@tonic-gate * targets delete them. 4627c478bd9Sstevel@tonic-gate */ 4637c478bd9Sstevel@tonic-gate #if 0 4647c478bd9Sstevel@tonic-gate /* CRYPT DELETE END */ 4657c478bd9Sstevel@tonic-gate OM_uint32 (*gss_seal) 4667c478bd9Sstevel@tonic-gate ( 4677c478bd9Sstevel@tonic-gate void *, /* context */ 4687c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 4697c478bd9Sstevel@tonic-gate const gss_ctx_id_t, /* context_handle */ 4707c478bd9Sstevel@tonic-gate int, /* conf_req_flag */ 4717c478bd9Sstevel@tonic-gate int, /* qop_req */ 4727c478bd9Sstevel@tonic-gate const gss_buffer_t, /* input_message_buffer */ 4737c478bd9Sstevel@tonic-gate int *, /* conf_state */ 4747c478bd9Sstevel@tonic-gate gss_buffer_t /* output_message_buffer */ 4757c478bd9Sstevel@tonic-gate #ifdef _KERNEL 4767c478bd9Sstevel@tonic-gate /* */, OM_uint32 4777c478bd9Sstevel@tonic-gate #endif 4787c478bd9Sstevel@tonic-gate /* */); 4797c478bd9Sstevel@tonic-gate OM_uint32 (*gss_unseal) 4807c478bd9Sstevel@tonic-gate ( 4817c478bd9Sstevel@tonic-gate void *, /* context */ 4827c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 4837c478bd9Sstevel@tonic-gate const gss_ctx_id_t, /* context_handle */ 4847c478bd9Sstevel@tonic-gate const gss_buffer_t, /* input_message_buffer */ 4857c478bd9Sstevel@tonic-gate gss_buffer_t, /* output_message_buffer */ 4867c478bd9Sstevel@tonic-gate int *, /* conf_state */ 4877c478bd9Sstevel@tonic-gate int * /* qop_state */ 4887c478bd9Sstevel@tonic-gate #ifdef _KERNEL 4897c478bd9Sstevel@tonic-gate /* */, OM_uint32 4907c478bd9Sstevel@tonic-gate #endif 4917c478bd9Sstevel@tonic-gate /* */); 4927c478bd9Sstevel@tonic-gate /* CRYPT DELETE START */ 4937c478bd9Sstevel@tonic-gate #endif /* 0 */ 4947c478bd9Sstevel@tonic-gate /* CRYPT DELETE END */ 4957c478bd9Sstevel@tonic-gate /* EXPORT DELETE END */ 4967c478bd9Sstevel@tonic-gate OM_uint32 (*gss_sign) 4977c478bd9Sstevel@tonic-gate ( 4987c478bd9Sstevel@tonic-gate void *, /* context */ 4997c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 5007c478bd9Sstevel@tonic-gate const gss_ctx_id_t, /* context_handle */ 5017c478bd9Sstevel@tonic-gate int, /* qop_req */ 5027c478bd9Sstevel@tonic-gate const gss_buffer_t, /* message_buffer */ 5037c478bd9Sstevel@tonic-gate gss_buffer_t /* message_token */ 5047c478bd9Sstevel@tonic-gate #ifdef _KERNEL 5057c478bd9Sstevel@tonic-gate /* */, OM_uint32 5067c478bd9Sstevel@tonic-gate #endif 5077c478bd9Sstevel@tonic-gate /* */); 5087c478bd9Sstevel@tonic-gate OM_uint32 (*gss_verify) 5097c478bd9Sstevel@tonic-gate ( 5107c478bd9Sstevel@tonic-gate void *, /* context */ 5117c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 5127c478bd9Sstevel@tonic-gate const gss_ctx_id_t, /* context_handle */ 5137c478bd9Sstevel@tonic-gate const gss_buffer_t, /* message_buffer */ 5147c478bd9Sstevel@tonic-gate const gss_buffer_t, /* token_buffer */ 5157c478bd9Sstevel@tonic-gate int * /* qop_state */ 5167c478bd9Sstevel@tonic-gate #ifdef _KERNEL 5177c478bd9Sstevel@tonic-gate /* */, OM_uint32 5187c478bd9Sstevel@tonic-gate #endif 5197c478bd9Sstevel@tonic-gate /* */); 5207c478bd9Sstevel@tonic-gate #ifndef _KERNEL 5217c478bd9Sstevel@tonic-gate OM_uint32 (*gss_store_cred) 5227c478bd9Sstevel@tonic-gate ( 5237c478bd9Sstevel@tonic-gate void *, /* context */ 5247c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 5257c478bd9Sstevel@tonic-gate const gss_cred_id_t, /* input_cred */ 5267c478bd9Sstevel@tonic-gate gss_cred_usage_t, /* cred_usage */ 5277c478bd9Sstevel@tonic-gate const gss_OID, /* desired_mech */ 5287c478bd9Sstevel@tonic-gate OM_uint32, /* overwrite_cred */ 5297c478bd9Sstevel@tonic-gate OM_uint32, /* default_cred */ 5307c478bd9Sstevel@tonic-gate gss_OID_set *, /* elements_stored */ 5317c478bd9Sstevel@tonic-gate gss_cred_usage_t * /* cred_usage_stored */ 5327c478bd9Sstevel@tonic-gate /* */); 533ba7b222eSGlenn Barry 534ba7b222eSGlenn Barry /* GGF extensions */ 535ba7b222eSGlenn Barry 536ba7b222eSGlenn Barry OM_uint32 (*gss_inquire_sec_context_by_oid) 537ba7b222eSGlenn Barry ( 538ba7b222eSGlenn Barry OM_uint32 *, /* minor_status */ 539ba7b222eSGlenn Barry const gss_ctx_id_t, /* context_handle */ 540ba7b222eSGlenn Barry const gss_OID, /* OID */ 541ba7b222eSGlenn Barry gss_buffer_set_t * /* data_set */ 542ba7b222eSGlenn Barry /* */); 543ba7b222eSGlenn Barry 5447c478bd9Sstevel@tonic-gate #endif 5457c478bd9Sstevel@tonic-gate } *gss_mechanism; 5467c478bd9Sstevel@tonic-gate 547ab9b2e15Sgtb 548ab9b2e15Sgtb 5497c478bd9Sstevel@tonic-gate #ifndef _KERNEL 5507c478bd9Sstevel@tonic-gate /* This structure MUST NOT be used by any code outside libgss */ 5517c478bd9Sstevel@tonic-gate typedef struct gss_config_ext { 5527c478bd9Sstevel@tonic-gate gss_acquire_cred_with_password_sfct gss_acquire_cred_with_password; 5537c478bd9Sstevel@tonic-gate } *gss_mechanism_ext; 5547c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 5557c478bd9Sstevel@tonic-gate 556ab9b2e15Sgtb 5577c478bd9Sstevel@tonic-gate /* 5587c478bd9Sstevel@tonic-gate * In the user space we use a wrapper structure to encompass the 5597c478bd9Sstevel@tonic-gate * mechanism entry points. The wrapper contain the mechanism 5607c478bd9Sstevel@tonic-gate * entry points and other data which is only relevant to the gss-api 5617c478bd9Sstevel@tonic-gate * layer. In the kernel we use only the gss_config strucutre because 5627c478bd9Sstevel@tonic-gate * the kernal does not cantain any of the extra gss-api specific data. 5637c478bd9Sstevel@tonic-gate */ 5647c478bd9Sstevel@tonic-gate typedef struct gss_mech_config { 5657c478bd9Sstevel@tonic-gate char *kmodName; /* kernel module name */ 5667c478bd9Sstevel@tonic-gate char *uLibName; /* user library name */ 5677c478bd9Sstevel@tonic-gate char *mechNameStr; /* mechanism string name */ 5687c478bd9Sstevel@tonic-gate char *optionStr; /* optional mech parameters */ 5697c478bd9Sstevel@tonic-gate void *dl_handle; /* RTLD object handle for the mech */ 5707c478bd9Sstevel@tonic-gate gss_OID mech_type; /* mechanism oid */ 5717c478bd9Sstevel@tonic-gate gss_mechanism mech; /* mechanism initialization struct */ 572ab9b2e15Sgtb #ifndef _KERNEL 573ab9b2e15Sgtb gss_mechanism_ext mech_ext; /* Solaris extensions */ 574ab9b2e15Sgtb #endif /* _KERNEL */ 5757c478bd9Sstevel@tonic-gate struct gss_mech_config *next; /* next element in the list */ 5767c478bd9Sstevel@tonic-gate } *gss_mech_info; 5777c478bd9Sstevel@tonic-gate 578ab9b2e15Sgtb /********************************************************/ 579ab9b2e15Sgtb /* Internal mechglue routines */ 5807c478bd9Sstevel@tonic-gate 581ab9b2e15Sgtb /* SUNW15resync - Solaris versions - replace w/mit ones? */ 5827c478bd9Sstevel@tonic-gate gss_mechanism __gss_get_mechanism(const gss_OID); 583ab9b2e15Sgtb #ifndef _KERNEL 5847c478bd9Sstevel@tonic-gate gss_mechanism_ext __gss_get_mechanism_ext(const gss_OID); 585ab9b2e15Sgtb #endif /* _KERNEL */ 5867c478bd9Sstevel@tonic-gate char *__gss_get_kmodName(const gss_OID); 5877c478bd9Sstevel@tonic-gate char *__gss_get_modOptions(const gss_OID); 5887c478bd9Sstevel@tonic-gate OM_uint32 __gss_import_internal_name(OM_uint32 *, const gss_OID, 5897c478bd9Sstevel@tonic-gate gss_union_name_t, gss_name_t *); 5907c478bd9Sstevel@tonic-gate OM_uint32 __gss_export_internal_name(OM_uint32 *, const gss_OID, 5917c478bd9Sstevel@tonic-gate const gss_name_t, gss_buffer_t); 5927c478bd9Sstevel@tonic-gate OM_uint32 __gss_display_internal_name(OM_uint32 *, const gss_OID, 5937c478bd9Sstevel@tonic-gate const gss_name_t, gss_buffer_t, gss_OID *); 5947c478bd9Sstevel@tonic-gate OM_uint32 __gss_release_internal_name(OM_uint32 *, const gss_OID, 5957c478bd9Sstevel@tonic-gate gss_name_t *); 5965e01956fSGlenn Barry OM_uint32 gssint_delete_internal_sec_context (OM_uint32 *, gss_OID, 5975e01956fSGlenn Barry gss_ctx_id_t *, gss_buffer_t); 5987c478bd9Sstevel@tonic-gate OM_uint32 __gss_convert_name_to_union_name( 5997c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 6007c478bd9Sstevel@tonic-gate gss_mechanism, /* mech */ 6017c478bd9Sstevel@tonic-gate gss_name_t, /* internal_name */ 6027c478bd9Sstevel@tonic-gate gss_name_t * /* external_name */ 6037c478bd9Sstevel@tonic-gate ); 6047c478bd9Sstevel@tonic-gate 6057c478bd9Sstevel@tonic-gate gss_cred_id_t __gss_get_mechanism_cred( 6067c478bd9Sstevel@tonic-gate const gss_union_cred_t, /* union_cred */ 6077c478bd9Sstevel@tonic-gate const gss_OID /* mech_type */ 6087c478bd9Sstevel@tonic-gate ); 6097c478bd9Sstevel@tonic-gate 610ab9b2e15Sgtb 611ab9b2e15Sgtb 612ab9b2e15Sgtb 613ab9b2e15Sgtb 614ab9b2e15Sgtb int gssint_mechglue_init(void); 615ab9b2e15Sgtb void gssint_mechglue_fini(void); 616ab9b2e15Sgtb 617ab9b2e15Sgtb gss_mechanism gssint_get_mechanism (gss_OID); 618ab9b2e15Sgtb OM_uint32 gssint_get_mech_type (gss_OID, gss_buffer_t); 619ab9b2e15Sgtb char *gssint_get_kmodName(const gss_OID); 620ab9b2e15Sgtb char *gssint_get_modOptions(const gss_OID); 621ab9b2e15Sgtb OM_uint32 gssint_import_internal_name (OM_uint32 *, gss_OID, gss_union_name_t, 622ab9b2e15Sgtb gss_name_t *); 623ab9b2e15Sgtb OM_uint32 gssint_export_internal_name(OM_uint32 *, const gss_OID, 624ab9b2e15Sgtb const gss_name_t, gss_buffer_t); 625ab9b2e15Sgtb OM_uint32 gssint_display_internal_name (OM_uint32 *, gss_OID, gss_name_t, 626ab9b2e15Sgtb gss_buffer_t, gss_OID *); 627ab9b2e15Sgtb OM_uint32 gssint_release_internal_name (OM_uint32 *, gss_OID, gss_name_t *); 628ab9b2e15Sgtb 629ab9b2e15Sgtb OM_uint32 gssint_convert_name_to_union_name 630ab9b2e15Sgtb (OM_uint32 *, /* minor_status */ 631ab9b2e15Sgtb gss_mechanism, /* mech */ 632ab9b2e15Sgtb gss_name_t, /* internal_name */ 633ab9b2e15Sgtb gss_name_t * /* external_name */ 634ab9b2e15Sgtb ); 635ab9b2e15Sgtb gss_cred_id_t gssint_get_mechanism_cred 636ab9b2e15Sgtb (gss_union_cred_t, /* union_cred */ 637ab9b2e15Sgtb gss_OID /* mech_type */ 638ab9b2e15Sgtb ); 639ab9b2e15Sgtb 640ab9b2e15Sgtb OM_uint32 gssint_create_copy_buffer( 6417c478bd9Sstevel@tonic-gate const gss_buffer_t, /* src buffer */ 6427c478bd9Sstevel@tonic-gate gss_buffer_t *, /* destination buffer */ 6437c478bd9Sstevel@tonic-gate int /* NULL terminate buffer ? */ 6447c478bd9Sstevel@tonic-gate ); 6457c478bd9Sstevel@tonic-gate 646ab9b2e15Sgtb 647ab9b2e15Sgtb OM_uint32 gssint_copy_oid_set( 6487c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 649ab9b2e15Sgtb const gss_OID_set_desc *, /* oid set */ 650ab9b2e15Sgtb gss_OID_set * /* new oid set */ 6517c478bd9Sstevel@tonic-gate ); 6527c478bd9Sstevel@tonic-gate 653ab9b2e15Sgtb /* SUNW15resync - for old Solaris version in libgss */ 6547c478bd9Sstevel@tonic-gate OM_uint32 gss_copy_oid_set( 6557c478bd9Sstevel@tonic-gate OM_uint32 *, /* minor_status */ 6567c478bd9Sstevel@tonic-gate const gss_OID_set_desc *, /* oid set */ 6577c478bd9Sstevel@tonic-gate gss_OID_set * /* new oid set */ 6587c478bd9Sstevel@tonic-gate ); 6597c478bd9Sstevel@tonic-gate 660ab9b2e15Sgtb 661ab9b2e15Sgtb gss_OID gss_find_mechanism_from_name_type (gss_OID); /* name_type */ 662ab9b2e15Sgtb 663ab9b2e15Sgtb OM_uint32 gss_add_mech_name_type 664ab9b2e15Sgtb (OM_uint32 *, /* minor_status */ 665ab9b2e15Sgtb gss_OID, /* name_type */ 666ab9b2e15Sgtb gss_OID /* mech */ 667ab9b2e15Sgtb ); 668ab9b2e15Sgtb 669ab9b2e15Sgtb /* 670ab9b2e15Sgtb * Sun extensions to GSS-API v2 671ab9b2e15Sgtb */ 672ab9b2e15Sgtb 673ab9b2e15Sgtb OM_uint32 674ab9b2e15Sgtb gssint_mech_to_oid( 675ab9b2e15Sgtb const char *mech, /* mechanism string name */ 676ab9b2e15Sgtb gss_OID *oid /* mechanism oid */ 677ab9b2e15Sgtb ); 678ab9b2e15Sgtb 679ab9b2e15Sgtb const char * 680ab9b2e15Sgtb gssint_oid_to_mech( 681ab9b2e15Sgtb const gss_OID oid /* mechanism oid */ 682ab9b2e15Sgtb ); 683ab9b2e15Sgtb 684ab9b2e15Sgtb OM_uint32 685ab9b2e15Sgtb gssint_get_mechanisms( 686ab9b2e15Sgtb char *mechArray[], /* array to populate with mechs */ 687ab9b2e15Sgtb int arrayLen /* length of passed in array */ 688ab9b2e15Sgtb ); 689ab9b2e15Sgtb 690ab9b2e15Sgtb OM_uint32 691ab9b2e15Sgtb gss_store_cred( 692ab9b2e15Sgtb OM_uint32 *, /* minor_status */ 693ab9b2e15Sgtb const gss_cred_id_t, /* input_cred_handle */ 694ab9b2e15Sgtb gss_cred_usage_t, /* cred_usage */ 695ab9b2e15Sgtb const gss_OID, /* desired_mech */ 696ab9b2e15Sgtb OM_uint32, /* overwrite_cred */ 697ab9b2e15Sgtb OM_uint32, /* default_cred */ 698ab9b2e15Sgtb gss_OID_set *, /* elements_stored */ 699ab9b2e15Sgtb gss_cred_usage_t * /* cred_usage_stored */ 700ab9b2e15Sgtb ); 701ab9b2e15Sgtb 702ab9b2e15Sgtb int 703ab9b2e15Sgtb gssint_get_der_length( 704ab9b2e15Sgtb unsigned char **, /* buf */ 705ab9b2e15Sgtb unsigned int, /* buf_len */ 706ab9b2e15Sgtb unsigned int * /* bytes */ 707ab9b2e15Sgtb ); 708ab9b2e15Sgtb 709ab9b2e15Sgtb unsigned int 710ab9b2e15Sgtb gssint_der_length_size(unsigned int /* len */); 711ab9b2e15Sgtb 712ab9b2e15Sgtb int 713ab9b2e15Sgtb gssint_put_der_length( 714ab9b2e15Sgtb unsigned int, /* length */ 715ab9b2e15Sgtb unsigned char **, /* buf */ 716ab9b2e15Sgtb unsigned int /* max_len */ 717ab9b2e15Sgtb ); 718ab9b2e15Sgtb 719ab9b2e15Sgtb 720ab9b2e15Sgtb 721ab9b2e15Sgtb /* Solaris kernel and gssd support */ 722ab9b2e15Sgtb 723ab9b2e15Sgtb /* 724ab9b2e15Sgtb * derived types for passing context and credential handles 725ab9b2e15Sgtb * between gssd and kernel 726ab9b2e15Sgtb */ 727ab9b2e15Sgtb typedef unsigned int gssd_ctx_id_t; 728ab9b2e15Sgtb typedef unsigned int gssd_cred_id_t; 7297c478bd9Sstevel@tonic-gate 730*d4f95bf4SRichard Lowe #define GSSD_NO_CONTEXT ((gssd_ctx_id_t)0) 731*d4f95bf4SRichard Lowe #define GSSD_NO_CREDENTIAL ((gssd_cred_id_t)0) 732*d4f95bf4SRichard Lowe 7337c478bd9Sstevel@tonic-gate #ifdef _KERNEL 7347c478bd9Sstevel@tonic-gate 7357c478bd9Sstevel@tonic-gate #ifndef _KRB5_H 7367c478bd9Sstevel@tonic-gate /* These macros are defined for Kerberos in krb5.h, and have priority */ 7377c478bd9Sstevel@tonic-gate #define MALLOC(n) kmem_alloc((n), KM_SLEEP) 7387c478bd9Sstevel@tonic-gate #define FREE(x, n) kmem_free((x), (n)) 7397c478bd9Sstevel@tonic-gate #endif /* _KRB5_H */ 7407c478bd9Sstevel@tonic-gate 7417c478bd9Sstevel@tonic-gate gss_mechanism __kgss_get_mechanism(gss_OID); 7427c478bd9Sstevel@tonic-gate void __kgss_add_mechanism(gss_mechanism); 7437c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 7447c478bd9Sstevel@tonic-gate 7457c478bd9Sstevel@tonic-gate struct kgss_cred { 7467c478bd9Sstevel@tonic-gate gssd_cred_id_t gssd_cred; 7477c478bd9Sstevel@tonic-gate OM_uint32 gssd_cred_verifier; 7487c478bd9Sstevel@tonic-gate }; 7497c478bd9Sstevel@tonic-gate 7507c478bd9Sstevel@tonic-gate #define KCRED_TO_KGSS_CRED(cred) ((struct kgss_cred *)(cred)) 7517c478bd9Sstevel@tonic-gate #define KCRED_TO_CRED(cred) (KCRED_TO_KGSS_CRED(cred)->gssd_cred) 7527c478bd9Sstevel@tonic-gate #define KCRED_TO_CREDV(cred) (KCRED_TO_KGSS_CRED(cred)->gssd_cred_verifier) 7537c478bd9Sstevel@tonic-gate 7547c478bd9Sstevel@tonic-gate struct kgss_ctx { 7557c478bd9Sstevel@tonic-gate gssd_ctx_id_t gssd_ctx; 7567c478bd9Sstevel@tonic-gate #ifdef _KERNEL 7577c478bd9Sstevel@tonic-gate gss_ctx_id_t gssd_i_ctx; 7587c478bd9Sstevel@tonic-gate bool_t ctx_imported; 7597c478bd9Sstevel@tonic-gate gss_mechanism mech; 7607c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 7617c478bd9Sstevel@tonic-gate OM_uint32 gssd_ctx_verifier; 7627c478bd9Sstevel@tonic-gate }; 7637c478bd9Sstevel@tonic-gate 7647c478bd9Sstevel@tonic-gate #define KCTX_TO_KGSS_CTX(ctx) ((struct kgss_ctx *)(ctx)) 7657c478bd9Sstevel@tonic-gate #define KCTX_TO_CTX_IMPORTED(ctx) (KCTX_TO_KGSS_CTX(ctx)->ctx_imported) 7667c478bd9Sstevel@tonic-gate #define KCTX_TO_GSSD_CTX(ctx) (KCTX_TO_KGSS_CTX(ctx)->gssd_ctx) 7677c478bd9Sstevel@tonic-gate #define KCTX_TO_CTXV(ctx) (KCTX_TO_KGSS_CTX(ctx)->gssd_ctx_verifier) 7687c478bd9Sstevel@tonic-gate #define KCTX_TO_MECH(ctx) (KCTX_TO_KGSS_CTX(ctx)->mech) 7697c478bd9Sstevel@tonic-gate #define KCTX_TO_PRIVATE(ctx) (KCTX_TO_MECH(ctx)->context) 7707c478bd9Sstevel@tonic-gate #define KGSS_CTX_TO_GSSD_CTX(ctx) \ 7717c478bd9Sstevel@tonic-gate (((ctx) == GSS_C_NO_CONTEXT) ? (gssd_ctx_id_t)(uintptr_t)(ctx) : \ 7727c478bd9Sstevel@tonic-gate KCTX_TO_GSSD_CTX(ctx)) 7737c478bd9Sstevel@tonic-gate #define KGSS_CTX_TO_GSSD_CTXV(ctx) \ 7747c478bd9Sstevel@tonic-gate (((ctx) == GSS_C_NO_CONTEXT) ? (NULL) : KCTX_TO_CTXV(ctx)) 7757c478bd9Sstevel@tonic-gate 7767c478bd9Sstevel@tonic-gate #ifdef _KERNEL 7777c478bd9Sstevel@tonic-gate #define KCTX_TO_I_CTX(ctx) (KCTX_TO_KGSS_CTX(ctx)->gssd_i_ctx) 7787c478bd9Sstevel@tonic-gate #define KCTX_TO_CTX(ctx) \ 7797c478bd9Sstevel@tonic-gate ((KCTX_TO_CTX_IMPORTED(ctx) == FALSE) ? (ctx) : \ 7807c478bd9Sstevel@tonic-gate KCTX_TO_I_CTX(ctx)) 7817c478bd9Sstevel@tonic-gate #define KGSS_CRED_ALLOC() kmem_zalloc(sizeof (struct kgss_cred), \ 7827c478bd9Sstevel@tonic-gate KM_SLEEP) 7837c478bd9Sstevel@tonic-gate #define KGSS_CRED_FREE(cred) kmem_free(cred, sizeof (struct kgss_cred)) 7847c478bd9Sstevel@tonic-gate 7857c478bd9Sstevel@tonic-gate #define KGSS_ALLOC() kmem_zalloc(sizeof (struct kgss_ctx), KM_SLEEP) 7867c478bd9Sstevel@tonic-gate #define KGSS_FREE(ctx) kmem_free(ctx, sizeof (struct kgss_ctx)) 7877c478bd9Sstevel@tonic-gate 7887c478bd9Sstevel@tonic-gate #define KGSS_SIGN(minor_st, ctx, qop, msg, tkn) \ 7897c478bd9Sstevel@tonic-gate (*(KCTX_TO_MECH(ctx)->gss_sign))(KCTX_TO_PRIVATE(ctx), minor_st, \ 7907c478bd9Sstevel@tonic-gate KCTX_TO_CTX(ctx), qop, msg, tkn, KCTX_TO_CTXV(ctx)) 7917c478bd9Sstevel@tonic-gate 7927c478bd9Sstevel@tonic-gate #define KGSS_VERIFY(minor_st, ctx, msg, tkn, qop) \ 7937c478bd9Sstevel@tonic-gate (*(KCTX_TO_MECH(ctx)->gss_verify))(KCTX_TO_PRIVATE(ctx), minor_st,\ 7947c478bd9Sstevel@tonic-gate KCTX_TO_CTX(ctx), msg, tkn, qop, KCTX_TO_CTXV(ctx)) 7957c478bd9Sstevel@tonic-gate 7967c478bd9Sstevel@tonic-gate #define KGSS_DELETE_SEC_CONTEXT(minor_st, ctx, int_ctx_id, tkn) \ 7977c478bd9Sstevel@tonic-gate (*(KCTX_TO_MECH(ctx)->gss_delete_sec_context))(KCTX_TO_PRIVATE(ctx),\ 7987c478bd9Sstevel@tonic-gate minor_st, int_ctx_id, tkn, KCTX_TO_CTXV(ctx)) 7997c478bd9Sstevel@tonic-gate 8007c478bd9Sstevel@tonic-gate #define KGSS_IMPORT_SEC_CONTEXT(minor_st, tkn, ctx, int_ctx_id) \ 8017c478bd9Sstevel@tonic-gate (*(KCTX_TO_MECH(ctx)->gss_import_sec_context))(KCTX_TO_PRIVATE(ctx),\ 8027c478bd9Sstevel@tonic-gate minor_st, tkn, int_ctx_id) 8037c478bd9Sstevel@tonic-gate 8047c478bd9Sstevel@tonic-gate /* EXPORT DELETE START */ 8057c478bd9Sstevel@tonic-gate #define KGSS_SEAL(minor_st, ctx, conf_req, qop, msg, conf_state, tkn) \ 8067c478bd9Sstevel@tonic-gate (*(KCTX_TO_MECH(ctx)->gss_seal))(KCTX_TO_PRIVATE(ctx), minor_st, \ 8077c478bd9Sstevel@tonic-gate KCTX_TO_CTX(ctx), conf_req, qop, msg, conf_state, tkn,\ 8087c478bd9Sstevel@tonic-gate KCTX_TO_CTXV(ctx)) 8097c478bd9Sstevel@tonic-gate 8107c478bd9Sstevel@tonic-gate #define KGSS_UNSEAL(minor_st, ctx, msg, tkn, conf, qop) \ 8117c478bd9Sstevel@tonic-gate (*(KCTX_TO_MECH(ctx)->gss_unseal))(KCTX_TO_PRIVATE(ctx), minor_st,\ 8127c478bd9Sstevel@tonic-gate KCTX_TO_CTX(ctx), msg, tkn, conf, qop, \ 8137c478bd9Sstevel@tonic-gate KCTX_TO_CTXV(ctx)) 8147c478bd9Sstevel@tonic-gate 8157c478bd9Sstevel@tonic-gate /* EXPORT DELETE END */ 8167c478bd9Sstevel@tonic-gate 817ab9b2e15Sgtb #define KGSS_INIT_CONTEXT(ctx) krb5_init_context(ctx) 818ab9b2e15Sgtb #define KGSS_RELEASE_OID(minor_st, oid) krb5_gss_release_oid(minor_st, oid) 819ab9b2e15Sgtb extern OM_uint32 kgss_release_oid(OM_uint32 *, gss_OID *); 820ab9b2e15Sgtb 8217c478bd9Sstevel@tonic-gate #else /* !_KERNEL */ 822ab9b2e15Sgtb 823ab9b2e15Sgtb #define KGSS_INIT_CONTEXT(ctx) krb5_gss_init_context(ctx) 824ab9b2e15Sgtb #define KGSS_RELEASE_OID(minor_st, oid) gss_release_oid(minor_st, oid) 825ab9b2e15Sgtb 8267c478bd9Sstevel@tonic-gate #define KCTX_TO_CTX(ctx) (KCTX_TO_KGSS_CTX(ctx)->gssd_ctx) 8277c478bd9Sstevel@tonic-gate #define MALLOC(n) malloc(n) 8287c478bd9Sstevel@tonic-gate #define FREE(x, n) free(x) 8297c478bd9Sstevel@tonic-gate #define KGSS_CRED_ALLOC() (struct kgss_cred *) \ 8307c478bd9Sstevel@tonic-gate MALLOC(sizeof (struct kgss_cred)) 8317c478bd9Sstevel@tonic-gate #define KGSS_CRED_FREE(cred) free(cred) 8327c478bd9Sstevel@tonic-gate #define KGSS_ALLOC() (struct kgss_ctx *)MALLOC(sizeof (struct kgss_ctx)) 8337c478bd9Sstevel@tonic-gate #define KGSS_FREE(ctx) free(ctx) 8347c478bd9Sstevel@tonic-gate 8357c478bd9Sstevel@tonic-gate #define KGSS_SIGN(minor_st, ctx, qop, msg, tkn) \ 8367c478bd9Sstevel@tonic-gate kgss_sign_wrapped(minor_st, \ 8377c478bd9Sstevel@tonic-gate KCTX_TO_CTX(ctx), qop, msg, tkn, KCTX_TO_CTXV(ctx)) 8387c478bd9Sstevel@tonic-gate 8397c478bd9Sstevel@tonic-gate #define KGSS_VERIFY(minor_st, ctx, msg, tkn, qop) \ 8407c478bd9Sstevel@tonic-gate kgss_verify_wrapped(minor_st,\ 8417c478bd9Sstevel@tonic-gate KCTX_TO_CTX(ctx), msg, tkn, qop, KCTX_TO_CTXV(ctx)) 8427c478bd9Sstevel@tonic-gate 8437c478bd9Sstevel@tonic-gate #define KGSS_SEAL(minor_st, ctx, conf_req, qop, msg, conf_state, tkn) \ 8447c478bd9Sstevel@tonic-gate kgss_seal_wrapped(minor_st, \ 8457c478bd9Sstevel@tonic-gate KCTX_TO_CTX(ctx), conf_req, qop, msg, conf_state, tkn, \ 8467c478bd9Sstevel@tonic-gate KCTX_TO_CTXV(ctx)) 8477c478bd9Sstevel@tonic-gate 8487c478bd9Sstevel@tonic-gate #define KGSS_UNSEAL(minor_st, ctx, msg, tkn, conf, qop) \ 8497c478bd9Sstevel@tonic-gate kgss_unseal_wrapped(minor_st,\ 8507c478bd9Sstevel@tonic-gate KCTX_TO_CTX(ctx), msg, tkn, conf, qop, \ 8517c478bd9Sstevel@tonic-gate KCTX_TO_CTXV(ctx)) 8527c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 8537c478bd9Sstevel@tonic-gate 854ab9b2e15Sgtb /* SUNW15resync - moved from gssapiP_generic.h for sake of non-krb5 mechs */ 855ab9b2e15Sgtb OM_uint32 generic_gss_release_buffer 856ab9b2e15Sgtb (OM_uint32*, /* minor_status */ 857ab9b2e15Sgtb gss_buffer_t /* buffer */ 858ab9b2e15Sgtb ); 8597c478bd9Sstevel@tonic-gate 860ab9b2e15Sgtb OM_uint32 generic_gss_release_oid_set 861ab9b2e15Sgtb (OM_uint32*, /* minor_status */ 862ab9b2e15Sgtb gss_OID_set* /* set */ 863ab9b2e15Sgtb ); 864ab9b2e15Sgtb 865ab9b2e15Sgtb OM_uint32 generic_gss_release_oid 866ab9b2e15Sgtb (OM_uint32*, /* minor_status */ 867ab9b2e15Sgtb gss_OID* /* set */ 868ab9b2e15Sgtb ); 869ab9b2e15Sgtb 870ab9b2e15Sgtb OM_uint32 generic_gss_copy_oid 871ab9b2e15Sgtb (OM_uint32 *, /* minor_status */ 872ab9b2e15Sgtb gss_OID_desc * const, /* oid */ /* SUNW15resync */ 873ab9b2e15Sgtb gss_OID * /* new_oid */ 874ab9b2e15Sgtb ); 875ab9b2e15Sgtb 876ab9b2e15Sgtb OM_uint32 generic_gss_create_empty_oid_set 877ab9b2e15Sgtb (OM_uint32 *, /* minor_status */ 878ab9b2e15Sgtb gss_OID_set * /* oid_set */ 879ab9b2e15Sgtb ); 880ab9b2e15Sgtb 881ab9b2e15Sgtb OM_uint32 generic_gss_add_oid_set_member 882ab9b2e15Sgtb (OM_uint32 *, /* minor_status */ 883ab9b2e15Sgtb gss_OID_desc * const, /* member_oid */ 884ab9b2e15Sgtb gss_OID_set * /* oid_set */ 885ab9b2e15Sgtb ); 886ab9b2e15Sgtb 887ab9b2e15Sgtb OM_uint32 generic_gss_test_oid_set_member 888ab9b2e15Sgtb (OM_uint32 *, /* minor_status */ 889ab9b2e15Sgtb gss_OID_desc * const, /* member */ 890ab9b2e15Sgtb gss_OID_set, /* set */ 891ab9b2e15Sgtb int * /* present */ 892ab9b2e15Sgtb ); 893ab9b2e15Sgtb 894ab9b2e15Sgtb OM_uint32 generic_gss_oid_to_str 895ab9b2e15Sgtb (OM_uint32 *, /* minor_status */ 896ab9b2e15Sgtb gss_OID_desc * const, /* oid */ 897ab9b2e15Sgtb gss_buffer_t /* oid_str */ 898ab9b2e15Sgtb ); 899ab9b2e15Sgtb 900ab9b2e15Sgtb OM_uint32 generic_gss_str_to_oid 901ab9b2e15Sgtb (OM_uint32 *, /* minor_status */ 902ab9b2e15Sgtb gss_buffer_t, /* oid_str */ 903ab9b2e15Sgtb gss_OID * /* oid */ 904ab9b2e15Sgtb ); 905ab9b2e15Sgtb 906ba7b222eSGlenn Barry OM_uint32 907ba7b222eSGlenn Barry generic_gss_oid_compose( 908ba7b222eSGlenn Barry OM_uint32 *, /* minor_status */ 909ba7b222eSGlenn Barry const char *, /* prefix */ 910ba7b222eSGlenn Barry size_t, /* prefix_len */ 911ba7b222eSGlenn Barry int, /* suffix */ 912ba7b222eSGlenn Barry gss_OID_desc *); /* oid */ 913ba7b222eSGlenn Barry 914ba7b222eSGlenn Barry OM_uint32 915ba7b222eSGlenn Barry generic_gss_oid_decompose( 916ba7b222eSGlenn Barry OM_uint32 *, /* minor_status */ 917ba7b222eSGlenn Barry const char *, /*prefix */ 918ba7b222eSGlenn Barry size_t, /* prefix_len */ 919ba7b222eSGlenn Barry gss_OID_desc *, /* oid */ 920ba7b222eSGlenn Barry int *); /* suffix */ 921ba7b222eSGlenn Barry 922ba7b222eSGlenn Barry OM_uint32 generic_gss_create_empty_buffer_set 923ba7b222eSGlenn Barry (OM_uint32 * /*minor_status*/, 924ba7b222eSGlenn Barry gss_buffer_set_t * /*buffer_set*/); 925ba7b222eSGlenn Barry 926ba7b222eSGlenn Barry OM_uint32 generic_gss_add_buffer_set_member 927ba7b222eSGlenn Barry (OM_uint32 * /*minor_status*/, 928ba7b222eSGlenn Barry const gss_buffer_t /*member_buffer*/, 929ba7b222eSGlenn Barry gss_buffer_set_t * /*buffer_set*/); 930ba7b222eSGlenn Barry 931ba7b222eSGlenn Barry OM_uint32 generic_gss_release_buffer_set 932ba7b222eSGlenn Barry (OM_uint32 * /*minor_status*/, 933ba7b222eSGlenn Barry gss_buffer_set_t * /*buffer_set*/); 934ba7b222eSGlenn Barry 935ba7b222eSGlenn Barry /* 936ba7b222eSGlenn Barry * SUNW17PACresync 937ba7b222eSGlenn Barry * New map error API in MIT 1.7, at build time generates code for errors. 938ba7b222eSGlenn Barry * Solaris does not gen the errors at build time so we just stub these 939ba7b222eSGlenn Barry * for now, need to revisit. 940ba7b222eSGlenn Barry * See mglueP.h and util_errmap.c in MIT 1.7. 941ba7b222eSGlenn Barry */ 942ba7b222eSGlenn Barry #ifdef _KERNEL 943ba7b222eSGlenn Barry 944ba7b222eSGlenn Barry #define map_error(MINORP, MECH) 945ba7b222eSGlenn Barry #define map_errcode(MINORP) 946ba7b222eSGlenn Barry 947ba7b222eSGlenn Barry #else /* _KERNEL */ 948ba7b222eSGlenn Barry 9495e01956fSGlenn Barry /* Use this to map an error code that was returned from a mech 9505e01956fSGlenn Barry operation; the mech will be asked to produce the associated error 9515e01956fSGlenn Barry messages. 952ba7b222eSGlenn Barry 9535e01956fSGlenn Barry Remember that if the minor status code cannot be returned to the 9545e01956fSGlenn Barry caller (e.g., if it's stuffed in an automatic variable and then 9555e01956fSGlenn Barry ignored), then we don't care about producing a mapping. */ 956ba7b222eSGlenn Barry #define map_error(MINORP, MECH) \ 9575e01956fSGlenn Barry (*(MINORP) = gssint_mecherrmap_map(*(MINORP), &(MECH)->mech_type)) 9585e01956fSGlenn Barry #define map_error_oid(MINORP, MECHOID) \ 9595e01956fSGlenn Barry (*(MINORP) = gssint_mecherrmap_map(*(MINORP), (MECHOID))) 9605e01956fSGlenn Barry 9615e01956fSGlenn Barry /* Use this to map an errno value or com_err error code being 9625e01956fSGlenn Barry generated within the mechglue code (e.g., by calling generic oid 9635e01956fSGlenn Barry ops). Any errno or com_err values produced by mech operations 9645e01956fSGlenn Barry should be processed with map_error. This means they'll be stored 9655e01956fSGlenn Barry separately even if the mech uses com_err, because we can't assume 9665e01956fSGlenn Barry that it will use com_err. */ 967ba7b222eSGlenn Barry #define map_errcode(MINORP) \ 9685e01956fSGlenn Barry (*(MINORP) = gssint_mecherrmap_map_errcode(*(MINORP))) 9695e01956fSGlenn Barry 970ba7b222eSGlenn Barry #endif /* _KERNEL */ 971ab9b2e15Sgtb 972ab9b2e15Sgtb #endif /* _GSS_MECHGLUEP_H */ 973