Path: blob/main/crypto/heimdal/lib/gssapi/spnego/external.c
34907 views
/*1* Copyright (c) 2004, PADL Software Pty Ltd.2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7*8* 1. Redistributions of source code must retain the above copyright9* notice, this list of conditions and the following disclaimer.10*11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* 3. Neither the name of PADL Software nor the names of its contributors16* may be used to endorse or promote products derived from this software17* without specific prior written permission.18*19* THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND20* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE21* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE22* ARE DISCLAIMED. IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE23* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL24* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS25* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)26* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT27* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY28* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF29* SUCH DAMAGE.30*/3132#include "spnego_locl.h"33#include <gssapi_mech.h>3435/*36* RFC2478, SPNEGO:37* The security mechanism of the initial38* negotiation token is identified by the Object Identifier39* iso.org.dod.internet.security.mechanism.snego (1.3.6.1.5.5.2).40*/41#if 042static gss_mo_desc spnego_mo[] = {43{44GSS_C_MA_SASL_MECH_NAME,45GSS_MO_MA,46"SASL mech name",47rk_UNCONST("SPNEGO"),48_gss_mo_get_ctx_as_string,49NULL50},51{52GSS_C_MA_MECH_NAME,53GSS_MO_MA,54"Mechanism name",55rk_UNCONST("SPNEGO"),56_gss_mo_get_ctx_as_string,57NULL58},59{60GSS_C_MA_MECH_DESCRIPTION,61GSS_MO_MA,62"Mechanism description",63rk_UNCONST("Heimdal SPNEGO Mechanism"),64_gss_mo_get_ctx_as_string,65NULL66},67{68GSS_C_MA_MECH_NEGO,69GSS_MO_MA70},71{72GSS_C_MA_MECH_PSEUDO,73GSS_MO_MA74}75};76#endif7778static gssapi_mech_interface_desc spnego_mech = {79GMI_VERSION,80"spnego",81{6, rk_UNCONST("\x2b\x06\x01\x05\x05\x02") },820,83_gss_spnego_acquire_cred,84_gss_spnego_release_cred,85_gss_spnego_init_sec_context,86_gss_spnego_accept_sec_context,87_gss_spnego_process_context_token,88_gss_spnego_internal_delete_sec_context,89_gss_spnego_context_time,90_gss_spnego_get_mic,91_gss_spnego_verify_mic,92_gss_spnego_wrap,93_gss_spnego_unwrap,94NULL, /* gm_display_status */95NULL, /* gm_indicate_mechs */96_gss_spnego_compare_name,97_gss_spnego_display_name,98_gss_spnego_import_name,99_gss_spnego_export_name,100_gss_spnego_release_name,101_gss_spnego_inquire_cred,102_gss_spnego_inquire_context,103_gss_spnego_wrap_size_limit,104gss_add_cred,105_gss_spnego_inquire_cred_by_mech,106_gss_spnego_export_sec_context,107_gss_spnego_import_sec_context,108NULL /* _gss_spnego_inquire_names_for_mech */,109_gss_spnego_inquire_mechs_for_name,110_gss_spnego_canonicalize_name,111_gss_spnego_duplicate_name,112_gss_spnego_inquire_sec_context_by_oid,113_gss_spnego_inquire_cred_by_oid,114_gss_spnego_set_sec_context_option,115_gss_spnego_set_cred_option,116_gss_spnego_pseudo_random,117#if 0118_gss_spnego_wrap_iov,119_gss_spnego_unwrap_iov,120_gss_spnego_wrap_iov_length,121#else122NULL,123NULL,124NULL,125#endif126NULL,127#if 0128_gss_spnego_export_cred,129_gss_spnego_import_cred,130#else131NULL,132NULL,133#endif134NULL,135NULL,136NULL,137NULL,138NULL,139NULL,140NULL,141#if 0142spnego_mo,143sizeof(spnego_mo) / sizeof(spnego_mo[0]),144#else145NULL,1460,147#endif148NULL,149NULL,150NULL,151NULL,152NULL,153NULL,154};155156gssapi_mech_interface157__gss_spnego_initialize(void)158{159return &spnego_mech;160}161162163