Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.h
32301 views
/*1* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#ifndef NATIVE_FUNC_H26#define NATIVE_FUNC_H2728#include "gssapi.h"2930#ifndef TRUE31#define TRUE 132#endif3334#ifndef FALSE35#define FALSE 036#endif3738char* loadNative(const char *libName);3940/* function pointer definitions */41typedef OM_uint32 (*RELEASE_NAME_FN_PTR)42(OM_uint32 *minor_status,43gss_name_t *name);4445typedef OM_uint32 (*IMPORT_NAME_FN_PTR)46(OM_uint32 *minor_status,47gss_buffer_t input_name_buffer,48gss_OID input_name_type,49gss_name_t *output_name);5051typedef OM_uint32 (*COMPARE_NAME_FN_PTR)52(OM_uint32 *minor_status,53gss_name_t name1,54gss_name_t name2,55int *name_equal);5657typedef OM_uint32 (*CANONICALIZE_NAME_FN_PTR)58(OM_uint32 *minor_status,59gss_name_t input_name,60gss_OID mech_type,61gss_name_t *output_name);6263typedef OM_uint32 (*EXPORT_NAME_FN_PTR)64(OM_uint32 *minor_status,65gss_name_t input_name,66gss_buffer_t exported_name);6768typedef OM_uint32 (*DISPLAY_NAME_FN_PTR)69(OM_uint32 *minor_status,70gss_name_t input_name,71gss_buffer_t output_name_buffer,72gss_OID *output_name_type);7374typedef OM_uint32 (*ACQUIRE_CRED_FN_PTR)75(OM_uint32 *minor_status,76gss_name_t desired_name,77OM_uint32 time_req,78gss_OID_set desired_mech,79gss_cred_usage_t cred_usage,80gss_cred_id_t *output_cred_handle,81gss_OID_set *actual_mechs,82OM_uint32 *time_rec);8384typedef OM_uint32 (*RELEASE_CRED_FN_PTR)85(OM_uint32 *minor_status,86gss_cred_id_t *cred_handle);8788typedef OM_uint32 (*INQUIRE_CRED_FN_PTR)89(OM_uint32 *minor_status,90gss_cred_id_t cred_handle,91gss_name_t *name,92OM_uint32 *lifetime,93gss_cred_usage_t *cred_usage,94gss_OID_set *mechanisms);9596typedef OM_uint32 (*IMPORT_SEC_CONTEXT_FN_PTR)97(OM_uint32 *minor_status,98gss_buffer_t interprocess_token,99gss_ctx_id_t *context_handle);100101typedef OM_uint32 (*INIT_SEC_CONTEXT_FN_PTR)102(OM_uint32 *minor_status,103gss_cred_id_t initiator_cred_handle,104gss_ctx_id_t *context_handle,105gss_name_t *target_name,106gss_OID mech_type,107OM_uint32 req_flags,108OM_uint32 time_req,109gss_channel_bindings_t input_chan_bindings,110gss_buffer_t input_token,111gss_OID *actual_mech_type,112gss_buffer_t output_token,113OM_uint32 *ret_flags,114OM_uint32 *time_rec);115116typedef OM_uint32 (*ACCEPT_SEC_CONTEXT_FN_PTR)117(OM_uint32 *minor_status,118gss_ctx_id_t *context_handle,119gss_cred_id_t acceptor_cred_handle,120gss_buffer_t input_token,121gss_channel_bindings_t input_chan_bindings,122gss_name_t *src_name,123gss_OID *mech_type,124gss_buffer_t output_token,125OM_uint32 *ret_flags,126OM_uint32 *time_rec,127gss_cred_id_t *delegated_cred_handle);128129typedef OM_uint32 (*INQUIRE_CONTEXT_FN_PTR)130(OM_uint32 *minor_status,131gss_ctx_id_t context_handle,132gss_name_t *src_name,133gss_name_t *targ_name,134OM_uint32 *lifetime_rec,135gss_OID *mech_type,136OM_uint32 *ctx_flags,137int *locally_initiated,138int *open);139140typedef OM_uint32 (*DELETE_SEC_CONTEXT_FN_PTR)141(OM_uint32 *minor_status,142gss_ctx_id_t *context_handle,143gss_buffer_t output_token);144145typedef OM_uint32 (*CONTEXT_TIME_FN_PTR)146(OM_uint32 *minor_status,147gss_ctx_id_t *context_handle,148OM_uint32 *time_rec);149150typedef OM_uint32 (*WRAP_SIZE_LIMIT_FN_PTR)151(OM_uint32 *minor_status,152gss_ctx_id_t context_handle,153int conf_req_flag,154gss_qop_t qop_req,155OM_uint32 req_output_size,156OM_uint32 *max_input_size);157158typedef OM_uint32 (*EXPORT_SEC_CONTEXT_FN_PTR)159(OM_uint32 *minor_status,160gss_ctx_id_t *context_handle,161gss_buffer_t interprocess_token);162163typedef OM_uint32 (*GET_MIC_FN_PTR)164(OM_uint32 *minor_status,165gss_ctx_id_t context_handle,166gss_qop_t qop_req,167gss_buffer_t message_buffer,168gss_buffer_t msg_token);169170typedef OM_uint32 (*VERIFY_MIC_FN_PTR)171(OM_uint32 *minor_status,172gss_ctx_id_t context_handle,173gss_buffer_t message_buffer,174gss_buffer_t token_buffer,175gss_qop_t *qop_state);176177typedef OM_uint32 (*WRAP_FN_PTR)178(OM_uint32 *minor_status,179gss_ctx_id_t context_handle,180int conf_req_flag,181gss_qop_t qop_req,182gss_buffer_t input_message_buffer,183int *conf_state,184gss_buffer_t output_message_buffer);185186typedef OM_uint32 (*UNWRAP_FN_PTR)187(OM_uint32 *minor_status,188gss_ctx_id_t context_handle,189gss_buffer_t input_message_buffer,190gss_buffer_t output_message_buffer,191int *conf_state,192gss_qop_t *qop_state);193194typedef OM_uint32 (*INDICATE_MECHS_FN_PTR)195(OM_uint32 *minor_status,196gss_OID_set *mech_set);197198typedef OM_uint32 (*INQUIRE_NAMES_FOR_MECH_FN_PTR)199(OM_uint32 *minor_status,200const gss_OID mechanism,201gss_OID_set *name_types);202203typedef OM_uint32 (*ADD_OID_SET_MEMBER_FN_PTR)204(OM_uint32 *minor_status,205gss_OID member_oid,206gss_OID_set *oid_set);207208typedef OM_uint32 (*DISPLAY_STATUS_FN_PTR)209(OM_uint32 *minor_status,210OM_uint32 status_value,211int status_type,212gss_OID mech_type,213OM_uint32 *message_context,214gss_buffer_t status_string);215216typedef OM_uint32 (*CREATE_EMPTY_OID_SET_FN_PTR)217(OM_uint32 *minor_status,218gss_OID_set *oid_set);219220typedef OM_uint32 (*RELEASE_OID_SET_FN_PTR)221(OM_uint32 *minor_status,222gss_OID_set *set);223224typedef OM_uint32 (*RELEASE_BUFFER_FN_PTR)225(OM_uint32 *minor_status,226gss_buffer_t buffer);227228229/* dynamically resolved functions from gss library */230231typedef struct GSS_FUNCTION_TABLE {232gss_OID_set mechs;233RELEASE_NAME_FN_PTR releaseName;234IMPORT_NAME_FN_PTR importName;235COMPARE_NAME_FN_PTR compareName;236CANONICALIZE_NAME_FN_PTR canonicalizeName;237EXPORT_NAME_FN_PTR exportName;238DISPLAY_NAME_FN_PTR displayName;239ACQUIRE_CRED_FN_PTR acquireCred;240RELEASE_CRED_FN_PTR releaseCred;241INQUIRE_CRED_FN_PTR inquireCred;242IMPORT_SEC_CONTEXT_FN_PTR importSecContext;243INIT_SEC_CONTEXT_FN_PTR initSecContext;244ACCEPT_SEC_CONTEXT_FN_PTR acceptSecContext;245INQUIRE_CONTEXT_FN_PTR inquireContext;246DELETE_SEC_CONTEXT_FN_PTR deleteSecContext;247CONTEXT_TIME_FN_PTR contextTime;248WRAP_SIZE_LIMIT_FN_PTR wrapSizeLimit;249EXPORT_SEC_CONTEXT_FN_PTR exportSecContext;250GET_MIC_FN_PTR getMic;251VERIFY_MIC_FN_PTR verifyMic;252WRAP_FN_PTR wrap;253UNWRAP_FN_PTR unwrap;254INDICATE_MECHS_FN_PTR indicateMechs;255INQUIRE_NAMES_FOR_MECH_FN_PTR inquireNamesForMech;256ADD_OID_SET_MEMBER_FN_PTR addOidSetMember;257DISPLAY_STATUS_FN_PTR displayStatus;258CREATE_EMPTY_OID_SET_FN_PTR createEmptyOidSet;259RELEASE_OID_SET_FN_PTR releaseOidSet;260RELEASE_BUFFER_FN_PTR releaseBuffer;261262} GSS_FUNCTION_TABLE;263264typedef GSS_FUNCTION_TABLE *GSS_FUNCTION_TABLE_PTR;265266/* global GSS function table */267extern GSS_FUNCTION_TABLE_PTR ftab;268269#endif270271272