1/* $NetBSD: external.c,v 1.1.1.1 2011/04/13 18:14:48 elric Exp $ */ 2 3/* 4 * Copyright (c) 2004, PADL Software Pty Ltd. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. 17 * 18 * 3. Neither the name of PADL Software nor the names of its contributors 19 * may be used to endorse or promote products derived from this software 20 * without specific prior written permission. 21 * 22 * THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND 23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 * ARE DISCLAIMED. IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 */ 34 35#include "spnego_locl.h" 36#include <gssapi_mech.h> 37 38/* 39 * RFC2478, SPNEGO: 40 * The security mechanism of the initial 41 * negotiation token is identified by the Object Identifier 42 * iso.org.dod.internet.security.mechanism.snego (1.3.6.1.5.5.2). 43 */ 44 45static gss_mo_desc spnego_mo[] = { 46 { 47 GSS_C_MA_SASL_MECH_NAME, 48 GSS_MO_MA, 49 "SASL mech name", 50 "SPNEGO", 51 _gss_mo_get_ctx_as_string, 52 NULL 53 }, 54 { 55 GSS_C_MA_MECH_NAME, 56 GSS_MO_MA, 57 "Mechanism name", 58 "SPNEGO", 59 _gss_mo_get_ctx_as_string, 60 NULL 61 }, 62 { 63 GSS_C_MA_MECH_DESCRIPTION, 64 GSS_MO_MA, 65 "Mechanism description", 66 "Heimdal SPNEGO Mechanism", 67 _gss_mo_get_ctx_as_string, 68 NULL 69 }, 70 { 71 GSS_C_MA_MECH_NEGO, 72 GSS_MO_MA 73 }, 74 { 75 GSS_C_MA_MECH_PSEUDO, 76 GSS_MO_MA 77 } 78}; 79 80static gssapi_mech_interface_desc spnego_mech = { 81 GMI_VERSION, 82 "spnego", 83 {6, (void *)"\x2b\x06\x01\x05\x05\x02"}, 84 0, 85 _gss_spnego_acquire_cred, 86 _gss_spnego_release_cred, 87 _gss_spnego_init_sec_context, 88 _gss_spnego_accept_sec_context, 89 _gss_spnego_process_context_token, 90 _gss_spnego_internal_delete_sec_context, 91 _gss_spnego_context_time, 92 _gss_spnego_get_mic, 93 _gss_spnego_verify_mic, 94 _gss_spnego_wrap, 95 _gss_spnego_unwrap, 96 NULL, /* gm_display_status */ 97 NULL, /* gm_indicate_mechs */ 98 _gss_spnego_compare_name, 99 _gss_spnego_display_name, 100 _gss_spnego_import_name, 101 _gss_spnego_export_name, 102 _gss_spnego_release_name, 103 _gss_spnego_inquire_cred, 104 _gss_spnego_inquire_context, 105 _gss_spnego_wrap_size_limit, 106 gss_add_cred, 107 _gss_spnego_inquire_cred_by_mech, 108 _gss_spnego_export_sec_context, 109 _gss_spnego_import_sec_context, 110 NULL /* _gss_spnego_inquire_names_for_mech */, 111 _gss_spnego_inquire_mechs_for_name, 112 _gss_spnego_canonicalize_name, 113 _gss_spnego_duplicate_name, 114 _gss_spnego_inquire_sec_context_by_oid, 115 _gss_spnego_inquire_cred_by_oid, 116 _gss_spnego_set_sec_context_option, 117 _gss_spnego_set_cred_option, 118 _gss_spnego_pseudo_random, 119 _gss_spnego_wrap_iov, 120 _gss_spnego_unwrap_iov, 121 _gss_spnego_wrap_iov_length, 122 NULL, 123 _gss_spnego_export_cred, 124 _gss_spnego_import_cred, 125 NULL, 126 NULL, 127 NULL, 128 NULL, 129 NULL, 130 NULL, 131 NULL, 132 spnego_mo, 133 sizeof(spnego_mo) / sizeof(spnego_mo[0]) 134}; 135 136gssapi_mech_interface 137__gss_spnego_initialize(void) 138{ 139 return &spnego_mech; 140} 141